-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathIO.s43
61 lines (50 loc) · 1.69 KB
/
IO.s43
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#include "msp430.h" ; #define controlled include file
MODULE testModule
PUBLIC S1InterruptWithCallback, S2InterruptWithCallback, activateLed1, deactivateLed1
RSEG CSTACK ; pre-declaration of segment
RSEG CODE ; place program in 'CODE' segment
;Objetivo: S1 Interrupt With Callback
;Precondiciones: pon funcion a llamarse en R5
;Postcondiciones:
;Autor: Kenneth J Rosario
;Fecha: 11/marzo/2021
S1InterruptWithCallback:
bit.b #00000010b, &P1IFG ; Test P1IFG to detect if there is
; an interrupt generated by P1.1
; that corresponds to push button S1
jz CleanupS1InterruptWithCallback
bic.b #00000010b, &P1IFG ; Clear interrupt flag
call R5
CleanupS1InterruptWithCallback:
ret
;Objetivo: S1 Interrupt With Callback
;Precondiciones: pon funcion a llamarse en R5
;Postcondiciones:
;Autor: Kenneth J Rosario
;Fecha: 11/marzo/2021
S2InterruptWithCallback:
bit.b #00000100b, &P1IFG ; Test P1IFG to detect if there is
; an interrupt generated by P1.2
; that corresponds to push button S1
jz CleanupS2InterruptWithCallback
bic.b #00000100b, &P1IFG ; Clear interrupt flag
call R5
CleanupS2InterruptWithCallback:
ret
;Objetivo: Prende lED1 P1.0
;Precondiciones:
;Postcondiciones:
;Autor: Kenneth J Rosario
;Fecha: 11/marzo/2021
activateLed1:
bis.b #0x01, &P1OUT
ret
;Objetivo: Apaga lED1 P1.0
;Precondiciones:
;Postcondiciones:
;Autor: Kenneth J Rosario
;Fecha: 11/marzo/2021
deactivateLed1:
bic.b #0x01, &P1OUT
ret
END