Changeset 374 for asp3_tinet_ecnl_rx/trunk/asp3_dcre/target
- Timestamp:
- Apr 5, 2019, 9:26:53 PM (5 years ago)
- Location:
- asp3_tinet_ecnl_rx/trunk/asp3_dcre/target
- Files:
-
- 2 added
- 18 edited
Legend:
- Unmodified
- Added
- Removed
-
asp3_tinet_ecnl_rx/trunk/asp3_dcre/target/gr_citrus_gcc/Makefile.target
r337 r374 13 13 # コンパイルオプション 14 14 # 15 INCLUDES := $(INCLUDES) -I$(TARGETDIR) -I$(SRCDIR)/ pdic15 INCLUDES := $(INCLUDES) -I$(TARGETDIR) -I$(SRCDIR)/mbed 16 16 17 17 # … … 25 25 # システムサービスに関する定義 26 26 # 27 SYSSVC_DIRS := $(SYSSVC_DIRS) 27 SYSSVC_DIRS := $(SYSSVC_DIRS) $(SRCDIR)/mbed 28 28 SYSSVC_COBJS := $(SYSSVC_COBJS) 29 29 -
asp3_tinet_ecnl_rx/trunk/asp3_dcre/target/gr_citrus_gcc/gr_citrus.h
r337 r374 71 71 * ボーレート設定 72 72 */ 73 #define BAUD_19200BPS UINT_C( 78 ) 74 #define BAUD_38400BPS UINT_C( 39 ) 75 #define BAUD_57600BPS UINT_C( 25 ) 76 #define BAUD_115200BPS UINT_C( 12 ) 77 78 #define UART_BAUDRATE BAUD_115200BPS 73 #define UART_BAUDRATE 115200 79 74 80 75 /* -
asp3_tinet_ecnl_rx/trunk/asp3_dcre/target/gr_citrus_gcc/tSIOPortGRCitrus.cdl
r337 r374 51 51 */ 52 52 import_C("gr_citrus.h"); 53 import_C(" rx630.h");53 import_C("device.h"); 54 54 55 55 /* 56 56 * FIFO内蔵シリアルコミュニケーションインタフェース用 簡易SIOドライバ 57 57 */ 58 import("t SCIF.cdl");58 import("tMbedSerial.cdl"); 59 59 60 60 /* … … 74 74 call sSIOPort cSIOPort; 75 75 [inline] entry siSIOCBR eiSIOCBR; 76 77 /*78 * 割込み要求ライン操作のための結合79 */80 call sInterruptRequest cRxInterruptRequest;81 call sInterruptRequest cTxInterruptRequest;82 76 }; 83 77 … … 86 80 * ト)のセルタイプ 87 81 */ 88 [active]89 82 composite tSIOPortGRCitrus { 90 83 /* … … 98 91 */ 99 92 attr { 100 uintptr_t baseAddress; /* ベースアドレス */ 101 INTNO rxInterruptNumber; /* 受信割込み番号 */ 102 INTNO txInterruptNumber; /* 送信割込み番号 */ 103 PRI isrPriority = 1; /* ISR優先度 */ 104 PRI interruptPriority = -4; /* 割込み優先度 */ 93 int32_t tx; /* 送信Pin */ 94 int32_t rx; /* 受信Pin */ 105 95 uint32_t baudRate = 115200; /* ボーレートの設定値 */ 106 96 }; … … 109 99 * SIOドライバ 110 100 */ 111 cell tSCIF SCIF { 112 baseAddress = composite.baseAddress; 101 cell tMbedSerial MbedSerial { 102 tx = composite.tx; 103 rx = composite.rx; 113 104 baudRate = composite.baudRate; 114 105 ciSIOCBR = SIOPortMain.eiSIOCBR; … … 120 111 cell tSIOPortGRCitrusMain SIOPortMain { 121 112 ciSIOCBR => composite.ciSIOCBR; 122 cSIOPort = SCIF.eSIOPort; 123 cRxInterruptRequest = RxInterruptRequest.eInterruptRequest; 124 cTxInterruptRequest = TxInterruptRequest.eInterruptRequest; 113 cSIOPort = MbedSerial.eSIOPort; 125 114 }; 126 115 composite.eSIOPort => SIOPortMain.eSIOPort; 127 128 /*129 * SIOの受信割込みサービスルーチンと割込み要求ライン130 */131 cell tISR RxISRInstance {132 interruptNumber = composite.rxInterruptNumber;133 isrPriority = composite.isrPriority;134 ciISRBody = SCIF.eiRxISR;135 };136 cell tInterruptRequest RxInterruptRequest {137 interruptNumber = composite.rxInterruptNumber;138 interruptPriority = composite.interruptPriority;139 };140 141 /*142 * SIOの受信割込みサービスルーチンと割込み要求ライン143 */144 cell tISR TxISRInstance {145 interruptNumber = composite.txInterruptNumber;146 isrPriority = composite.isrPriority;147 ciISRBody = SCIF.eiTxISR;148 };149 cell tInterruptRequest TxInterruptRequest {150 interruptNumber = composite.txInterruptNumber;151 interruptPriority = composite.interruptPriority;152 };153 116 }; 154 117 … … 158 121 * サンプルプログラムが使うポートが,SIOPortTarget1に固定されているた 159 122 * め,ポート1とポート3を入れ換えている.具体的には,SIOPortTarget1は 160 * SCIFのチャネル2(チャネル番号は0から始まるので,ポート3のこと)に,161 * SIOPortTarget3は SCIFのチャネル0につながっている.123 * MbedSerialのチャネル2(チャネル番号は0から始まるので,ポート3のこと)に, 124 * SIOPortTarget3はMbedSerialのチャネル0につながっている. 162 125 */ 163 126 [prototype] 164 127 cell tSIOPortGRCitrus SIOPortTarget1 { 165 128 /* 属性の設定 */ 166 baseAddress = C_EXP("SCI0_BASE"); 167 rxInterruptNumber = C_EXP("INT_SCI0_RXI"); 168 txInterruptNumber = C_EXP("INT_SCI0_TEI"); 129 tx = C_EXP("P20"); /* PIN_IO0 */ 130 rx = C_EXP("P21"); /* PIN_IO1 */ 169 131 }; 170 132 … … 172 134 cell tSIOPortGRCitrus SIOPortTarget2 { 173 135 /* 属性の設定 */ 174 baseAddress = C_EXP("SCI1_BASE"); 175 rxInterruptNumber = C_EXP("INT_SCI1_RXI"); 176 txInterruptNumber = C_EXP("INT_SCI1_TEI"); 136 tx = C_EXP("P50"); /* PIN_IO5 */ 137 rx = C_EXP("P52"); /* PIN_IO6 */ 177 138 }; 178 139 … … 180 141 cell tSIOPortGRCitrus SIOPortTarget3 { 181 142 /* 属性の設定 */ 182 baseAddress = C_EXP("SCI2_BASE"); 183 rxInterruptNumber = C_EXP("INT_SCI2_RXI"); 184 txInterruptNumber = C_EXP("INT_SCI2_TEI"); 143 tx = C_EXP("P32"); /* PIN_IO7 */ 144 rx = C_EXP("P33"); /* PIN_IO8 */ 185 145 }; 186 146 … … 188 148 cell tSIOPortGRCitrus SIOPortTarget4 { 189 149 /* 属性の設定 */ 190 baseAddress = C_EXP("SCI3_BASE"); 191 rxInterruptNumber = C_EXP("INT_SCI3_RXI"); 192 txInterruptNumber = C_EXP("INT_SCI3_TEI"); 150 tx = C_EXP("PC7"); /* PIN_IO12 */ 151 rx = C_EXP("PC6"); /* PIN_IO11 */ 193 152 }; 194 153 … … 196 155 cell tSIOPortGRCitrus SIOPortTarget5 { 197 156 /* 属性の設定 */ 198 baseAddress = C_EXP("SCI4_BASE"); 199 rxInterruptNumber = C_EXP("INT_SCI4_RXI"); 200 txInterruptNumber = C_EXP("INT_SCI4_TEI"); 157 tx = C_EXP("P26"); /* PIN_IO26 */ 158 rx = C_EXP("P30"); /* PIN_IO22 */ 201 159 }; 202 160 … … 204 162 cell tSIOPortGRCitrus SIOPortTarget6 { 205 163 /* 属性の設定 */ 206 baseAddress = C_EXP("SCI5_BASE"); 207 rxInterruptNumber = C_EXP("INT_SCI5_RXI"); 208 txInterruptNumber = C_EXP("INT_SCI5_TEI"); 164 tx = C_EXP("PB5"); /* PIN_IO29 */ 165 rx = C_EXP("P25"); /* PIN_IO23 */ 209 166 }; 210 167 … … 212 169 cell tSIOPortGRCitrus SIOPortTarget7 { 213 170 /* 属性の設定 */ 214 baseAddress = C_EXP("SCI6_BASE"); 215 rxInterruptNumber = C_EXP("INT_SCI6_RXI"); 216 txInterruptNumber = C_EXP("INT_SCI6_TEI"); 171 tx = C_EXP("PA0"); /* PIN_IO33 */ 172 rx = C_EXP("PC2"); /* PIN_IO4 */ 217 173 }; 218 174 … … 220 176 cell tSIOPortGRCitrus SIOPortTarget8 { 221 177 /* 属性の設定 */ 222 baseAddress = NULL; 223 rxInterruptNumber = NULL; 224 txInterruptNumber = NULL; 178 rx = NULL; 179 tx = NULL; 225 180 }; -
asp3_tinet_ecnl_rx/trunk/asp3_dcre/target/gr_citrus_gcc/tSIOPortGRCitrusMain_inline.h
r337 r374 57 57 */ 58 58 cSIOPort_open(); 59 60 /*61 * SIOの割込みマスクを解除する.62 */63 cRxInterruptRequest_enable();64 cTxInterruptRequest_enable();65 59 } 66 60 … … 77 71 */ 78 72 cSIOPort_close(); 79 80 /*81 * SIOの割込みをマスクする.82 */83 cRxInterruptRequest_disable();84 cTxInterruptRequest_disable();85 73 } 86 74 -
asp3_tinet_ecnl_rx/trunk/asp3_dcre/target/gr_citrus_gcc/target_kernel_impl.c
r364 r374 53 53 #include "syssvc/serial.h" 54 54 #ifdef TOPPERS_OMIT_TECS 55 #include "rx630_uart.h" 55 #include "serial_api.h" 56 #endif 57 58 #ifdef TOPPERS_OMIT_TECS 59 serial_t log_serial; 56 60 #endif 57 61 … … 75 79 sil_reb_mem(PORTA_PDR_ADDR) & ~PORT_PDR_B7_BIT); 76 80 81 #ifdef TOPPERS_OMIT_TECS 77 82 /* 78 83 * シリアルポートの設定 79 84 */ 80 81 /* ポートP20をTxD0, ポートP21をRxD0に */ 82 sil_wrb_mem(PORT2_PMR_ADDR, 0x03); 83 84 /* データディレクションレジスタ(PDR)の設定 P21(RxD0)を入力ポートにする */ 85 sil_wrb_mem(PORT2_PDR_ADDR, 86 sil_reb_mem(PORT2_PDR_ADDR) & ~PORT_PDR_B1_BIT); 87 88 /* データディレクションレジスタ(PDR)の設定 P20(TxD0)を出力ポートにする */ 89 sil_wrb_mem(PORT2_PDR_ADDR, 90 sil_reb_mem(PORT2_PDR_ADDR) | PORT_PDR_B0_BIT); 85 serial_init(&log_serial, P20, P21); 86 serial_baud(&log_serial, UART_BAUDRATE); 87 serial_format(&log_serial, 8, ParityNone, 1); 88 #endif 91 89 92 90 /* ポートP40~P47を周辺機器に */ … … 149 147 { 150 148 if (c == '\n') { 151 rx630_uart_pol_putc('\r', TARGET_PUTC_PORTID);149 serial_putc(&log_serial, '\r'); 152 150 } 153 151 154 rx630_uart_pol_putc(c, TARGET_PUTC_PORTID);152 serial_putc(&log_serial, c); 155 153 } 156 154 #endif -
asp3_tinet_ecnl_rx/trunk/asp3_dcre/target/gr_citrus_gcc/target_serial.c
r337 r374 3 3 * Toyohashi Open Platform for Embedded Real-Time Systems/ 4 4 * Advanced Standard Profile Kernel 5 * 5 * 6 6 * Copyright (C) 2000-2003 by Embedded and Real-Time Systems Laboratory 7 7 * Toyohashi Univ. of Technology, JAPAN … … 12 12 * Copyright (C) 2008-2010 by Witz Corporation, JAPAN 13 13 * Copyright (C) 2013 by Mitsuhiro Matsuura 14 * 14 * 15 15 * 上記著作権者は,以下の(1)~(4)の条件を満たす場合に限り,本ソフトウェ 16 16 * ア(本ソフトウェアを改変したものを含む.以下同じ)を使用・複製・改 … … 35 35 * 由に基づく請求からも,上記著作権者およびTOPPERSプロジェクトを 36 36 * 免責すること. 37 * 37 * 38 38 * 本ソフトウェアは,無保証で提供されているものである.上記著作権者お 39 39 * よびTOPPERSプロジェクトは,本ソフトウェアに関して,特定の使用目的 … … 41 41 * アの利用により直接的または間接的に生じたいかなる損害に関しても,そ 42 42 * の責任を負わない. 43 * 43 * 44 44 * @(#) $Id$ 45 45 */ … … 51 51 #include <sil.h> 52 52 #include "target_serial.h" 53 #include "hal/serial_api.h" 54 #include "target_syssvc.h" 55 #include "syssvc/serial.h" 56 57 /* 58 * シリアルI/Oポート初期化ブロックの定義 59 */ 60 typedef struct sio_port_initialization_block { 61 PinName tx; 62 PinName rx; 63 } SIOPINIB; 64 65 /* 66 * シリアルI/Oポート管理ブロックの定義 67 */ 68 struct sio_port_control_block { 69 const SIOPINIB *p_siopinib; 70 intptr_t exinf; 71 bool_t openflag; 72 serial_t serial; 73 }; 74 75 /* 76 * シリアルI/Oポート管理ブロックのエリア 77 */ 78 SIOPCB siopcb_table[TNUM_PORT]; 79 80 static const SIOPINIB siopinib_table[TNUM_SIOP] = 81 { 82 { P20, P21 }, 83 #if TNUM_SIOP > 1 84 { P50, P52 }, 85 #endif 86 #if TNUM_SIOP > 2 87 { P32, P33 }, 88 #endif 89 #if TNUM_SIOP > 3 90 { PC7, PC6 }, 91 #endif 92 #if TNUM_SIOP > 4 93 { P26, P30 }, 94 #endif 95 #if TNUM_SIOP > 5 96 { PB5, P25 }, 97 #endif 98 #if TNUM_SIOP > 6 99 { PA0, PC2 }, 100 #endif 101 }; 102 103 /* 104 * シリアルI/OポートIDから管理ブロックを取り出すためのマクロ 105 */ 106 #define INDEX_SIOP(siopid) ((uint_t)((siopid) - 1)) 107 #define get_siopcb(siopid) (&(siopcb_table[INDEX_SIOP(siopid)])) 108 #define get_siopinib(siopid) (&(siopinib_table[INDEX_SIOP(siopid)])) 109 110 static void mbed_serial_irq_handler(uint32_t id, SerialIrq event); 53 111 54 112 /* … … 58 116 sio_initialize(intptr_t exinf) 59 117 { 60 rx630_uart_initialize(); 118 SIOPCB *p_siopcb; 119 uint_t i; 120 121 /* 122 * シリアルI/Oポート管理ブロックの初期化 123 */ 124 for (p_siopcb = siopcb_table, i = 0; i < TNUM_SIOP; p_siopcb++, i++) { 125 p_siopcb->p_siopinib = &(siopinib_table[i]); 126 p_siopcb->openflag = false; 127 } 61 128 } 62 129 … … 69 136 SIOPCB *p_siopcb = NULL; 70 137 ER ercd; 71 INTNO intno_sio_tx, intno_sio_rx; 72 73 /* 74 * シリアルI/O割込みをマスクする. 75 * (dis_int関数は、"\kernel\interrupt.c"に記述) 76 */ 77 p_siopcb = rx630_uart_get_siopcb(siopid); 78 intno_sio_tx = rx630_uart_intno_tx(p_siopcb); 79 intno_sio_rx = rx630_uart_intno_rx(p_siopcb); 80 ercd = dis_int(intno_sio_tx); 81 assert(ercd == E_OK); 82 ercd = dis_int(intno_sio_rx); 83 assert(ercd == E_OK); 84 85 p_siopcb = 86 rx630_uart_opn_por(siopid , exinf , UART_BAUDRATE , UART_CLKSRC); 87 88 /* 89 * シリアルI/O割込みをマスク解除する. 90 * (ena_int関数は、"\kernel\interrupt.c"に記述) 91 */ 92 ercd = ena_int(intno_sio_tx); 93 assert(ercd == E_OK); 94 ercd = ena_int(intno_sio_rx); 95 assert(ercd == E_OK); 96 97 return(p_siopcb); 138 serial_t *serial; 139 140 if ((siopid <= 0) || (siopid > (sizeof(siopcb_table) / sizeof(siopcb_table[0])))) 141 return NULL; 142 p_siopcb = get_siopcb(siopid); 143 144 if (p_siopcb->openflag) 145 return NULL; 146 p_siopcb->openflag = true; 147 p_siopcb->exinf = exinf; 148 149 serial = &p_siopcb->serial; 150 serial_init(serial, p_siopcb->p_siopinib->tx, p_siopcb->p_siopinib->rx); 151 serial_baud(serial, UART_BAUDRATE); 152 serial_format(serial, 8, ParityNone, 1); 153 154 serial_irq_handler(serial, mbed_serial_irq_handler, siopid); 155 156 return p_siopcb; 98 157 } 99 158 … … 105 164 { 106 165 ER ercd; 107 INTNO intno_sio_tx, intno_sio_rx;166 serial_t *serial = &p_siopcb->serial; 108 167 109 168 /* 110 169 * デバイス依存のクローズ処理. 111 170 */ 112 rx630_uart_cls_por(p_siopcb); 113 114 /* 115 * シリアルI/O割込みをマスクする. 116 */ 117 intno_sio_tx = rx630_uart_intno_tx(p_siopcb); 118 intno_sio_rx = rx630_uart_intno_rx(p_siopcb); 119 ercd = dis_int(intno_sio_tx); 120 assert(ercd == E_OK); 121 ercd = dis_int(intno_sio_rx); 122 assert(ercd == E_OK); 171 serial_free(serial); 172 p_siopcb->openflag = false; 173 } 174 175 /* 176 * シリアルI/Oポートへの文字送信 177 */ 178 bool_t 179 sio_snd_chr(SIOPCB *p_siopcb, char c) 180 { 181 serial_t *serial = &p_siopcb->serial; 182 if (!serial_writable(serial)) 183 return false; 184 serial_putc(serial, c); 185 return true; 186 } 187 188 /* 189 * シリアルI/Oポートからの文字受信 190 */ 191 int_t 192 sio_rcv_chr(SIOPCB *p_siopcb) 193 { 194 serial_t *serial = &p_siopcb->serial; 195 if (!serial_readable(serial)) 196 return -1; 197 return serial_getc(serial); 198 } 199 200 /* 201 * シリアルI/Oポートからのコールバックの許可 202 */ 203 void 204 sio_ena_cbr(SIOPCB *p_siopcb, uint_t cbrtn) 205 { 206 serial_t *serial = &p_siopcb->serial; 207 switch (cbrtn) { 208 case SIO_RDY_SND: 209 serial_irq_set(serial, TxIrq, true); 210 break; 211 case SIO_RDY_RCV: 212 serial_irq_set(serial, RxIrq, true); 213 break; 214 } 215 } 216 217 /* 218 * シリアルI/Oポートからのコールバックの禁止 219 */ 220 void 221 sio_dis_cbr(SIOPCB *p_siopcb, uint_t cbrtn) 222 { 223 serial_t *serial = &p_siopcb->serial; 224 switch (cbrtn) { 225 case SIO_RDY_SND: 226 serial_irq_set(serial, TxIrq, false); 227 break; 228 case SIO_RDY_RCV: 229 serial_irq_set(serial, RxIrq, false); 230 break; 231 } 232 } 233 234 /* 235 * シリアルI/Oポートからの送信可能コールバック 236 */ 237 void 238 serial_irdy_snd(SIOPCB *p_siopcb) 239 { 240 /* 共通部(syssvc\serial.c)にあるsio_irdy_snd関数を呼び出し*/ 241 sio_irdy_snd(p_siopcb->exinf); 242 } 243 244 /* 245 * シリアルI/Oポートからの受信通知コールバック 246 */ 247 void 248 serial_irdy_rcv(SIOPCB *p_siopcb) 249 { 250 /* 共通部(syssvc\serial.c)にあるsio_irdy_rcv関数を呼び出し*/ 251 sio_irdy_rcv(p_siopcb->exinf); 123 252 } 124 253 … … 126 255 * SIOの割込みハンドラ 127 256 */ 128 void sio_tx_isr(intptr_t exinf) 129 { 130 rx630_uart_tx_isr(exinf); 131 } 132 133 /* 134 * SIOの割込みハンドラ 135 */ 136 void sio_rx_isr(intptr_t exinf) 137 { 138 rx630_uart_rx_isr(exinf); 139 } 140 141 /* 142 * シリアルI/Oポートへの文字送信 143 */ 144 bool_t 145 sio_snd_chr(SIOPCB *siopcb, char c) 146 { 147 return(rx630_uart_snd_chr(siopcb, c)); 148 } 149 150 /* 151 * シリアルI/Oポートからの文字受信 152 */ 153 int_t 154 sio_rcv_chr(SIOPCB *siopcb) 155 { 156 return(rx630_uart_rcv_chr(siopcb)); 157 } 158 159 /* 160 * シリアルI/Oポートからのコールバックの許可 161 */ 162 void 163 sio_ena_cbr(SIOPCB *siopcb, uint_t cbrtn) 164 { 165 rx630_uart_ena_cbr(siopcb, cbrtn); 166 } 167 168 /* 169 * シリアルI/Oポートからのコールバックの禁止 170 */ 171 void 172 sio_dis_cbr(SIOPCB *siopcb, uint_t cbrtn) 173 { 174 rx630_uart_dis_cbr(siopcb, cbrtn); 175 } 176 177 /* 178 * シリアルI/Oポートからの送信可能コールバック 179 */ 180 void 181 rx630_uart_irdy_snd(intptr_t exinf) 182 { 183 /* 共通部(syssvc\serial.c)にあるsio_irdy_snd関数を呼び出し*/ 184 sio_irdy_snd(exinf); 185 } 186 187 /* 188 * シリアルI/Oポートからの受信通知コールバック 189 */ 190 void 191 rx630_uart_irdy_rcv(intptr_t exinf) 192 { 193 /* 共通部(syssvc\serial.c)にあるsio_irdy_rcv関数を呼び出し*/ 194 sio_irdy_rcv(exinf); 195 } 196 257 void 258 mbed_serial_irq_handler(uint32_t siopid, SerialIrq event) 259 { 260 SIOPCB *p_siopcb; 261 262 if ((siopid <= 0) || (siopid > (sizeof(siopcb_table) / sizeof(siopcb_table[0])))) 263 return; 264 p_siopcb = get_siopcb(siopid); 265 266 if (!p_siopcb->openflag) 267 return; 268 269 switch (event) { 270 case TxIrq: 271 serial_irdy_snd(p_siopcb); 272 break; 273 case RxIrq: 274 serial_irdy_rcv(p_siopcb); 275 break; 276 } 277 } -
asp3_tinet_ecnl_rx/trunk/asp3_dcre/target/gr_citrus_gcc/target_serial.cfg
r337 r374 4 4 5 5 #include <target_serial.h> 6 6 7 ATT_INI({ TA_NULL, 0, sio_initialize }); 7 CFG_INT(INTNO_SIO_TX, { INTATR_SIO, INTPRI_SIO });8 CFG_INT(INTNO_SIO_RX, { INTATR_SIO, INTPRI_SIO });9 8 10 CRE_ISR(INTNO_SIO_TX_ISR, {TA_NULL, SIO_PORTID, INTNO_SIO_TX, sio_tx_isr, 1});11 CRE_ISR(INTNO_SIO_RX_ISR, {TA_NULL, SIO_PORTID, INTNO_SIO_RX, sio_rx_isr, 1}); -
asp3_tinet_ecnl_rx/trunk/asp3_dcre/target/gr_citrus_gcc/target_serial.h
r337 r374 53 53 54 54 #include "gr_citrus.h" 55 #include " rx630_uart.h"55 #include "serial_api.h" 56 56 57 /* 58 * SIOの割込みハンドラのベクタ番号 59 */ 60 #define INHNO_SIO_TX INT_SCI1_TEI /* 割込みハンドラ番号 */ 61 #define INTNO_SIO_TX INT_SCI1_TEI /* 割込み番号 */ 62 #define INHNO_SIO_RX INT_SCI1_RXI /* 割込みハンドラ番号 */ 63 #define INTNO_SIO_RX INT_SCI1_RXI /* 割込み番号 */ 64 #define INTPRI_SIO -4 /* 割込み優先度 */ 65 #define INTATR_SIO (TA_NULL) /* 割込み属性 */ 57 #define SIO_RDY_SND 1 58 #define SIO_RDY_RCV 2 66 59 67 60 #ifndef TOPPERS_MACRO_ONLY 68 61 62 typedef struct sio_port_control_block SIOPCB; 69 63 70 64 /* … … 82 76 */ 83 77 extern void sio_cls_por(SIOPCB *p_siopcb); 84 85 /*86 * SIOの割込みハンドラ87 */88 extern void sio_tx_isr(intptr_t exinf);89 extern void sio_rx_isr(intptr_t exinf);90 78 91 79 /* -
asp3_tinet_ecnl_rx/trunk/asp3_dcre/target/gr_citrus_gcc/target_syssvc.h
r337 r374 113 113 114 114 /* 115 * 使用するシリアルポートのPinName 116 */ 117 #define STDIO_UART_TX P20 118 #define STDIO_UART_RX P21 119 120 /* 115 121 * システムログタスク関連の定数の定義 116 122 * -
asp3_tinet_ecnl_rx/trunk/asp3_dcre/target/gr_sakura_gcc/Makefile.target
r337 r374 13 13 # コンパイルオプション 14 14 # 15 INCLUDES := $(INCLUDES) -I$(TARGETDIR) -I$(SRCDIR)/ pdic15 INCLUDES := $(INCLUDES) -I$(TARGETDIR) -I$(SRCDIR)/mbed 16 16 17 17 # … … 25 25 # システムサービスに関する定義 26 26 # 27 SYSSVC_DIRS := $(SYSSVC_DIRS) 27 SYSSVC_DIRS := $(SYSSVC_DIRS) $(SRCDIR)/mbed 28 28 SYSSVC_COBJS := $(SYSSVC_COBJS) 29 29 -
asp3_tinet_ecnl_rx/trunk/asp3_dcre/target/gr_sakura_gcc/gr_sakura.h
r337 r374 71 71 * ボーレート設定 72 72 */ 73 #define BAUD_19200BPS UINT_C( 78 ) 74 #define BAUD_38400BPS UINT_C( 39 ) 75 #define BAUD_57600BPS UINT_C( 25 ) 76 #define BAUD_115200BPS UINT_C( 12 ) 77 78 #define UART_BAUDRATE BAUD_115200BPS 73 #define UART_BAUDRATE 115200 79 74 80 75 /* -
asp3_tinet_ecnl_rx/trunk/asp3_dcre/target/gr_sakura_gcc/tSIOPortGRSakura.cdl
r337 r374 51 51 */ 52 52 import_C("gr_sakura.h"); 53 import_C(" rx630.h");53 import_C("device.h"); 54 54 55 55 /* 56 56 * FIFO内蔵シリアルコミュニケーションインタフェース用 簡易SIOドライバ 57 57 */ 58 import("t SCIF.cdl");58 import("tMbedSerial.cdl"); 59 59 60 60 /* … … 74 74 call sSIOPort cSIOPort; 75 75 [inline] entry siSIOCBR eiSIOCBR; 76 77 /*78 * 割込み要求ライン操作のための結合79 */80 call sInterruptRequest cRxInterruptRequest;81 call sInterruptRequest cTxInterruptRequest;82 76 }; 83 77 … … 86 80 * ト)のセルタイプ 87 81 */ 88 [active]89 82 composite tSIOPortGRSakura { 90 83 /* … … 98 91 */ 99 92 attr { 100 uintptr_t baseAddress; /* ベースアドレス */ 101 INTNO rxInterruptNumber; /* 受信割込み番号 */ 102 INTNO txInterruptNumber; /* 送信割込み番号 */ 103 PRI isrPriority = 1; /* ISR優先度 */ 104 PRI interruptPriority = -4; /* 割込み優先度 */ 93 int32_t tx; /* 送信Pin */ 94 int32_t rx; /* 受信Pin */ 105 95 uint32_t baudRate = 115200; /* ボーレートの設定値 */ 106 96 }; … … 109 99 * SIOドライバ 110 100 */ 111 cell tSCIF SCIF { 112 baseAddress = composite.baseAddress; 101 cell tMbedSerial MbedSerial { 102 tx = composite.tx; 103 rx = composite.rx; 113 104 baudRate = composite.baudRate; 114 105 ciSIOCBR = SIOPortMain.eiSIOCBR; … … 120 111 cell tSIOPortGRSakuraMain SIOPortMain { 121 112 ciSIOCBR => composite.ciSIOCBR; 122 cSIOPort = SCIF.eSIOPort; 123 cRxInterruptRequest = RxInterruptRequest.eInterruptRequest; 124 cTxInterruptRequest = TxInterruptRequest.eInterruptRequest; 113 cSIOPort = MbedSerial.eSIOPort; 125 114 }; 126 115 composite.eSIOPort => SIOPortMain.eSIOPort; 127 128 /*129 * SIOの受信割込みサービスルーチンと割込み要求ライン130 */131 cell tISR RxISRInstance {132 interruptNumber = composite.rxInterruptNumber;133 isrPriority = composite.isrPriority;134 ciISRBody = SCIF.eiRxISR;135 };136 cell tInterruptRequest RxInterruptRequest {137 interruptNumber = composite.rxInterruptNumber;138 interruptPriority = composite.interruptPriority;139 };140 141 /*142 * SIOの受信割込みサービスルーチンと割込み要求ライン143 */144 cell tISR TxISRInstance {145 interruptNumber = composite.txInterruptNumber;146 isrPriority = composite.isrPriority;147 ciISRBody = SCIF.eiTxISR;148 };149 cell tInterruptRequest TxInterruptRequest {150 interruptNumber = composite.txInterruptNumber;151 interruptPriority = composite.interruptPriority;152 };153 116 }; 154 117 … … 158 121 * サンプルプログラムが使うポートが,SIOPortTarget1に固定されているた 159 122 * め,ポート1とポート3を入れ換えている.具体的には,SIOPortTarget1は 160 * SCIFのチャネル2(チャネル番号は0から始まるので,ポート3のこと)に,161 * SIOPortTarget3は SCIFのチャネル0につながっている.123 * MbedSerialのチャネル2(チャネル番号は0から始まるので,ポート3のこと)に, 124 * SIOPortTarget3はMbedSerialのチャネル0につながっている. 162 125 */ 163 126 [prototype] 164 127 cell tSIOPortGRSakura SIOPortTarget1 { 165 128 /* 属性の設定 */ 166 baseAddress = C_EXP("SCI0_BASE"); 167 rxInterruptNumber = C_EXP("INT_SCI0_RXI"); 168 txInterruptNumber = C_EXP("INT_SCI0_TEI"); 129 tx = C_EXP("P20"); /* PIN_IO1 */ 130 rx = C_EXP("P21"); /* PIN_IO0 */ 169 131 }; 170 132 … … 172 134 cell tSIOPortGRSakura SIOPortTarget2 { 173 135 /* 属性の設定 */ 174 baseAddress = C_EXP("SCI1_BASE"); 175 rxInterruptNumber = C_EXP("INT_SCI1_RXI"); 176 txInterruptNumber = C_EXP("INT_SCI1_TEI"); 136 tx = C_EXP("P32"); /* PIN_IO6 */ 137 rx = C_EXP("P33"); /* PIN_IO7 */ 177 138 }; 178 139 … … 180 141 cell tSIOPortGRSakura SIOPortTarget3 { 181 142 /* 属性の設定 */ 182 baseAddress = C_EXP("SCI2_BASE"); 183 rxInterruptNumber = C_EXP("INT_SCI2_RXI"); 184 txInterruptNumber = C_EXP("INT_SCI2_TEI"); 143 tx = C_EXP("P50"); /* PIN_IO24 */ 144 rx = C_EXP("P52"); /* PIN_IO26 */ 185 145 }; 186 146 … … 188 148 cell tSIOPortGRSakura SIOPortTarget4 { 189 149 /* 属性の設定 */ 190 baseAddress = C_EXP("SCI3_BASE"); 191 rxInterruptNumber = C_EXP("INT_SCI3_RXI"); 192 txInterruptNumber = C_EXP("INT_SCI3_TEI"); 150 tx = C_EXP("P23"); /* PIN_IO3 */ 151 rx = C_EXP("P25"); /* PIN_IO5 */ 193 152 }; 194 153 … … 196 155 cell tSIOPortGRSakura SIOPortTarget5 { 197 156 /* 属性の設定 */ 198 baseAddress = C_EXP("SCI4_BASE"); 199 rxInterruptNumber = C_EXP("INT_SCI4_RXI"); 200 txInterruptNumber = C_EXP("INT_SCI4_TEI"); 157 tx = C_EXP("PC3"); /* PIN_IO9 */ 158 rx = C_EXP("PC2"); /* PIN_IO8 */ 201 159 }; 202 160 … … 204 162 cell tSIOPortGRSakura SIOPortTarget6 { 205 163 /* 属性の設定 */ 206 baseAddress = C_EXP("SCI5_BASE"); 207 rxInterruptNumber = C_EXP("INT_SCI5_RXI"); 208 txInterruptNumber = C_EXP("INT_SCI5_TEI"); 164 tx = C_EXP("PC7"); /* PIN_IO12 */ 165 rx = C_EXP("PC6"); /* PIN_IO11 */ 209 166 }; 210 167 … … 212 169 cell tSIOPortGRSakura SIOPortTarget7 { 213 170 /* 属性の設定 */ 214 baseAddress = C_EXP("SCI6_BASE"); 215 rxInterruptNumber = C_EXP("INT_SCI6_RXI"); 216 txInterruptNumber = C_EXP("INT_SCI6_TEI"); 171 tx = C_EXP("P26"); /* PIN_IO58 */ 172 rx = C_EXP("P30"); /* PIN_IO60 */ 217 173 }; 218 174 … … 220 176 cell tSIOPortGRSakura SIOPortTarget8 { 221 177 /* 属性の設定 */ 222 baseAddress = NULL; 223 rxInterruptNumber = NULL; 224 txInterruptNumber = NULL; 178 tx = NULL; 179 rx = NULL; 225 180 }; -
asp3_tinet_ecnl_rx/trunk/asp3_dcre/target/gr_sakura_gcc/tSIOPortGRSakuraMain_inline.h
r337 r374 57 57 */ 58 58 cSIOPort_open(); 59 60 /*61 * SIOの割込みマスクを解除する.62 */63 cRxInterruptRequest_enable();64 cTxInterruptRequest_enable();65 59 } 66 60 … … 77 71 */ 78 72 cSIOPort_close(); 79 80 /*81 * SIOの割込みをマスクする.82 */83 cRxInterruptRequest_disable();84 cTxInterruptRequest_disable();85 73 } 86 74 -
asp3_tinet_ecnl_rx/trunk/asp3_dcre/target/gr_sakura_gcc/target_kernel_impl.c
r364 r374 53 53 #include "syssvc/serial.h" 54 54 #ifdef TOPPERS_OMIT_TECS 55 #include "rx630_uart.h" 55 #include "serial_api.h" 56 #endif 57 58 #ifdef TOPPERS_OMIT_TECS 59 serial_t log_serial; 56 60 #endif 57 61 … … 78 82 sil_reb_mem(PORTA_PDR_ADDR) & ~PORT_PDR_B7_BIT); 79 83 84 #ifdef TOPPERS_OMIT_TECS 80 85 /* 81 86 * シリアルポートの設定 82 87 */ 83 84 /* ポートP20をTxD0, ポートP21をRxD0に */ 85 sil_wrb_mem(PORT2_PMR_ADDR, 0x03); 86 87 /* データディレクションレジスタ(PDR)の設定 P21(RxD0)を入力ポートにする */ 88 sil_wrb_mem(PORT2_PDR_ADDR, 89 sil_reb_mem(PORT2_PDR_ADDR) & ~PORT_PDR_B1_BIT); 90 91 /* データディレクションレジスタ(PDR)の設定 P20(TxD0)を出力ポートにする */ 92 sil_wrb_mem(PORT2_PDR_ADDR, 93 sil_reb_mem(PORT2_PDR_ADDR) | PORT_PDR_B0_BIT); 88 serial_init(&log_serial, P20, P21); 89 serial_baud(&log_serial, UART_BAUDRATE); 90 serial_format(&log_serial, 8, ParityNone, 1); 91 #endif 94 92 95 93 /* ポートP40~P47を周辺機器に */ … … 152 150 { 153 151 if (c == '\n') { 154 rx630_uart_pol_putc('\r', TARGET_PUTC_PORTID);152 serial_putc(&log_serial, '\r'); 155 153 } 156 154 157 rx630_uart_pol_putc(c, TARGET_PUTC_PORTID);155 serial_putc(&log_serial, c); 158 156 } 159 157 #endif -
asp3_tinet_ecnl_rx/trunk/asp3_dcre/target/gr_sakura_gcc/target_serial.c
r337 r374 3 3 * Toyohashi Open Platform for Embedded Real-Time Systems/ 4 4 * Advanced Standard Profile Kernel 5 * 5 * 6 6 * Copyright (C) 2000-2003 by Embedded and Real-Time Systems Laboratory 7 7 * Toyohashi Univ. of Technology, JAPAN … … 12 12 * Copyright (C) 2008-2010 by Witz Corporation, JAPAN 13 13 * Copyright (C) 2013 by Mitsuhiro Matsuura 14 * 14 * 15 15 * 上記著作権者は,以下の(1)~(4)の条件を満たす場合に限り,本ソフトウェ 16 16 * ア(本ソフトウェアを改変したものを含む.以下同じ)を使用・複製・改 … … 35 35 * 由に基づく請求からも,上記著作権者およびTOPPERSプロジェクトを 36 36 * 免責すること. 37 * 37 * 38 38 * 本ソフトウェアは,無保証で提供されているものである.上記著作権者お 39 39 * よびTOPPERSプロジェクトは,本ソフトウェアに関して,特定の使用目的 … … 41 41 * アの利用により直接的または間接的に生じたいかなる損害に関しても,そ 42 42 * の責任を負わない. 43 * 43 * 44 44 * @(#) $Id$ 45 45 */ … … 51 51 #include <sil.h> 52 52 #include "target_serial.h" 53 #include "hal/serial_api.h" 54 #include "target_syssvc.h" 55 #include "syssvc/serial.h" 56 57 /* 58 * シリアルI/Oポート初期化ブロックの定義 59 */ 60 typedef struct sio_port_initialization_block { 61 PinName tx; 62 PinName rx; 63 } SIOPINIB; 64 65 /* 66 * シリアルI/Oポート管理ブロックの定義 67 */ 68 struct sio_port_control_block { 69 const SIOPINIB *p_siopinib; 70 intptr_t exinf; 71 bool_t openflag; 72 serial_t serial; 73 }; 74 75 /* 76 * シリアルI/Oポート管理ブロックのエリア 77 */ 78 SIOPCB siopcb_table[TNUM_PORT]; 79 80 static const SIOPINIB siopinib_table[TNUM_SIOP] = 81 { 82 { P20, P21 }, 83 #if TNUM_SIOP > 1 84 { P32, P33 }, 85 #endif 86 #if TNUM_SIOP > 2 87 { P50, P52 }, 88 #endif 89 #if TNUM_SIOP > 3 90 { P23, P25 }, 91 #endif 92 #if TNUM_SIOP > 4 93 { PC3, PC2 }, 94 #endif 95 #if TNUM_SIOP > 5 96 { PC7, PC6 }, 97 #endif 98 #if TNUM_SIOP > 6 99 { P26, P30 }, 100 #endif 101 }; 102 103 /* 104 * シリアルI/OポートIDから管理ブロックを取り出すためのマクロ 105 */ 106 #define INDEX_SIOP(siopid) ((uint_t)((siopid) - 1)) 107 #define get_siopcb(siopid) (&(siopcb_table[INDEX_SIOP(siopid)])) 108 #define get_siopinib(siopid) (&(siopinib_table[INDEX_SIOP(siopid)])) 109 110 static void mbed_serial_irq_handler(uint32_t id, SerialIrq event); 53 111 54 112 /* … … 58 116 sio_initialize(intptr_t exinf) 59 117 { 60 rx630_uart_initialize(); 118 SIOPCB *p_siopcb; 119 uint_t i; 120 121 /* 122 * シリアルI/Oポート管理ブロックの初期化 123 */ 124 for (p_siopcb = siopcb_table, i = 0; i < TNUM_SIOP; p_siopcb++, i++) { 125 p_siopcb->p_siopinib = &(siopinib_table[i]); 126 p_siopcb->openflag = false; 127 } 61 128 } 62 129 … … 69 136 SIOPCB *p_siopcb = NULL; 70 137 ER ercd; 71 INTNO intno_sio_tx, intno_sio_rx; 72 73 /* 74 * シリアルI/O割込みをマスクする. 75 * (dis_int関数は、"\kernel\interrupt.c"に記述) 76 */ 77 p_siopcb = rx630_uart_get_siopcb(siopid); 78 intno_sio_tx = rx630_uart_intno_tx(p_siopcb); 79 intno_sio_rx = rx630_uart_intno_rx(p_siopcb); 80 ercd = dis_int(intno_sio_tx); 81 assert(ercd == E_OK); 82 ercd = dis_int(intno_sio_rx); 83 assert(ercd == E_OK); 84 85 p_siopcb = 86 rx630_uart_opn_por(siopid , exinf , UART_BAUDRATE , UART_CLKSRC); 87 88 /* 89 * シリアルI/O割込みをマスク解除する. 90 * (ena_int関数は、"\kernel\interrupt.c"に記述) 91 */ 92 ercd = ena_int(intno_sio_tx); 93 assert(ercd == E_OK); 94 ercd = ena_int(intno_sio_rx); 95 assert(ercd == E_OK); 96 97 return(p_siopcb); 138 serial_t *serial; 139 140 if ((siopid <= 0) || (siopid > (sizeof(siopcb_table) / sizeof(siopcb_table[0])))) 141 return NULL; 142 p_siopcb = get_siopcb(siopid); 143 144 if (p_siopcb->openflag) 145 return NULL; 146 p_siopcb->openflag = true; 147 p_siopcb->exinf = exinf; 148 149 serial = &p_siopcb->serial; 150 serial_init(serial, p_siopcb->p_siopinib->tx, p_siopcb->p_siopinib->rx); 151 serial_baud(serial, UART_BAUDRATE); 152 serial_format(serial, 8, ParityNone, 1); 153 154 serial_irq_handler(serial, mbed_serial_irq_handler, siopid); 155 156 return p_siopcb; 98 157 } 99 158 … … 105 164 { 106 165 ER ercd; 107 INTNO intno_sio_tx, intno_sio_rx;166 serial_t *serial = &p_siopcb->serial; 108 167 109 168 /* 110 169 * デバイス依存のクローズ処理. 111 170 */ 112 rx630_uart_cls_por(p_siopcb); 113 114 /* 115 * シリアルI/O割込みをマスクする. 116 */ 117 intno_sio_tx = rx630_uart_intno_tx(p_siopcb); 118 intno_sio_rx = rx630_uart_intno_rx(p_siopcb); 119 ercd = dis_int(intno_sio_tx); 120 assert(ercd == E_OK); 121 ercd = dis_int(intno_sio_rx); 122 assert(ercd == E_OK); 171 serial_free(serial); 172 p_siopcb->openflag = false; 173 } 174 175 /* 176 * シリアルI/Oポートへの文字送信 177 */ 178 bool_t 179 sio_snd_chr(SIOPCB *p_siopcb, char c) 180 { 181 serial_t *serial = &p_siopcb->serial; 182 if (!serial_writable(serial)) 183 return false; 184 serial_putc(serial, c); 185 return true; 186 } 187 188 /* 189 * シリアルI/Oポートからの文字受信 190 */ 191 int_t 192 sio_rcv_chr(SIOPCB *p_siopcb) 193 { 194 serial_t *serial = &p_siopcb->serial; 195 if (!serial_readable(serial)) 196 return -1; 197 return serial_getc(serial); 198 } 199 200 /* 201 * シリアルI/Oポートからのコールバックの許可 202 */ 203 void 204 sio_ena_cbr(SIOPCB *p_siopcb, uint_t cbrtn) 205 { 206 serial_t *serial = &p_siopcb->serial; 207 switch (cbrtn) { 208 case SIO_RDY_SND: 209 serial_irq_set(serial, TxIrq, true); 210 break; 211 case SIO_RDY_RCV: 212 serial_irq_set(serial, RxIrq, true); 213 break; 214 } 215 } 216 217 /* 218 * シリアルI/Oポートからのコールバックの禁止 219 */ 220 void 221 sio_dis_cbr(SIOPCB *p_siopcb, uint_t cbrtn) 222 { 223 serial_t *serial = &p_siopcb->serial; 224 switch (cbrtn) { 225 case SIO_RDY_SND: 226 serial_irq_set(serial, TxIrq, false); 227 break; 228 case SIO_RDY_RCV: 229 serial_irq_set(serial, RxIrq, false); 230 break; 231 } 232 } 233 234 /* 235 * シリアルI/Oポートからの送信可能コールバック 236 */ 237 void 238 serial_irdy_snd(SIOPCB *p_siopcb) 239 { 240 /* 共通部(syssvc\serial.c)にあるsio_irdy_snd関数を呼び出し*/ 241 sio_irdy_snd(p_siopcb->exinf); 242 } 243 244 /* 245 * シリアルI/Oポートからの受信通知コールバック 246 */ 247 void 248 serial_irdy_rcv(SIOPCB *p_siopcb) 249 { 250 /* 共通部(syssvc\serial.c)にあるsio_irdy_rcv関数を呼び出し*/ 251 sio_irdy_rcv(p_siopcb->exinf); 123 252 } 124 253 … … 126 255 * SIOの割込みハンドラ 127 256 */ 128 void sio_tx_isr(intptr_t exinf) 129 { 130 rx630_uart_tx_isr(exinf); 131 } 132 133 /* 134 * SIOの割込みハンドラ 135 */ 136 void sio_rx_isr(intptr_t exinf) 137 { 138 rx630_uart_rx_isr(exinf); 139 } 140 141 /* 142 * シリアルI/Oポートへの文字送信 143 */ 144 bool_t 145 sio_snd_chr(SIOPCB *siopcb, char c) 146 { 147 return(rx630_uart_snd_chr(siopcb, c)); 148 } 149 150 /* 151 * シリアルI/Oポートからの文字受信 152 */ 153 int_t 154 sio_rcv_chr(SIOPCB *siopcb) 155 { 156 return(rx630_uart_rcv_chr(siopcb)); 157 } 158 159 /* 160 * シリアルI/Oポートからのコールバックの許可 161 */ 162 void 163 sio_ena_cbr(SIOPCB *siopcb, uint_t cbrtn) 164 { 165 rx630_uart_ena_cbr(siopcb, cbrtn); 166 } 167 168 /* 169 * シリアルI/Oポートからのコールバックの禁止 170 */ 171 void 172 sio_dis_cbr(SIOPCB *siopcb, uint_t cbrtn) 173 { 174 rx630_uart_dis_cbr(siopcb, cbrtn); 175 } 176 177 /* 178 * シリアルI/Oポートからの送信可能コールバック 179 */ 180 void 181 rx630_uart_irdy_snd(intptr_t exinf) 182 { 183 /* 共通部(syssvc\serial.c)にあるsio_irdy_snd関数を呼び出し*/ 184 sio_irdy_snd(exinf); 185 } 186 187 /* 188 * シリアルI/Oポートからの受信通知コールバック 189 */ 190 void 191 rx630_uart_irdy_rcv(intptr_t exinf) 192 { 193 /* 共通部(syssvc\serial.c)にあるsio_irdy_rcv関数を呼び出し*/ 194 sio_irdy_rcv(exinf); 195 } 196 257 void 258 mbed_serial_irq_handler(uint32_t siopid, SerialIrq event) 259 { 260 SIOPCB *p_siopcb; 261 262 if ((siopid <= 0) || (siopid > (sizeof(siopcb_table) / sizeof(siopcb_table[0])))) 263 return; 264 p_siopcb = get_siopcb(siopid); 265 266 if (!p_siopcb->openflag) 267 return; 268 269 switch (event) { 270 case TxIrq: 271 serial_irdy_snd(p_siopcb); 272 break; 273 case RxIrq: 274 serial_irdy_rcv(p_siopcb); 275 break; 276 } 277 } -
asp3_tinet_ecnl_rx/trunk/asp3_dcre/target/gr_sakura_gcc/target_serial.cfg
r337 r374 4 4 5 5 #include <target_serial.h> 6 6 7 ATT_INI({ TA_NULL, 0, sio_initialize }); 7 CFG_INT(INTNO_SIO_TX, { INTATR_SIO, INTPRI_SIO });8 CFG_INT(INTNO_SIO_RX, { INTATR_SIO, INTPRI_SIO });9 8 10 CRE_ISR(INTNO_SIO_TX_ISR, {TA_NULL, SIO_PORTID, INTNO_SIO_TX, sio_tx_isr, 1});11 CRE_ISR(INTNO_SIO_RX_ISR, {TA_NULL, SIO_PORTID, INTNO_SIO_RX, sio_rx_isr, 1}); -
asp3_tinet_ecnl_rx/trunk/asp3_dcre/target/gr_sakura_gcc/target_serial.h
r337 r374 53 53 54 54 #include "gr_sakura.h" 55 #include " rx630_uart.h"55 #include "serial_api.h" 56 56 57 /* 58 * SIOの割込みハンドラのベクタ番号 59 */ 60 #define INHNO_SIO_TX INT_SCI0_TEI /* 割込みハンドラ番号 */ 61 #define INTNO_SIO_TX INT_SCI0_TEI /* 割込み番号 */ 62 #define INHNO_SIO_RX INT_SCI0_RXI /* 割込みハンドラ番号 */ 63 #define INTNO_SIO_RX INT_SCI0_RXI /* 割込み番号 */ 64 #define INTPRI_SIO -4 /* 割込み優先度 */ 65 #define INTATR_SIO (TA_NULL) /* 割込み属性 */ 57 #define SIO_RDY_SND 1 58 #define SIO_RDY_RCV 2 66 59 67 60 #ifndef TOPPERS_MACRO_ONLY 68 61 62 typedef struct sio_port_control_block SIOPCB; 69 63 70 64 /* … … 82 76 */ 83 77 extern void sio_cls_por(SIOPCB *p_siopcb); 84 85 /*86 * SIOの割込みハンドラ87 */88 extern void sio_tx_isr(intptr_t exinf);89 extern void sio_rx_isr(intptr_t exinf);90 78 91 79 /* -
asp3_tinet_ecnl_rx/trunk/asp3_dcre/target/gr_sakura_gcc/target_syssvc.h
r337 r374 113 113 114 114 /* 115 * 使用するシリアルポートのPinName 116 */ 117 #define STDIO_UART_TX P20 118 #define STDIO_UART_RX P21 119 120 /* 115 121 * システムログタスク関連の定数の定義 116 122 *
Note:
See TracChangeset
for help on using the changeset viewer.