1 /** ###################################################################
\r
2 ** THIS BEAN MODULE IS GENERATED BY THE TOOL. DO NOT MODIFY IT.
\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
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
18 ** Serial channel : SCI0
\r
21 ** Init baud rate : 38400baud
\r
25 ** Breaks : Disabled
\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
36 ** Vector name : INT_SCI0
\r
40 ** Vector name : INT_SCI0
\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
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
62 ** SetBaudRateMode - byte COM0_SetBaudRateMode(byte Mod);
\r
64 ** (c) Copyright UNIS, spol. s r.o. 1997-2002
\r
65 ** UNIS, spol. s r.o.
\r
69 ** http : www.processorexpert.com
\r
70 ** mail : info@processorexpert.com
\r
71 ** ###################################################################*/
\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
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
94 #ifndef __BWUserType_COM0_TError
\r
95 #define __BWUserType_COM0_TError
\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
109 #ifndef __BWUserType_TDirection
\r
110 #define __BWUserType_TDirection
\r
111 typedef enum { /* */
\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
122 #pragma CODE_SEG COM0_CODE /* Code section for this module. */
\r
124 byte COM0_SetBaudRateMode(byte Mod);
\r
126 ** ===================================================================
\r
127 ** Method : COM0_SetBaudRateMode (bean AsynchroSerial)
\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
142 ** NAME - DESCRIPTION
\r
143 ** Mod - Timing mode to set
\r
145 ** --- - Error code, possible codes:
\r
147 ** ERR_SPEED - This device does not work in
\r
148 ** the active speed mode
\r
149 ** ===================================================================
\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
156 ** ===================================================================
\r
157 ** Method : COM0_Interrupt (bean AsynchroSerial)
\r
160 ** This method is internal. It is used by Processor Expert
\r
162 ** ===================================================================
\r
166 void COM0_Init(void);
\r
168 ** ===================================================================
\r
169 ** Method : COM0_Init (bean AsynchroSerial)
\r
172 ** This method is internal. It is used by Processor Expert
\r
174 ** ===================================================================
\r
178 #pragma CODE_SEG DEFAULT /* Change code section to DEFAULT. */
\r
183 ** ###################################################################
\r
185 ** This file was created by UNIS Processor Expert 03.33 for
\r
186 ** the Motorola HCS12 series of microcontrollers.
\r
188 ** ###################################################################
\r
191 #endif /* ifndef __COM0 */
\r