1 /** ###################################################################
2 ** THIS BEAN MODULE IS GENERATED BY THE TOOL. DO NOT MODIFY IT.
5 ** Processor : MC9S12DP256BCPV
6 ** Beantype : AsynchroSerial
7 ** Version : Bean 02.231, Driver 01.08, CPU db: 2.87.283
8 ** Compiler : Metrowerks HC12 C Compiler
9 ** Date/Time : 19/06/2005, 15:07
11 ** This bean "AsynchroSerial" implements an asynchronous serial
12 ** communication. The bean supports different settings of
13 ** parity, word width, stop-bit and communication speed,
14 ** user can select interrupt or polling handler.
15 ** Communication speed can be changed also in runtime.
16 ** The bean requires one on-chip asynchronous serial channel.
18 ** Serial channel : SCI0
21 ** Init baud rate : 38400baud
28 ** Input buffer : SCI0DRL [207]
29 ** Output buffer : SCI0DRL [207]
30 ** Control register : SCI0CR1 [202]
31 ** Mode register : SCI0CR2 [203]
32 ** Baud setting reg. : SCI0BD [200]
33 ** Special register : SCI0SR1 [204]
36 ** Vector name : INT_SCI0
40 ** Vector name : INT_SCI0
44 ** ----------------------------------------------------
45 ** Function | On package | Name
46 ** ----------------------------------------------------
47 ** Input | 89 | PS0_RxD0
48 ** Output | 90 | PS1_TxD0
49 ** ----------------------------------------------------
53 ** ----------------------------------------------------
54 ** No. | Mode ID | Baud rate
55 ** ----------------------------------------------------
56 ** 0 | Bm_38400baud | 38400baud
57 ** 1 | Bm_19200baud | 19200baud
58 ** 2 | Bm_9600baud | 9600baud
59 ** 3 | Bm_4800baud | 4800baud
60 ** ----------------------------------------------------
62 ** SetBaudRateMode - byte COM0_SetBaudRateMode(byte Mod);
64 ** (c) Copyright UNIS, spol. s r.o. 1997-2002
69 ** http : www.processorexpert.com
70 ** mail : info@processorexpert.com
71 ** ###################################################################*/
80 #define COM0_Bm_38400baud 0 /* Constant for switch to mode 0 */
81 #define COM0_Bm_19200baud 1 /* Constant for switch to mode 1 */
82 #define COM0_Bm_9600baud 2 /* Constant for switch to mode 2 */
83 #define COM0_Bm_4800baud 3 /* Constant for switch to mode 3 */
87 #ifndef __BWUserType_tItem
88 #define __BWUserType_tItem
89 typedef struct { /* Item of the index table for possible baudrates */
90 word div; /* divisior */
91 byte val; /* values of the prescalers */
94 #ifndef __BWUserType_COM0_TError
95 #define __BWUserType_COM0_TError
99 bool OverRun : 1; /* OverRun error flag */
100 bool Framing : 1; /* Framing error flag */
101 bool Parity : 1; /* Parity error flag */
102 bool RxBufOvf : 1; /* Rx buffer full error flag */
103 bool Noise : 1; /* Noise error */
104 bool Break : 1; /* Break detect */
105 bool Idle : 1; /* Idle characted */
109 #ifndef __BWUserType_TDirection
110 #define __BWUserType_TDirection
117 #ifndef __BWUserType_COM0_TComData
118 #define __BWUserType_COM0_TComData
119 typedef byte COM0_TComData ; /* User type for communication. Size of this type depends on the communication data witdh. */
122 #pragma CODE_SEG COM0_CODE /* Code section for this module. */
124 byte COM0_SetBaudRateMode(byte Mod);
126 ** ===================================================================
127 ** Method : COM0_SetBaudRateMode (bean AsynchroSerial)
130 ** This method changes the channel communication speed (baud
131 ** rate). This method can be used only if you specify a list
132 ** of possible period settings at design time (see <Timing
133 ** dialog box> - Runtime setting - from a list of values).
134 ** Each of these settings constitutes a mode and Processor
135 ** Expert^[TM] assigns them a mode identifier. The prescaler
136 ** and compare values corresponding to each mode are
137 ** calculated at design time. You may switch modes at
138 ** runtime by referring only to a mode identifier. No
139 ** run-time calculations are performed, all the calculations
140 ** are performed at design time.
142 ** NAME - DESCRIPTION
143 ** Mod - Timing mode to set
145 ** --- - Error code, possible codes:
147 ** ERR_SPEED - This device does not work in
148 ** the active speed mode
149 ** ===================================================================
152 #pragma CODE_SEG __NEAR_SEG NON_BANKED /* Interrupt section for this module. Placement will be in NON_BANKED area. */
153 __interrupt void COM0_Interrupt(void);
154 #pragma CODE_SEG COM0_CODE /* Code section for this module. */
156 ** ===================================================================
157 ** Method : COM0_Interrupt (bean AsynchroSerial)
160 ** This method is internal. It is used by Processor Expert
162 ** ===================================================================
166 void COM0_Init(void);
168 ** ===================================================================
169 ** Method : COM0_Init (bean AsynchroSerial)
172 ** This method is internal. It is used by Processor Expert
174 ** ===================================================================
178 #pragma CODE_SEG DEFAULT /* Change code section to DEFAULT. */
183 ** ###################################################################
185 ** This file was created by UNIS Processor Expert 03.33 for
186 ** the Motorola HCS12 series of microcontrollers.
188 ** ###################################################################
191 #endif /* ifndef __COM0 */