]> git.sur5r.net Git - freertos/blob - FreeRTOS/Demo/HCS12_CodeWarrior_banked/CODE/COM0.H
Add FreeRTOS-Plus directory.
[freertos] / FreeRTOS / Demo / HCS12_CodeWarrior_banked / CODE / COM0.H
1 /** ###################################################################\r
2 **     THIS BEAN MODULE IS GENERATED BY THE TOOL. DO NOT MODIFY IT.\r
3 **     Filename  : COM0.H\r
4 **     Project   : RTOSDemo\r
5 **     Processor : MC9S12DP256BCPV\r
6 **     Beantype  : AsynchroSerial\r
7 **     Version   : Bean 02.231, Driver 01.08, CPU db: 2.87.283\r
8 **     Compiler  : Metrowerks HC12 C Compiler\r
9 **     Date/Time : 19/06/2005, 15:07\r
10 **     Abstract  :\r
11 **         This bean "AsynchroSerial" implements an asynchronous serial\r
12 **         communication. The bean supports different settings of \r
13 **         parity, word width, stop-bit and communication speed,\r
14 **         user can select interrupt or polling handler.\r
15 **         Communication speed can be changed also in runtime.\r
16 **         The bean requires one on-chip asynchronous serial channel.\r
17 **     Settings  :\r
18 **         Serial channel              : SCI0\r
19 **\r
20 **         Protocol\r
21 **             Init baud rate          : 38400baud\r
22 **             Width                   : 8 bits\r
23 **             Stop bits               : 1\r
24 **             Parity                  : none\r
25 **             Breaks                  : Disabled\r
26 **\r
27 **         Registers\r
28 **             Input buffer            : SCI0DRL   [207]\r
29 **             Output buffer           : SCI0DRL   [207]\r
30 **             Control register        : SCI0CR1   [202]\r
31 **             Mode register           : SCI0CR2   [203]\r
32 **             Baud setting reg.       : SCI0BD    [200]\r
33 **             Special register        : SCI0SR1   [204]\r
34 **\r
35 **         Input interrupt\r
36 **             Vector name             : INT_SCI0\r
37 **             Priority                : 1\r
38 **\r
39 **         Output interrupt\r
40 **             Vector name             : INT_SCI0\r
41 **             Priority                : 1\r
42 **\r
43 **         Used pins                   : \r
44 **             ----------------------------------------------------\r
45 **               Function | On package |    Name\r
46 **             ----------------------------------------------------\r
47 **                Input   |     89     |  PS0_RxD0\r
48 **                Output  |     90     |  PS1_TxD0\r
49 **             ----------------------------------------------------\r
50 **\r
51 **\r
52 **         Used baud modes             :\r
53 **             ----------------------------------------------------\r
54 **               No. |    Mode ID      |  Baud rate\r
55 **             ----------------------------------------------------\r
56 **                0  |  Bm_38400baud   |  38400baud\r
57 **                1  |  Bm_19200baud   |  19200baud\r
58 **                2  |  Bm_9600baud    |  9600baud\r
59 **                3  |  Bm_4800baud    |  4800baud\r
60 **             ----------------------------------------------------\r
61 **     Contents  :\r
62 **         SetBaudRateMode - byte COM0_SetBaudRateMode(byte Mod);\r
63 **\r
64 **     (c) Copyright UNIS, spol. s r.o. 1997-2002\r
65 **     UNIS, spol. s r.o.\r
66 **     Jundrovska 33\r
67 **     624 00 Brno\r
68 **     Czech Republic\r
69 **     http      : www.processorexpert.com\r
70 **     mail      : info@processorexpert.com\r
71 ** ###################################################################*/\r
72 \r
73 #ifndef __COM0\r
74 #define __COM0\r
75 \r
76 /* MODULE COM0. */\r
77 \r
78 #include "Cpu.h"\r
79 \r
80 #define COM0_Bm_38400baud         0    /* Constant for switch to mode 0 */\r
81 #define COM0_Bm_19200baud         1    /* Constant for switch to mode 1 */\r
82 #define COM0_Bm_9600baud          2    /* Constant for switch to mode 2 */\r
83 #define COM0_Bm_4800baud          3    /* Constant for switch to mode 3 */\r
84 \r
85 \r
86 \r
87 #ifndef __BWUserType_tItem\r
88 #define __BWUserType_tItem\r
89   typedef struct {                     /* Item of the index table for possible baudrates */\r
90     word div;                          /* divisior */\r
91     byte val;                          /* values of the prescalers */\r
92   } tItem;\r
93 #endif\r
94 #ifndef __BWUserType_COM0_TError\r
95 #define __BWUserType_COM0_TError\r
96 typedef union {\r
97   byte err;\r
98   struct {\r
99     bool OverRun  : 1;                 /* OverRun error flag */\r
100     bool Framing  : 1;                 /* Framing error flag */\r
101     bool Parity   : 1;                 /* Parity error flag */\r
102     bool RxBufOvf : 1;                 /* Rx buffer full error flag */\r
103     bool Noise    : 1;                 /* Noise error */\r
104     bool Break    : 1;                 /* Break detect */\r
105     bool Idle     : 1;                 /* Idle characted */\r
106   }errName;\r
107 } COM0_TError;\r
108 #endif\r
109 #ifndef __BWUserType_TDirection\r
110 #define __BWUserType_TDirection\r
111   typedef enum {                       /*  */\r
112     TXD_INPUT,\r
113     TXD_OUTPUT\r
114   } TDirection;\r
115 #endif\r
116 \r
117 #ifndef __BWUserType_COM0_TComData\r
118 #define __BWUserType_COM0_TComData\r
119   typedef byte COM0_TComData ;         /* User type for communication. Size of this type depends on the communication data witdh. */\r
120 #endif\r
121 \r
122 #pragma CODE_SEG COM0_CODE             /* Code section for this module. */\r
123 \r
124 byte COM0_SetBaudRateMode(byte Mod);\r
125 /*\r
126 ** ===================================================================\r
127 **     Method      :  COM0_SetBaudRateMode (bean AsynchroSerial)\r
128 **\r
129 **     Description :\r
130 **         This method changes the channel communication speed (baud\r
131 **         rate). This method can be used only if you specify a list\r
132 **         of possible period settings at design time (see <Timing\r
133 **         dialog box> - Runtime setting - from a list of values).\r
134 **         Each of these settings constitutes a mode and Processor\r
135 **         Expert^[TM] assigns them a mode identifier. The prescaler\r
136 **         and compare values corresponding to each mode are\r
137 **         calculated at design time. You may switch modes at\r
138 **         runtime by referring only to a mode identifier. No\r
139 **         run-time calculations are performed, all the calculations\r
140 **         are performed at design time.\r
141 **     Parameters  :\r
142 **         NAME            - DESCRIPTION\r
143 **         Mod             - Timing mode to set\r
144 **     Returns     :\r
145 **         ---             - Error code, possible codes:\r
146 **                           ERR_OK - OK\r
147 **                           ERR_SPEED - This device does not work in\r
148 **                           the active speed mode\r
149 ** ===================================================================\r
150 */\r
151 \r
152 #pragma CODE_SEG __NEAR_SEG NON_BANKED /* Interrupt section for this module. Placement will be in NON_BANKED area. */\r
153 __interrupt void COM0_Interrupt(void);\r
154 #pragma CODE_SEG COM0_CODE             /* Code section for this module. */\r
155 /*\r
156 ** ===================================================================\r
157 **     Method      :  COM0_Interrupt (bean AsynchroSerial)\r
158 **\r
159 **     Description :\r
160 **         This method is internal. It is used by Processor Expert\r
161 **         only.\r
162 ** ===================================================================\r
163 */\r
164 \r
165 \r
166 void COM0_Init(void);\r
167 /*\r
168 ** ===================================================================\r
169 **     Method      :  COM0_Init (bean AsynchroSerial)\r
170 **\r
171 **     Description :\r
172 **         This method is internal. It is used by Processor Expert\r
173 **         only.\r
174 ** ===================================================================\r
175 */\r
176 \r
177 \r
178 #pragma CODE_SEG DEFAULT               /* Change code section to DEFAULT. */\r
179 \r
180 /* END COM0. */\r
181 \r
182 /*\r
183 ** ###################################################################\r
184 **\r
185 **     This file was created by UNIS Processor Expert 03.33 for \r
186 **     the Motorola HCS12 series of microcontrollers.\r
187 **\r
188 ** ###################################################################\r
189 */\r
190 \r
191 #endif /* ifndef __COM0 */\r