[101] | 1 | /*
|
---|
| 2 | * TOPPERS/SSP Kernel
|
---|
| 3 | * Smallest Set Profile Kernel
|
---|
| 4 | *
|
---|
| 5 | * Copyright (C) 2000-2003 by Embedded and Real-Time Systems Laboratory
|
---|
| 6 | * Toyohashi Univ. of Technology, JAPAN
|
---|
| 7 | * Copyright (C) 2003-2004 by Naoki Saito
|
---|
| 8 | * Nagoya Municipal Industrial Research Institute, JAPAN
|
---|
| 9 | * Copyright (C) 2003-2004 by Platform Development Center
|
---|
| 10 | * RICOH COMPANY,LTD. JAPAN
|
---|
| 11 | * Copyright (C) 2008-2010 by Witz Corporation, JAPAN
|
---|
| 12 | * Copyright (C) 2013 by Mitsuhiro Matsuura
|
---|
| 13 | *
|
---|
| 14 | * ãLì ÒÍCȺÌ(1)`(4)Ìðð½·êÉÀèC{\tgEF
|
---|
| 15 | * Ai{\tgEFAðüϵ½àÌðÜÞDȺ¯¶jðgpE¡»Eü
|
---|
| 16 | * ÏEÄzziȺCpÆÄÔj·é±Æð³Åø·éD
|
---|
| 17 | * (1) {\tgEFAð\[XR[hÌ`Åp·éêÉÍCãLÌì
|
---|
| 18 | * \¦C±Ìpð¨æѺL̳ÛØKèªC»ÌÜÜÌ`Å\[
|
---|
| 19 | * XR[hÉÜÜêÄ¢é±ÆD
|
---|
| 20 | * (2) {\tgEFAðCCu`®ÈÇC¼Ì\tgEFAJÉg
|
---|
| 21 | * pÅ«é`ÅÄzz·éêÉÍCÄzzɺ¤hL
|
---|
| 22 | gip
|
---|
| 23 | * Ò}j
|
---|
| 24 | AÈÇjÉCãLÌì \¦C±Ìpð¨æѺL
|
---|
| 25 | * ̳ÛØKèðfÚ·é±ÆD
|
---|
| 26 | * (3) {\tgEFAðC@íÉgÝÞÈÇC¼Ì\tgEFAJÉg
|
---|
| 27 | * pÅ«È¢`ÅÄzz·éêÉÍCÌ¢¸ê©Ìðð½·±
|
---|
| 28 | * ÆD
|
---|
| 29 | * (a) Äzzɺ¤hL
|
---|
| 30 | gipÒ}j
|
---|
| 31 | AÈÇjÉCãLÌ
|
---|
| 32 | * ì \¦C±Ìpð¨æѺL̳ÛØKèðfÚ·é±ÆD
|
---|
| 33 | * (b) ÄzzÌ`ÔðCÊÉèßéû@ÉæÁÄCTOPPERSvWFNgÉ
|
---|
| 34 | * ñ·é±ÆD
|
---|
| 35 | * (4) {\tgEFAÌpÉæè¼ÚIܽÍÔÚIɶ¶é¢©Èé¹
|
---|
| 36 | * Q©çàCãLì Ò¨æÑTOPPERSvWFNgðÆÓ·é±ÆD
|
---|
| 37 | * ܽC{\tgEFAÌ[UܽÍGh[U©çÌ¢©Èé
|
---|
| 38 | * RÉîÿ©çàCãLì Ò¨æÑTOPPERSvWFNgð
|
---|
| 39 | * ÆÓ·é±ÆD
|
---|
| 40 | *
|
---|
| 41 | * {\tgEFAÍC³ÛØÅñ³êÄ¢éàÌÅ éDãLì Ò¨
|
---|
| 42 | * æÑTOPPERSvWFNgÍC{\tgEFAÉÖµÄCÁèÌgpÚI
|
---|
| 43 | * ÉηéK«àÜßÄC¢©ÈéÛØàsíÈ¢DܽC{\tgEF
|
---|
| 44 | * AÌpÉæè¼ÚIܽÍÔÚIɶ¶½¢©Èé¹QÉÖµÄàC»
|
---|
| 45 | * ÌÓCðíÈ¢D
|
---|
| 46 | *
|
---|
| 47 | */
|
---|
| 48 |
|
---|
| 49 | /*
|
---|
| 50 | * RX630 UARTpVAI/OW
|
---|
| 51 | [
|
---|
| 52 | */
|
---|
| 53 | #include "kernel_impl.h"
|
---|
| 54 | #include <sil.h>
|
---|
| 55 | #include "target_serial.h"
|
---|
| 56 |
|
---|
| 57 | /*
|
---|
| 58 | * SIOhCoÌú»
|
---|
| 59 | */
|
---|
| 60 | void
|
---|
| 61 | sio_initialize(intptr_t exinf)
|
---|
| 62 | {
|
---|
| 63 | rx630_uart_initialize();
|
---|
| 64 | }
|
---|
| 65 |
|
---|
| 66 | /*
|
---|
| 67 | * VAI/O|[gÌI[v
|
---|
| 68 | */
|
---|
| 69 | SIOPCB *
|
---|
| 70 | sio_opn_por(ID siopid, intptr_t exinf)
|
---|
| 71 | {
|
---|
| 72 | SIOPCB *p_siopcb = NULL;
|
---|
| 73 | ER ercd;
|
---|
| 74 | INTNO intno_sio_tx, intno_sio_rx;
|
---|
| 75 |
|
---|
| 76 | /*
|
---|
| 77 | * VAI/OÝð}XN·éD
|
---|
| 78 | * (dis_intÖÍA"\kernel\interrupt.c"ÉLq)
|
---|
| 79 | */
|
---|
| 80 | p_siopcb = rx630_uart_get_siopcb(siopid);
|
---|
| 81 | intno_sio_tx = rx630_uart_intno_tx(p_siopcb);
|
---|
| 82 | intno_sio_rx = rx630_uart_intno_rx(p_siopcb);
|
---|
| 83 | ercd = dis_int(intno_sio_tx);
|
---|
| 84 | assert(ercd == E_OK);
|
---|
| 85 | ercd = dis_int(intno_sio_rx);
|
---|
| 86 | assert(ercd == E_OK);
|
---|
| 87 |
|
---|
| 88 | p_siopcb =
|
---|
| 89 | rx630_uart_opn_por(siopid , exinf , UART_BAUDRATE , UART_CLKSRC);
|
---|
| 90 |
|
---|
| 91 | /*
|
---|
| 92 | * VAI/OÝð}XNð·éD
|
---|
| 93 | * (ena_intÖÍA"\kernel\interrupt.c"ÉLq)
|
---|
| 94 | */
|
---|
| 95 | ercd = ena_int(intno_sio_tx);
|
---|
| 96 | assert(ercd == E_OK);
|
---|
| 97 | ercd = ena_int(intno_sio_rx);
|
---|
| 98 | assert(ercd == E_OK);
|
---|
| 99 |
|
---|
| 100 | return(p_siopcb);
|
---|
| 101 | }
|
---|
| 102 |
|
---|
| 103 | /*
|
---|
| 104 | * VAI/O|[gÌN[Y
|
---|
| 105 | */
|
---|
| 106 | void
|
---|
| 107 | sio_cls_por(SIOPCB *p_siopcb)
|
---|
| 108 | {
|
---|
| 109 | ER ercd;
|
---|
| 110 | INTNO intno_sio_tx, intno_sio_rx;
|
---|
| 111 |
|
---|
| 112 | /*
|
---|
| 113 | * foCX˶ÌN[YD
|
---|
| 114 | */
|
---|
| 115 | rx630_uart_cls_por(p_siopcb);
|
---|
| 116 |
|
---|
| 117 | /*
|
---|
| 118 | * VAI/OÝð}XN·éD
|
---|
| 119 | */
|
---|
| 120 | intno_sio_tx = rx630_uart_intno_tx(p_siopcb);
|
---|
| 121 | intno_sio_rx = rx630_uart_intno_rx(p_siopcb);
|
---|
| 122 | ercd = dis_int(intno_sio_tx);
|
---|
| 123 | assert(ercd == E_OK);
|
---|
| 124 | ercd = dis_int(intno_sio_rx);
|
---|
| 125 | assert(ercd == E_OK);
|
---|
| 126 | }
|
---|
| 127 |
|
---|
| 128 | /*
|
---|
| 129 | * SIOÌÝnh
|
---|
| 130 | */
|
---|
| 131 | void sio_tx_isr(intptr_t exinf)
|
---|
| 132 | {
|
---|
| 133 | rx630_uart_tx_isr(exinf);
|
---|
| 134 | }
|
---|
| 135 |
|
---|
| 136 | /*
|
---|
| 137 | * SIOÌÝnh
|
---|
| 138 | */
|
---|
| 139 | void sio_rx_isr(intptr_t exinf)
|
---|
| 140 | {
|
---|
| 141 | rx630_uart_rx_isr(exinf);
|
---|
| 142 | }
|
---|
| 143 |
|
---|
| 144 | /*
|
---|
| 145 | * VAI/O|[gÖ̶M
|
---|
| 146 | */
|
---|
| 147 | bool_t
|
---|
| 148 | sio_snd_chr(SIOPCB *siopcb, char c)
|
---|
| 149 | {
|
---|
| 150 | return(rx630_uart_snd_chr(siopcb, c));
|
---|
| 151 | }
|
---|
| 152 |
|
---|
| 153 | /*
|
---|
| 154 | * VAI/O|[g©ç̶óM
|
---|
| 155 | */
|
---|
| 156 | int_t
|
---|
| 157 | sio_rcv_chr(SIOPCB *siopcb)
|
---|
| 158 | {
|
---|
| 159 | return(rx630_uart_rcv_chr(siopcb));
|
---|
| 160 | }
|
---|
| 161 |
|
---|
| 162 | /*
|
---|
| 163 | * VAI/O|[g©çÌR[obNÌÂ
|
---|
| 164 | */
|
---|
| 165 | void
|
---|
| 166 | sio_ena_cbr(SIOPCB *siopcb, uint_t cbrtn)
|
---|
| 167 | {
|
---|
| 168 | rx630_uart_ena_cbr(siopcb, cbrtn);
|
---|
| 169 | }
|
---|
| 170 |
|
---|
| 171 | /*
|
---|
| 172 | * VAI/O|[g©çÌR[obNÌÖ~
|
---|
| 173 | */
|
---|
| 174 | void
|
---|
| 175 | sio_dis_cbr(SIOPCB *siopcb, uint_t cbrtn)
|
---|
| 176 | {
|
---|
| 177 | rx630_uart_dis_cbr(siopcb, cbrtn);
|
---|
| 178 | }
|
---|
| 179 |
|
---|
| 180 | /*
|
---|
| 181 | * VAI/O|[g©çÌMÂ\R[obN
|
---|
| 182 | */
|
---|
| 183 | void
|
---|
| 184 | rx630_uart_irdy_snd(intptr_t exinf)
|
---|
| 185 | {
|
---|
| 186 | /* ¤Êisyssvc\serial.cjÉ ésio_irdy_sndÖðÄÑoµ*/
|
---|
| 187 | sio_irdy_snd(exinf);
|
---|
| 188 | }
|
---|
| 189 |
|
---|
| 190 | /*
|
---|
| 191 | * VAI/O|[g©çÌóMÊmR[obN
|
---|
| 192 | */
|
---|
| 193 | void
|
---|
| 194 | rx630_uart_irdy_rcv(intptr_t exinf)
|
---|
| 195 | {
|
---|
| 196 | /* ¤Êisyssvc\serial.cjÉ ésio_irdy_rcvÖðÄÑoµ*/
|
---|
| 197 | sio_irdy_rcv(exinf);
|
---|
| 198 | }
|
---|
| 199 |
|
---|