embox
1/**
2* @file
3* @brief
4*
5* @author Anton Kozlov
6* @date 26.08.2013
7*/
8
9#include <stddef.h>10
11#include <hal/reg.h>12
13#include <drivers/irqctrl.h>14
15#define TACTL 0x18016
17#define TACTL_IE (1 << 1)18#define TACTL_IFG (1 << 0)19
20#define TRIGGERABLE_IRQ 2821
22void irqctrl_enable(unsigned int interrupt_nr) {23if (interrupt_nr != TRIGGERABLE_IRQ) {24return;25}26REG_ORIN(TACTL, TACTL_IE);27}
28
29void irqctrl_disable(unsigned int interrupt_nr) {30if (interrupt_nr != TRIGGERABLE_IRQ) {31return;32}33REG_ANDIN(TACTL, ~TACTL_IE);34}
35
36void irqctrl_clear(unsigned int interrupt_nr) {37if (interrupt_nr != TRIGGERABLE_IRQ) {38return;39}40REG_ANDIN(TACTL, ~TACTL_IFG);41}
42
43void irqctrl_force(unsigned int interrupt_nr) {44if (interrupt_nr != TRIGGERABLE_IRQ) {45return;46}47REG_ORIN(TACTL, TACTL_IFG);48}
49
50IRQCTRL_DEF(msp430_intc, NULL);51