| LPCOpen Platform v1.03 LPCOpen Platform for NXP LPC Microcontrollers

- Main Page
- Modules
- Data Structures
- Files
- Related Pages

- File List
- Globals

All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
sct_fsm_keil_mcb_18574357.c
Go to the documentation of this file.
1
2 /* Generated by fzmparser version 1.14 --- DO NOT EDIT! */
3
4 /* Uses following resources: */
5 /* [12 events, 5+0 states, 2 inputs, 4 outputs, 1 match regs, 0 capture regs] */
6
7 #include "sct_fsm.h"
8
9
10 void sct_fsm_init (void)
11 {
12
13 /* MATCH/CAPTURE registers */
14 LPC_SCT->REGMODE_L = 0x0000; /* L: 1x MATCH, 0x CAPTURE, 15 unused */
15 LPC_SCT->REGMODE_H = 0x0000; /* H: 0x MATCH, 0x CAPTURE, 16 unused */
16 LPC_SCT->MATCH_L[0] = speed;
17 LPC_SCT->MATCHREL_L[0] = speed;
18
19 /* OUTPUT registers */
20 LPC_SCT->OUT[14].SET = 0x00000210; /* LED1 */
21 LPC_SCT->OUT[14].CLR = 0x00000844;
22 LPC_SCT->OUT[10].SET = 0x00000024; /* LED2 */
23 LPC_SCT->OUT[10].CLR = 0x00000818;
24 LPC_SCT->OUT[13].SET = 0x00000108; /* LED3 */
25 LPC_SCT->OUT[13].CLR = 0x000008A0;
26 LPC_SCT->OUT[11].SET = 0x00000480; /* LED4 */
27 LPC_SCT->OUT[11].CLR = 0x00000902;
28 /* Unused outputs must not be affected by any event */
29 LPC_SCT->OUT[0].SET = 0;
30 LPC_SCT->OUT[0].CLR = 0;
31 LPC_SCT->OUT[1].SET = 0;
32 LPC_SCT->OUT[1].CLR = 0;
33 LPC_SCT->OUT[2].SET = 0;
34 LPC_SCT->OUT[2].CLR = 0;
35 LPC_SCT->OUT[3].SET = 0;
36 LPC_SCT->OUT[3].CLR = 0;
37 LPC_SCT->OUT[4].SET = 0;
38 LPC_SCT->OUT[4].CLR = 0;
39 LPC_SCT->OUT[5].SET = 0;
40 LPC_SCT->OUT[5].CLR = 0;
41 LPC_SCT->OUT[6].SET = 0;
42 LPC_SCT->OUT[6].CLR = 0;
43 LPC_SCT->OUT[7].SET = 0;
44 LPC_SCT->OUT[7].CLR = 0;
45 LPC_SCT->OUT[8].SET = 0;
46 LPC_SCT->OUT[8].CLR = 0;
47 LPC_SCT->OUT[9].SET = 0;
48 LPC_SCT->OUT[9].CLR = 0;
49 LPC_SCT->OUT[12].SET = 0;
50 LPC_SCT->OUT[12].CLR = 0;
51 LPC_SCT->OUT[15].SET = 0;
52 LPC_SCT->OUT[15].CLR = 0;
53 LPC_SCT->OUTPUT = (LPC_SCT->OUTPUT & ~0x00006C00) | 0x00000000;
54
55 /* Conflict resolution register */
56
57 /* EVENT registers */
58 LPC_SCT->EVENT[1].CTRL = 0x00007100; /* L: --> state L_ENTRY */
59 LPC_SCT->EVENT[1].STATE = 0x00000008;
60 LPC_SCT->EVENT[11].CTRL = 0x00006CC0; /* L: --> state L_ENTRY */
61 LPC_SCT->EVENT[11].STATE = 0xFFFFFFFF;
62 LPC_SCT->EVENT[2].CTRL = 0x00017100; /* L: --> state LED2on */
63 LPC_SCT->EVENT[2].STATE = 0x00000002;
64 LPC_SCT->EVENT[3].CTRL = 0x00027100; /* L: --> state LED3on */
65 LPC_SCT->EVENT[3].STATE = 0x00000004;
66 LPC_SCT->EVENT[0].CTRL = 0x00001000; /* L: */
67 LPC_SCT->EVENT[0].STATE = 0xFFFFFFFF;
68 LPC_SCT->EVENT[4].CTRL = 0x0000FD00; /* L: --> state LED1on */
69 LPC_SCT->EVENT[4].STATE = 0x00000004;
70 LPC_SCT->EVENT[5].CTRL = 0x00017D00; /* L: --> state LED2on */
71 LPC_SCT->EVENT[5].STATE = 0x00000010;
72 LPC_SCT->EVENT[6].CTRL = 0x00007D00; /* L: --> state L_ENTRY */
73 LPC_SCT->EVENT[6].STATE = 0x00000002;
74 LPC_SCT->EVENT[7].CTRL = 0x0001F100; /* L: --> state LED4on */
75 LPC_SCT->EVENT[7].STATE = 0x00000010;
76 LPC_SCT->EVENT[8].CTRL = 0x00027D00; /* L: --> state LED3on */
77 LPC_SCT->EVENT[8].STATE = 0x00000008;
78 LPC_SCT->EVENT[9].CTRL = 0x0000F100; /* L: --> state LED1on */
79 LPC_SCT->EVENT[9].STATE = 0x00000001;
80 LPC_SCT->EVENT[10].CTRL = 0x0001FD00; /* L: --> state LED4on */
81 LPC_SCT->EVENT[10].STATE = 0x00000001;
82 /* Unused events must not have any effect */
83 LPC_SCT->EVENT[12].STATE = 0;
84 LPC_SCT->EVENT[13].STATE = 0;
85 LPC_SCT->EVENT[14].STATE = 0;
86 LPC_SCT->EVENT[15].STATE = 0;
87
88 /* STATE registers */
89 LPC_SCT->STATE_L = 0;
90 LPC_SCT->STATE_H = 0; /* implicit value */
91
92 /* state names assignment: */
93 /* State L 0: L_ENTRY */
94 /* State L 1: LED1on */
95 /* State L 2: LED2on */
96 /* State L 3: LED4on */
97 /* State L 4: LED3on */
98
99 /* CORE registers */
100 LPC_SCT->START_L = 0x0000;
101 LPC_SCT->STOP_L = 0x0000;
102 LPC_SCT->HALT_L = 0x0000;
103 LPC_SCT->LIMIT_L = 0x0001;
104 LPC_SCT->START_H = 0x0000;
105 LPC_SCT->STOP_H = 0x0000;
106 LPC_SCT->HALT_H = 0x0000;
107 LPC_SCT->LIMIT_H = 0x0000;
108 LPC_SCT->EVEN = 0x00000000;
109 LPC_SCT->DMA0REQUEST = 0x00000000;
110 LPC_SCT->DMA1REQUEST = 0x00000000;
111
112 }