1 | /*
|
---|
2 | * TOPPERS/ASP Kernel
|
---|
3 | * Toyohashi Open Platform for Embedded Real-Time Systems/
|
---|
4 | * Advanced Standard Profile Kernel
|
---|
5 | *
|
---|
6 | * Copyright (C) 2015 by Embedded and Real-Time Systems Laboratory
|
---|
7 | * Graduate School of Information Science, Nagoya Univ., JAPAN
|
---|
8 | *
|
---|
9 | * ä¸è¨è使¨©è
|
---|
10 | ã¯ï¼ä»¥ä¸ã®(1)ï½(4)ã®æ¡ä»¶ãæºããå ´åã«éãï¼æ¬ã½ããã¦ã§
|
---|
11 | * ã¢ï¼æ¬ã½ããã¦ã§ã¢ãæ¹å¤ãããã®ãå«ãï¼ä»¥ä¸åãï¼ã使ç¨ã»è¤è£½ã»æ¹
|
---|
12 | * å¤ã»åé
|
---|
13 | å¸ï¼ä»¥ä¸ï¼å©ç¨ã¨å¼ã¶ï¼ãããã¨ãç¡åã§è¨±è«¾ããï¼
|
---|
14 | * (1) æ¬ã½ããã¦ã§ã¢ãã½ã¼ã¹ã³ã¼ãã®å½¢ã§å©ç¨ããå ´åã«ã¯ï¼ä¸è¨ã®èä½
|
---|
15 | * 権表示ï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨ã®ç¡ä¿è¨¼è¦å®ãï¼ãã®ã¾ã¾ã®å½¢ã§ã½ã¼
|
---|
16 | * ã¹ã³ã¼ãä¸ã«å«ã¾ãã¦ãããã¨ï¼
|
---|
17 | * (2) æ¬ã½ããã¦ã§ã¢ãï¼ã©ã¤ãã©ãªå½¢å¼ãªã©ï¼ä»ã®ã½ããã¦ã§ã¢éçºã«ä½¿
|
---|
18 | * ç¨ã§ããå½¢ã§åé
|
---|
19 | å¸ããå ´åã«ã¯ï¼åé
|
---|
20 | å¸ã«ä¼´ãããã¥ã¡ã³ãï¼å©ç¨
|
---|
21 | * è
|
---|
22 | ããã¥ã¢ã«ãªã©ï¼ã«ï¼ä¸è¨ã®è使¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨
|
---|
23 | * ã®ç¡ä¿è¨¼è¦å®ãæ²è¼ãããã¨ï¼
|
---|
24 | * (3) æ¬ã½ããã¦ã§ã¢ãï¼æ©å¨ã«çµã¿è¾¼ããªã©ï¼ä»ã®ã½ããã¦ã§ã¢éçºã«ä½¿
|
---|
25 | * ç¨ã§ããªãå½¢ã§åé
|
---|
26 | å¸ããå ´åã«ã¯ï¼æ¬¡ã®ããããã®æ¡ä»¶ãæºããã
|
---|
27 | * ã¨ï¼
|
---|
28 | * (a) åé
|
---|
29 | å¸ã«ä¼´ãããã¥ã¡ã³ãï¼å©ç¨è
|
---|
30 | ããã¥ã¢ã«ãªã©ï¼ã«ï¼ä¸è¨ã®è
|
---|
31 | * 使¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨ã®ç¡ä¿è¨¼è¦å®ãæ²è¼ãããã¨ï¼
|
---|
32 | * (b) åé
|
---|
33 | å¸ã®å½¢æ
|
---|
34 | ãï¼å¥ã«å®ããæ¹æ³ã«ãã£ã¦ï¼TOPPERSããã¸ã§ã¯ãã«
|
---|
35 | * å ±åãããã¨ï¼
|
---|
36 | * (4) æ¬ã½ããã¦ã§ã¢ã®å©ç¨ã«ããç´æ¥çã¾ãã¯éæ¥çã«çãããããªãæ
|
---|
37 | * 害ãããï¼ä¸è¨è使¨©è
|
---|
38 | ããã³TOPPERSããã¸ã§ã¯ããå
|
---|
39 | 責ãããã¨ï¼
|
---|
40 | * ã¾ãï¼æ¬ã½ããã¦ã§ã¢ã®ã¦ã¼ã¶ã¾ãã¯ã¨ã³ãã¦ã¼ã¶ããã®ãããªãç
|
---|
41 | * ç±ã«åºã¥ãè«æ±ãããï¼ä¸è¨è使¨©è
|
---|
42 | ããã³TOPPERSããã¸ã§ã¯ãã
|
---|
43 | * å
|
---|
44 | 責ãããã¨ï¼
|
---|
45 | *
|
---|
46 | * æ¬ã½ããã¦ã§ã¢ã¯ï¼ç¡ä¿è¨¼ã§æä¾ããã¦ãããã®ã§ããï¼ä¸è¨è使¨©è
|
---|
47 | ã
|
---|
48 | * ãã³TOPPERSããã¸ã§ã¯ãã¯ï¼æ¬ã½ããã¦ã§ã¢ã«é¢ãã¦ï¼ç¹å®ã®ä½¿ç¨ç®ç
|
---|
49 | * ã«å¯¾ããé©åæ§ãå«ãã¦ï¼ãããªãä¿è¨¼ãè¡ããªãï¼ã¾ãï¼æ¬ã½ããã¦ã§
|
---|
50 | * ã¢ã®å©ç¨ã«ããç´æ¥çã¾ãã¯éæ¥çã«çãããããªãæå®³ã«é¢ãã¦ãï¼ã
|
---|
51 | * ã®è²¬ä»»ãè² ããªãï¼
|
---|
52 | *
|
---|
53 | * @(#) $Id: target_serial.c 2708 2015-11-22 10:35:09Z ertl-honda $
|
---|
54 | */
|
---|
55 |
|
---|
56 | /*
|
---|
57 | * ã·ãªã¢ã«I/Oããã¤ã¹ï¼SIOï¼ãã©ã¤ãï¼SAMD51ç¨ï¼
|
---|
58 | */
|
---|
59 | #include <kernel.h>
|
---|
60 | #include <t_syslog.h>
|
---|
61 | //#undef assert
|
---|
62 | //#include "samd55.h"
|
---|
63 | #include "target_serial.h"
|
---|
64 | //#include "hri_l11.h"
|
---|
65 | //#include "peripheral_clk_config.h"
|
---|
66 | //#include "hal_gpio.h"
|
---|
67 |
|
---|
68 | /*
|
---|
69 | * ã·ãªã¢ã«I/Oãã¼ãåæåãããã¯ã®å®ç¾©
|
---|
70 | */
|
---|
71 | typedef struct sio_port_initialization_block
|
---|
72 | {
|
---|
73 | // Sercom* p_sercom; /* 使ç¨ããSERCOMã¸ã®ãã¤ã³ã¿ */
|
---|
74 | uint32_t bps; /* ãã¼ã¬ã¼ã */
|
---|
75 | }
|
---|
76 | SIOPINIB;
|
---|
77 |
|
---|
78 | /*
|
---|
79 | * ã·ãªã¢ã«I/Oãã¼ã管çãããã¯ã®å®ç¾©
|
---|
80 | */
|
---|
81 | struct sio_port_control_block
|
---|
82 | {
|
---|
83 | const SIOPINIB* p_siopinib; /* åæåããã㯠*/
|
---|
84 | intptr_t exinf; /* æ¡å¼µæ
|
---|
85 | å ± */
|
---|
86 | bool_t openflag; /* ãªã¼ãã³æ¸ã¿ãã©ã° */
|
---|
87 | bool_t devinitd; /* ããã¤ã¹åæåæ¸ã¿ãã©ã° */
|
---|
88 | bool_t sendflag; /* éä¿¡å²è¾¼ã¿ã¤ãã¼ãã«ãã©ã° */
|
---|
89 | bool_t getready; /* æåãåä¿¡ããç¶æ
|
---|
90 | */
|
---|
91 | bool_t putready; /* æåãéä¿¡ã§ããç¶æ
|
---|
92 | */
|
---|
93 | };
|
---|
94 |
|
---|
95 | /*
|
---|
96 | * ã·ãªã¢ã«I/Oãã¼ãåæåãããã¯
|
---|
97 | */
|
---|
98 | const SIOPINIB siopinib_table[TNUM_SIOP] = {
|
---|
99 | // {SERCOM2, 115200}
|
---|
100 | {115200}
|
---|
101 | };
|
---|
102 |
|
---|
103 | /*
|
---|
104 | * ã·ãªã¢ã«I/Oãã¼ã管çãããã¯ã®ã¨ãªã¢
|
---|
105 | */
|
---|
106 | SIOPCB siopcb_table[TNUM_SIOP];
|
---|
107 |
|
---|
108 | /*
|
---|
109 | * ã·ãªã¢ã«I/Oãã¼ãIDãã管çãããã¯ãåãåºãããã®ãã¯ã
|
---|
110 | */
|
---|
111 | #define INDEX_SIOP(siopid) ((uint_t)((siopid) - 1))
|
---|
112 | #define get_siopcb(siopid) (&(siopcb_table[INDEX_SIOP(siopid)]))
|
---|
113 |
|
---|
114 |
|
---|
115 | /* SERCOM2 USART baud value for 115200 Hz baud rate */
|
---|
116 | #define SERCOM2_USART_INT_BAUD_VALUE (64328U)
|
---|
117 |
|
---|
118 | static void
|
---|
119 | sercom_uart_devinit(SIOPCB *p_siopcb)
|
---|
120 | {
|
---|
121 | /* ToDo */
|
---|
122 |
|
---|
123 | /*
|
---|
124 | * Configures USART Clock Mode
|
---|
125 | * Configures TXPO and RXPO
|
---|
126 | * Configures Data Order
|
---|
127 | * Configures Standby Mode
|
---|
128 | * Configures Sampling rate
|
---|
129 | * Configures IBON
|
---|
130 | */
|
---|
131 | SERCOM2_REGS->USART_INT.SERCOM_CTRLA = SERCOM_USART_INT_CTRLA_MODE_USART_INT_CLK | SERCOM_USART_INT_CTRLA_RXPO(0x1) | SERCOM_USART_INT_CTRLA_TXPO(0x2) | SERCOM_USART_INT_CTRLA_DORD_Msk | SERCOM_USART_INT_CTRLA_IBON_Msk | SERCOM_USART_INT_CTRLA_FORM(0x0) | SERCOM_USART_INT_CTRLA_SAMPR(0) ;
|
---|
132 |
|
---|
133 | /* Configure Baud Rate */
|
---|
134 | SERCOM2_REGS->USART_INT.SERCOM_BAUD = SERCOM_USART_INT_BAUD_BAUD(SERCOM2_USART_INT_BAUD_VALUE);
|
---|
135 |
|
---|
136 | /*
|
---|
137 | * Configures RXEN
|
---|
138 | * Configures TXEN
|
---|
139 | * Configures CHSIZE
|
---|
140 | * Configures Parity
|
---|
141 | * Configures Stop bits
|
---|
142 | */
|
---|
143 | SERCOM2_REGS->USART_INT.SERCOM_CTRLB = SERCOM_USART_INT_CTRLB_CHSIZE_8_BIT | SERCOM_USART_INT_CTRLB_SBMODE_1_BIT | SERCOM_USART_INT_CTRLB_RXEN_Msk | SERCOM_USART_INT_CTRLB_TXEN_Msk;
|
---|
144 |
|
---|
145 | /* Wait for sync */
|
---|
146 | while(SERCOM2_REGS->USART_INT.SERCOM_SYNCBUSY);
|
---|
147 |
|
---|
148 | /* Enable the UART after the configurations */
|
---|
149 | SERCOM2_REGS->USART_INT.SERCOM_CTRLA |= SERCOM_USART_INT_CTRLA_ENABLE_Msk;
|
---|
150 |
|
---|
151 | /* Wait for sync */
|
---|
152 | while(SERCOM2_REGS->USART_INT.SERCOM_SYNCBUSY);
|
---|
153 |
|
---|
154 | /* Enable error interrupt */
|
---|
155 | SERCOM2_REGS->USART_INT.SERCOM_INTENSET = SERCOM_USART_INT_INTENSET_ERROR_Msk;
|
---|
156 |
|
---|
157 |
|
---|
158 | /* Enable Receive Complete interrupt */
|
---|
159 | SERCOM2_REGS->USART_INT.SERCOM_INTENSET = SERCOM_USART_INT_INTENSET_RXC_Msk;
|
---|
160 | }
|
---|
161 |
|
---|
162 | /*
|
---|
163 | * ã«ã¼ãã«èµ·åæã®ãã°åºåç¨ã®åæå
|
---|
164 | */
|
---|
165 | void
|
---|
166 | sercom_init_uart(uint32_t siopid)
|
---|
167 | {
|
---|
168 | SIOPCB *p_siopcb;
|
---|
169 |
|
---|
170 | p_siopcb = get_siopcb(siopid);
|
---|
171 | p_siopcb->p_siopinib = &siopinib_table[INDEX_SIOP(siopid)];
|
---|
172 | sercom_uart_devinit(p_siopcb);
|
---|
173 | }
|
---|
174 |
|
---|
175 | /*
|
---|
176 | * UARTããã®ãã¼ãªã³ã°åºå
|
---|
177 | */
|
---|
178 | void
|
---|
179 | sercom_putc(uint32_t siopid, char c)
|
---|
180 | {
|
---|
181 | while(!(SERCOM2_REGS->USART_INT.SERCOM_INTFLAG & SERCOM_USART_INT_INTFLAG_DRE_Msk));
|
---|
182 | SERCOM2_REGS->USART_INT.SERCOM_DATA = c;
|
---|
183 | }
|
---|
184 |
|
---|
185 |
|
---|
186 | /*
|
---|
187 | * æåãåä¿¡ããã?
|
---|
188 | */
|
---|
189 | Inline bool_t
|
---|
190 | uart_getready(SIOPCB *p_siopcb)
|
---|
191 | {
|
---|
192 | return(SERCOM2_REGS->USART_INT.SERCOM_INTFLAG & SERCOM_USART_INT_INTENSET_RXC_Msk);
|
---|
193 | }
|
---|
194 |
|
---|
195 | /*
|
---|
196 | * æåãéä¿¡ã§ããã?
|
---|
197 | */
|
---|
198 | Inline bool_t
|
---|
199 | uart_putready(SIOPCB *p_siopcb)
|
---|
200 | {
|
---|
201 | return(SERCOM2_REGS->USART_INT.SERCOM_INTFLAG & SERCOM_USART_INT_INTFLAG_DRE_Msk);
|
---|
202 | }
|
---|
203 |
|
---|
204 | /*
|
---|
205 | * åä¿¡ããæåã®åãåºã
|
---|
206 | */
|
---|
207 | Inline uint8_t
|
---|
208 | uart_getchar(SIOPCB *p_siopcb)
|
---|
209 | {
|
---|
210 | return SERCOM2_REGS->USART_INT.SERCOM_DATA;
|
---|
211 | }
|
---|
212 |
|
---|
213 | /*
|
---|
214 | * éä¿¡ããæåã®æ¸ãè¾¼ã¿
|
---|
215 | */
|
---|
216 | Inline void
|
---|
217 | uart_putchar(SIOPCB *p_siopcb, uint8_t c)
|
---|
218 | {
|
---|
219 | SERCOM2_REGS->USART_INT.SERCOM_DATA = c;
|
---|
220 | }
|
---|
221 |
|
---|
222 | /*
|
---|
223 | * éä¿¡å²è¾¼ã¿è¨±å¯
|
---|
224 | */
|
---|
225 | Inline void
|
---|
226 | uart_enable_send(SIOPCB *p_siopcb)
|
---|
227 | {
|
---|
228 | SERCOM2_REGS->USART_INT.SERCOM_INTENSET = SERCOM_USART_INT_INTENSET_TXC_Msk;
|
---|
229 | }
|
---|
230 |
|
---|
231 | /*
|
---|
232 | * éä¿¡å²è¾¼ã¿ç¦æ¢
|
---|
233 | */
|
---|
234 | Inline void
|
---|
235 | uart_disable_send(SIOPCB *p_siopcb)
|
---|
236 | {
|
---|
237 | SERCOM2_REGS->USART_INT.SERCOM_INTENCLR = SERCOM_USART_INT_INTENCLR_TXC_Msk;
|
---|
238 | }
|
---|
239 |
|
---|
240 |
|
---|
241 | /*
|
---|
242 | * åä¿¡å²è¾¼ã¿è¨±å¯
|
---|
243 | */
|
---|
244 | Inline void
|
---|
245 | uart_enable_rcv(SIOPCB *p_siopcb)
|
---|
246 | {
|
---|
247 | SERCOM2_REGS->USART_INT.SERCOM_INTENSET = SERCOM_USART_INT_INTENSET_RXC_Msk;
|
---|
248 | }
|
---|
249 |
|
---|
250 | /*
|
---|
251 | * åä¿¡å²è¾¼ã¿ç¦æ¢
|
---|
252 | */
|
---|
253 | Inline void
|
---|
254 | uart_disable_rcv(SIOPCB *p_siopcb)
|
---|
255 | {
|
---|
256 | SERCOM2_REGS->USART_INT.SERCOM_INTENCLR = SERCOM_USART_INT_INTENCLR_RXC_Msk;
|
---|
257 | }
|
---|
258 |
|
---|
259 |
|
---|
260 | /*
|
---|
261 | * SIOãã©ã¤ãã®åæå
|
---|
262 | */
|
---|
263 | void
|
---|
264 | sio_initialize(intptr_t exinf)
|
---|
265 | {
|
---|
266 | SIOPCB *p_siopcb;
|
---|
267 | uint_t i;
|
---|
268 | ER ercd;
|
---|
269 |
|
---|
270 | /*
|
---|
271 | * ã·ãªã¢ã«I/Oãã¼ã管çãããã¯ã®åæå
|
---|
272 | */
|
---|
273 | for (p_siopcb = siopcb_table, i = 0; i < TNUM_SIOP; p_siopcb++, i++) {
|
---|
274 | p_siopcb->p_siopinib = &(siopinib_table[i]);
|
---|
275 | p_siopcb->openflag = false;
|
---|
276 | p_siopcb->sendflag = false;
|
---|
277 | }
|
---|
278 | }
|
---|
279 |
|
---|
280 | /*
|
---|
281 | * SIOãã©ã¤ãã®çµäºå¦ç
|
---|
282 | */
|
---|
283 | void
|
---|
284 | sio_terminate(intptr_t exinf)
|
---|
285 | {
|
---|
286 | SIOPCB *p_siopcb;
|
---|
287 | uint_t i;
|
---|
288 |
|
---|
289 | /*
|
---|
290 | * ãªã¼ãã³ããã¦ããã·ãªã¢ã«I/Oãã¼ãã®ã¯ãã¼ãº
|
---|
291 | */
|
---|
292 | for (i = 0; i < TNUM_SIOP; i++) {
|
---|
293 | p_siopcb = &(siopcb_table[i]);
|
---|
294 | if (p_siopcb->openflag) {
|
---|
295 | sio_cls_por(p_siopcb);
|
---|
296 | }
|
---|
297 | }
|
---|
298 | }
|
---|
299 |
|
---|
300 | /*
|
---|
301 | * ã·ãªã¢ã«I/Oãã¼ãã®ãªã¼ãã³
|
---|
302 | */
|
---|
303 | SIOPCB *
|
---|
304 | sercom_uart_opn_por(SIOPCB *p_siopcb, intptr_t exinf)
|
---|
305 | {
|
---|
306 | p_siopcb->exinf = exinf;
|
---|
307 | p_siopcb->getready = p_siopcb->putready = false;
|
---|
308 | p_siopcb->openflag = true;
|
---|
309 |
|
---|
310 | sercom_uart_devinit(p_siopcb);
|
---|
311 |
|
---|
312 | return(p_siopcb);
|
---|
313 | }
|
---|
314 |
|
---|
315 |
|
---|
316 | /*
|
---|
317 | * ã·ãªã¢ã«I/Oãã¼ãã®ãªã¼ãã³
|
---|
318 | */
|
---|
319 | SIOPCB *
|
---|
320 | sio_opn_por(ID siopid, intptr_t exinf)
|
---|
321 | {
|
---|
322 | SIOPCB *p_siopcb = get_siopcb(siopid);
|
---|
323 | bool_t opnflg;
|
---|
324 |
|
---|
325 | /*
|
---|
326 | * ãªã¼ãã³ãããã¼ããããããopnflgã«èªãã§ããï¼
|
---|
327 | */
|
---|
328 | opnflg = p_siopcb->openflag;
|
---|
329 |
|
---|
330 | /*
|
---|
331 | * ããã¤ã¹ä¾åã®ãªã¼ãã³å¦çï¼
|
---|
332 | */
|
---|
333 | sercom_uart_opn_por(p_siopcb, exinf);
|
---|
334 |
|
---|
335 | /*
|
---|
336 | * ã·ãªã¢ã«I/Oå²è¾¼ã¿ã®ãã¹ã¯ãè§£é¤ããï¼
|
---|
337 | */
|
---|
338 | if (!opnflg) {
|
---|
339 | (void)ena_int(INTNO_SIO_RX);
|
---|
340 | (void)ena_int(INTNO_SIO_TX);
|
---|
341 | }
|
---|
342 | return(p_siopcb);
|
---|
343 | }
|
---|
344 |
|
---|
345 | /*
|
---|
346 | * ã·ãªã¢ã«I/Oãã¼ãã®ã¯ãã¼ãº
|
---|
347 | */
|
---|
348 | void
|
---|
349 | sio_cls_por(SIOPCB *p_siopcb)
|
---|
350 | {
|
---|
351 | /*
|
---|
352 | * ããã¤ã¹ä¾åã®ã¯ãã¼ãºå¦çï¼
|
---|
353 | */
|
---|
354 | p_siopcb->openflag = false;
|
---|
355 |
|
---|
356 | /*
|
---|
357 | * ã·ãªã¢ã«I/Oå²è¾¼ã¿ããã¹ã¯ããï¼
|
---|
358 | */
|
---|
359 | dis_int(INTNO_SIO_RX);
|
---|
360 | dis_int(INTNO_SIO_TX);
|
---|
361 | }
|
---|
362 |
|
---|
363 | /*
|
---|
364 | * SIOã®å²è¾¼ã¿ãã³ãã©
|
---|
365 | */
|
---|
366 | void
|
---|
367 | sio_isr(intptr_t exinf)
|
---|
368 | {
|
---|
369 | SIOPCB *p_siopcb = get_siopcb(exinf);
|
---|
370 |
|
---|
371 | if (uart_getready(p_siopcb)) {
|
---|
372 | /*
|
---|
373 | * åä¿¡éç¥ã³ã¼ã«ããã¯ã«ã¼ãã³ãå¼ã³åºãï¼
|
---|
374 | */
|
---|
375 | sio_irdy_rcv(p_siopcb->exinf);
|
---|
376 | }
|
---|
377 | if (uart_putready(p_siopcb)) {
|
---|
378 | /*
|
---|
379 | * éä¿¡å¯è½ã³ã¼ã«ããã¯ã«ã¼ãã³ãå¼ã³åºãï¼
|
---|
380 | */
|
---|
381 | sio_irdy_snd(p_siopcb->exinf);
|
---|
382 | }
|
---|
383 | }
|
---|
384 |
|
---|
385 |
|
---|
386 | /*
|
---|
387 | * ã·ãªã¢ã«I/Oãã¼ãã¸ã®æåéä¿¡
|
---|
388 | */
|
---|
389 | bool_t
|
---|
390 | sio_snd_chr(SIOPCB *siopcb, char c)
|
---|
391 | {
|
---|
392 | if (uart_putready(siopcb)){
|
---|
393 | uart_putchar(siopcb, c);
|
---|
394 | return(true);
|
---|
395 | }
|
---|
396 | return(false);
|
---|
397 | }
|
---|
398 |
|
---|
399 | /*
|
---|
400 | * ã·ãªã¢ã«I/Oãã¼ãããã®æååä¿¡
|
---|
401 | */
|
---|
402 | int_t
|
---|
403 | sio_rcv_chr(SIOPCB *siopcb)
|
---|
404 | {
|
---|
405 | if (uart_getready(siopcb)) {
|
---|
406 | return((int_t)(uint8_t) uart_getchar(siopcb));
|
---|
407 | }
|
---|
408 | return(-1);
|
---|
409 | }
|
---|
410 |
|
---|
411 | /*
|
---|
412 | * ã·ãªã¢ã«I/Oãã¼ãããã®ã³ã¼ã«ããã¯ã®è¨±å¯
|
---|
413 | */
|
---|
414 | void
|
---|
415 | sio_ena_cbr(SIOPCB *siopcb, uint_t cbrtn)
|
---|
416 | {
|
---|
417 | switch (cbrtn) {
|
---|
418 | case SIO_RDY_SND:
|
---|
419 | uart_enable_send(siopcb);
|
---|
420 | break;
|
---|
421 | case SIO_RDY_RCV:
|
---|
422 | uart_enable_rcv(siopcb);
|
---|
423 | break;
|
---|
424 | }
|
---|
425 | }
|
---|
426 |
|
---|
427 | /*
|
---|
428 | * ã·ãªã¢ã«I/Oãã¼ãããã®ã³ã¼ã«ããã¯ã®ç¦æ¢
|
---|
429 | */
|
---|
430 | void
|
---|
431 | sio_dis_cbr(SIOPCB *siopcb, uint_t cbrtn)
|
---|
432 | {
|
---|
433 | switch (cbrtn) {
|
---|
434 | case SIO_RDY_SND:
|
---|
435 | uart_disable_send(siopcb);
|
---|
436 | break;
|
---|
437 | case SIO_RDY_RCV:
|
---|
438 | uart_disable_rcv(siopcb);
|
---|
439 | break;
|
---|
440 | }
|
---|
441 | }
|
---|