embox

Форк
0
50 строк · 828.0 Байт
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 	  0x180
16

17
#define TACTL_IE  (1 << 1)
18
#define TACTL_IFG (1 << 0)
19

20
#define TRIGGERABLE_IRQ 28
21

22
void irqctrl_enable(unsigned int interrupt_nr) {
23
	if (interrupt_nr != TRIGGERABLE_IRQ) {
24
		return;
25
	}
26
	REG_ORIN(TACTL, TACTL_IE);
27
}
28

29
void irqctrl_disable(unsigned int interrupt_nr) {
30
	if (interrupt_nr != TRIGGERABLE_IRQ) {
31
		return;
32
	}
33
	REG_ANDIN(TACTL, ~TACTL_IE);
34
}
35

36
void irqctrl_clear(unsigned int interrupt_nr) {
37
	if (interrupt_nr != TRIGGERABLE_IRQ) {
38
		return;
39
	}
40
	REG_ANDIN(TACTL, ~TACTL_IFG);
41
}
42

43
void irqctrl_force(unsigned int interrupt_nr) {
44
	if (interrupt_nr != TRIGGERABLE_IRQ) {
45
		return;
46
	}
47
	REG_ORIN(TACTL, TACTL_IFG);
48
}
49

50
IRQCTRL_DEF(msp430_intc, NULL);
51

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.