-
Notifications
You must be signed in to change notification settings - Fork 4
/
MAIN.h
216 lines (159 loc) · 6.54 KB
/
MAIN.h
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
//****************************************************************************
// @Module Project Settings
// @Filename MAIN.h
// @Project DAVE_SG.dav
//----------------------------------------------------------------------------
// @Controller Infineon TC1797
//
// @Compiler Tasking 3.1
//
// @Codegenerator 1.0
//
// @Description This file contains all function prototypes and macros for
// the MAIN module.
//
//----------------------------------------------------------------------------
// @Date 2013-11-20 13:40:30
//
//****************************************************************************
// USER CODE BEGIN (MAIN_Header,1)
// USER CODE END
#ifndef _MAIN_H_
#define _MAIN_H_
//****************************************************************************
// @Project Includes
//****************************************************************************
// USER CODE BEGIN (MAIN_Header,2)
// USER CODE END
//****************************************************************************
// @Macros
//****************************************************************************
// USER CODE BEGIN (MAIN_Header,3)
// USER CODE END
//****************************************************************************
// @Defines
//****************************************************************************
// compiler dependent names of builtin functions
#define MTCR __mtcr
#define ISYNC __isync
#define DISABLE __disable
#define ENABLE __enable
#define INTERRUPT __interrupt
// USER CODE BEGIN (MAIN_Header,4)
// USER CODE END
//****************************************************************************
// @Typedefs
//****************************************************************************
typedef unsigned char ubyte; // 1 byte unsigned; prefix: ub
typedef signed char sbyte; // 1 byte signed; prefix: sb
typedef unsigned short ushort; // 2 byte unsigned; prefix: us
typedef signed short sshort; // 2 byte signed; prefix: ss
typedef unsigned int uword; // 4 byte unsigned; prefix: uw
typedef signed int sword; // 4 byte signed; prefix: sw
typedef volatile struct
{
unsigned int bit0 : 1;
unsigned int bit1 : 1;
unsigned int bit2 : 1;
unsigned int bit3 : 1;
unsigned int bit4 : 1;
unsigned int bit5 : 1;
unsigned int bit6 : 1;
unsigned int bit7 : 1;
unsigned int bit8 : 1;
unsigned int bit9 : 1;
unsigned int bit10 : 1;
unsigned int bit11 : 1;
unsigned int bit12 : 1;
unsigned int bit13 : 1;
unsigned int bit14 : 1;
unsigned int bit15 : 1;
unsigned int bit16 : 1;
unsigned int bit17 : 1;
unsigned int bit18 : 1;
unsigned int bit19 : 1;
unsigned int bit20 : 1;
unsigned int bit21 : 1;
unsigned int bit22 : 1;
unsigned int bit23 : 1;
unsigned int bit24 : 1;
unsigned int bit25 : 1;
unsigned int bit26 : 1;
unsigned int bit27 : 1;
unsigned int bit28 : 1;
unsigned int bit29 : 1;
unsigned int bit30 : 1;
unsigned int bit31 : 1;
} T_Reg32;
// USER CODE BEGIN (MAIN_Header,5)
// USER CODE END
//****************************************************************************
// @Imported Global Variables
//****************************************************************************
// USER CODE BEGIN (MAIN_Header,6)
// USER CODE END
//****************************************************************************
// @Global Variables
//****************************************************************************
// USER CODE BEGIN (MAIN_Header,7)
// USER CODE END
//****************************************************************************
// @Prototypes Of Global Functions
//****************************************************************************
void MAIN_vWriteWDTCON0(uword uwValue);
// USER CODE BEGIN (MAIN_Header,8)
// USER CODE END
//****************************************************************************
// @Macro MAIN_vSetENDINIT()
//
//----------------------------------------------------------------------------
// @Description This macro sets the EndInit bit, which controls access to
// system critical registers. Setting the EndInit bit locks
// all EndInit protected registers.
//
//----------------------------------------------------------------------------
// @Returnvalue None
//
//----------------------------------------------------------------------------
// @Parameters None
//
//----------------------------------------------------------------------------
// @Date 2013-11-20
//
//****************************************************************************
#define MAIN_vSetENDINIT() MAIN_vWriteWDTCON0(WDT_CON0.U | 0x00000001)
//****************************************************************************
// @Macro MAIN_vResetENDINIT()
//
//----------------------------------------------------------------------------
// @Description This macro clears the EndInit bit, which controls access to
// system critical registers. Clearing the EndInit bit unlocks
// all EndInit protected registers. Modifications of the
// EndInit bit are monitored by the watchdog timer such that
// after clearing EndInit, the watchdog timer enters a defined
// time-out mode; EndInit must be set again before the
// time-out expires.
//
//----------------------------------------------------------------------------
// @Returnvalue None
//
//----------------------------------------------------------------------------
// @Parameters None
//
//----------------------------------------------------------------------------
// @Date 2013-11-20
//
//****************************************************************************
#define MAIN_vResetENDINIT() MAIN_vWriteWDTCON0(WDT_CON0.U & ~0x00000001);while (WDT_CON0.B.ENDINIT != 0)
//****************************************************************************
// @Interrupt Vectors
//****************************************************************************
// USER CODE BEGIN (MAIN_Header,9)
// USER CODE END
//****************************************************************************
// @Project Includes
//****************************************************************************
#include "CAN.h"
// USER CODE BEGIN (MAIN_Header,10)
// USER CODE END
#endif // ifndef _MAIN_H_