| 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_ngx_xplorer_18304330.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 /* [8 events, 5+1 states, 0 inputs, 5 outputs, 2 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: 1x MATCH, 0x CAPTURE, 15 unused */
16 LPC_SCT->MATCH_L[0] = togglePeriodValue;
17 LPC_SCT->MATCHREL_L[0] = togglePeriodValue;
18 LPC_SCT->MATCH_H[0] = jumpPeriodValue;
19 LPC_SCT->MATCHREL_H[0] = jumpPeriodValue;
20
21 /* OUTPUT registers */
22 LPC_SCT->OUT[6].SET = 0x00000080; /* JUMP_SIGNAL */
23 LPC_SCT->OUT[6].CLR = 0x0000000C;
24 LPC_SCT->OUT[5].SET = 0x00000049; /* CTOUT0 */
25 LPC_SCT->OUT[5].CLR = 0x00000041;
26 LPC_SCT->OUT[4].SET = 0x00000029; /* CTOUT1 */
27 LPC_SCT->OUT[4].CLR = 0x00000021;
28 LPC_SCT->OUT[2].SET = 0x0000000B; /* CTOUT2 */
29 LPC_SCT->OUT[2].CLR = 0x00000003;
30 LPC_SCT->OUT[3].SET = 0x0000001D; /* CTOUT3 */
31 LPC_SCT->OUT[3].CLR = 0x00000011;
32 /* Unused outputs must not be affected by any event */
33 LPC_SCT->OUT[0].SET = 0;
34 LPC_SCT->OUT[0].CLR = 0;
35 LPC_SCT->OUT[1].SET = 0;
36 LPC_SCT->OUT[1].CLR = 0;
37 LPC_SCT->OUT[7].SET = 0;
38 LPC_SCT->OUT[7].CLR = 0;
39 LPC_SCT->OUT[8].SET = 0;
40 LPC_SCT->OUT[8].CLR = 0;
41 LPC_SCT->OUT[9].SET = 0;
42 LPC_SCT->OUT[9].CLR = 0;
43 LPC_SCT->OUT[10].SET = 0;
44 LPC_SCT->OUT[10].CLR = 0;
45 LPC_SCT->OUT[11].SET = 0;
46 LPC_SCT->OUT[11].CLR = 0;
47 LPC_SCT->OUT[12].SET = 0;
48 LPC_SCT->OUT[12].CLR = 0;
49 LPC_SCT->OUT[13].SET = 0;
50 LPC_SCT->OUT[13].CLR = 0;
51 LPC_SCT->OUT[14].SET = 0;
52 LPC_SCT->OUT[14].CLR = 0;
53 LPC_SCT->OUT[15].SET = 0;
54 LPC_SCT->OUT[15].CLR = 0;
55 LPC_SCT->OUTPUT = (LPC_SCT->OUTPUT & ~0x00000040) | 0x0000003C;
56
57 /* Conflict resolution register */
58 LPC_SCT->RES = (LPC_SCT->RES & ~0x00000FF0) | 0x00000FF0;
59
60 /* EVENT registers */
61 LPC_SCT->EVENT[0].CTRL = 0x000FD000; /* L: "event_1" --> state L_ENTRY */
62 LPC_SCT->EVENT[0].STATE = 0x80000000;
63 LPC_SCT->EVENT[1].CTRL = 0x00015000; /* L: "event_7" --> state CTOUT2_toggle */
64 LPC_SCT->EVENT[1].STATE = 0x00000004;
65 LPC_SCT->EVENT[2].CTRL = 0x000FE5A0; /* L: "event_10" --> state L_ENTRY */
66 LPC_SCT->EVENT[2].STATE = 0x00000008;
67 LPC_SCT->EVENT[3].CTRL = 0x0000A5A0; /* L: "event_4" --> state +1 */
68 LPC_SCT->EVENT[3].STATE = 0x80000007;
69 LPC_SCT->EVENT[4].CTRL = 0x0001D000; /* L: "event_9" --> state CTOUT3_toggle */
70 LPC_SCT->EVENT[4].STATE = 0x00000008;
71 LPC_SCT->EVENT[5].CTRL = 0x0000D000; /* L: "event_5" --> state CTOUT1_toggle */
72 LPC_SCT->EVENT[5].STATE = 0x00000002;
73 LPC_SCT->EVENT[6].CTRL = 0x00005000; /* L: "event_3" --> state CTOUT0_toggle */
74 LPC_SCT->EVENT[6].STATE = 0x00000001;
75 LPC_SCT->EVENT[7].CTRL = 0x00005010; /* H: "event_0" --> state H_ENTRY */
76 LPC_SCT->EVENT[7].STATE = 0x00000001;
77 /* Unused events must not have any effect */
78 LPC_SCT->EVENT[8].STATE = 0;
79 LPC_SCT->EVENT[9].STATE = 0;
80 LPC_SCT->EVENT[10].STATE = 0;
81 LPC_SCT->EVENT[11].STATE = 0;
82 LPC_SCT->EVENT[12].STATE = 0;
83 LPC_SCT->EVENT[13].STATE = 0;
84 LPC_SCT->EVENT[14].STATE = 0;
85 LPC_SCT->EVENT[15].STATE = 0;
86
87 /* STATE registers */
88 LPC_SCT->STATE_L = 31;
89 LPC_SCT->STATE_H = 0;
90
91 /* state names assignment: */
92 /* State L 2: CTOUT2_toggle */
93 /* State L31: L_ENTRY */
94 /* State L 0: CTOUT0_toggle */
95 /* State L 3: CTOUT3_toggle */
96 /* State L 1: CTOUT1_toggle */
97 /* State H 0: H_ENTRY */
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 = 0x00F3;
104 LPC_SCT->START_H = 0x0000;
105 LPC_SCT->STOP_H = 0x0000;
106 LPC_SCT->HALT_H = 0x0000;
107 LPC_SCT->LIMIT_H = 0x0080;
108 LPC_SCT->EVEN = 0x00000000;
109 LPC_SCT->DMA0REQUEST = 0x00000000;
110 LPC_SCT->DMA1REQUEST = 0x00000000;
111
112 }