RXRS_SCI_ERI, //--- for RXRSLIB /* Excep_GROUP_L0, */ |
/* Excep_SCI0_RXI0, Excep_SCI0_TXI0, Excep_SCI0_TEI0, Excep_SCI1_RXI1, Excep_SCI1_TXI1, Excep_SCI1_TEI1, Excep_SCI2_RXI2, Excep_SCI2_TXI2, Excep_SCI2_TEI2, Excep_SCI3_RXI3, Excep_SCI3_TXI3, Excep_SCI3_TEI3, */ RXRS_SCI0_RXI0, //--- for RXRSLIB RXRS_SCI0_TXI0, RXRS_SCI0_TEI0, RXRS_SCI1_RXI1, //--- for RXRSLIB RXRS_SCI1_TXI1, RXRS_SCI1_TEI1, RXRS_SCI2_RXI2, //--- for RXRSLIB RXRS_SCI2_TXI2, RXRS_SCI2_TEI2, RXRS_SCI3_RXI3, //--- for RXRSLIB RXRS_SCI3_TXI3, RXRS_SCI3_TEI3, Excep_SCI4_RXI4, Excep_SCI4_TXI4, Excep_SCI4_TEI4, /* Excep_SCI5_RXI5, Excep_SCI5_TXI5, Excep_SCI5_TEI5, Excep_SCI6_RXI6, Excep_SCI6_TXI6, Excep_SCI6_TEI6, */ RXRS_SCI5_RXI5, //--- for RXRSLIB RXRS_SCI5_TXI5, RXRS_SCI5_TEI5, RXRS_SCI6_RXI6, //--- for RXRSLIB RXRS_SCI6_TXI6, RXRS_SCI6_TEI6, Excep_SCI7_RXI7, Excep_SCI7_TXI7, Excep_SCI7_TEI7, /* Excep_SCI8_RXI8, Excep_SCI8_TXI8, Excep_SCI8_TEI8, */ RXRS_SCI8_RXI8, //--- for RXRSLIB RXRS_SCI8_TXI8, RXRS_SCI8_TEI8, Excep_SCI9_RXI9, Excep_SCI9_TXI9, Excep_SCI9_TEI9, Excep_SCI10_RXI10, Excep_SCI10_TXI10, Excep_SCI10_TEI10, Excep_SCI11_RXI11, Excep_SCI11_TXI11, Excep_SCI11_TEI11, /* Excep_SCI12_RXI12, Excep_SCI12_TXI12, Excep_SCI12_TEI12, */ RXRS_SCI12_RXI12, //--- for RXRSLIB RXRS_SCI12_TXI12, RXRS_SCI12_TEI12, |
void __attribute__ ((interrupt)) RXRS_SCI_ERI(void); void __attribute__ ((interrupt)) RXRS_SCI0_RXI0(void); void __attribute__ ((interrupt)) RXRS_SCI0_TXI0(void); void __attribute__ ((interrupt)) RXRS_SCI0_TEI0(void); void __attribute__ ((interrupt)) RXRS_SCI1_RXI1(void); void __attribute__ ((interrupt)) RXRS_SCI1_TXI1(void); void __attribute__ ((interrupt)) RXRS_SCI1_TEI1(void); void __attribute__ ((interrupt)) RXRS_SCI2_RXI2(void); void __attribute__ ((interrupt)) RXRS_SCI2_TXI2(void); void __attribute__ ((interrupt)) RXRS_SCI2_TEI2(void); void __attribute__ ((interrupt)) RXRS_SCI3_RXI3(void); void __attribute__ ((interrupt)) RXRS_SCI3_TXI3(void); void __attribute__ ((interrupt)) RXRS_SCI3_TEI3(void); void __attribute__ ((interrupt)) RXRS_SCI5_RXI5(void); void __attribute__ ((interrupt)) RXRS_SCI5_TXI5(void); void __attribute__ ((interrupt)) RXRS_SCI5_TEI5(void); void __attribute__ ((interrupt)) RXRS_SCI6_RXI6(void); void __attribute__ ((interrupt)) RXRS_SCI6_TXI6(void); void __attribute__ ((interrupt)) RXRS_SCI6_TEI6(void); void __attribute__ ((interrupt)) RXRS_SCI8_RXI8(void); void __attribute__ ((interrupt)) RXRS_SCI8_TXI8(void); void __attribute__ ((interrupt)) RXRS_SCI8_TEI8(void); void __attribute__ ((interrupt)) RXRS_SCI12_RXI12(void); void __attribute__ ((interrupt)) RXRS_SCI12_TXI12(void); void __attribute__ ((interrupt)) RXRS_SCI12_TEI12(void); |
#include "rxrslib.h" |
//;0x1C8 ICU GROUP12 //(fp)INT_Excep_ICU_GROUP12, (fp)RXRS_SCI_ERI, |
//;0x0358 SCI0_RXI0 //(fp)INT_Excep_SCI0_RXI0, (fp)RXRS_SCI0_RXI0, //;0x035C SCI0_TXI0 //(fp)INT_Excep_SCI0_TXI0, (fp)RXRS_SCI0_TXI0, //;0x0360 SCI0_TEI0 //(fp)INT_Excep_SCI0_TEI0, (fp)RXRS_SCI0_TEI0, |
void __attribute__ ((interrupt)) RXRS_SCI_ERI(void); void __attribute__ ((interrupt)) RXRS_SCI0_RXI0(void); void __attribute__ ((interrupt)) RXRS_SCI0_TXI0(void); void __attribute__ ((interrupt)) RXRS_SCI0_TEI0(void); void __attribute__ ((interrupt)) RXRS_SCI1_RXI1(void); void __attribute__ ((interrupt)) RXRS_SCI1_TXI1(void); void __attribute__ ((interrupt)) RXRS_SCI1_TEI1(void); void __attribute__ ((interrupt)) RXRS_SCI2_RXI2(void); void __attribute__ ((interrupt)) RXRS_SCI2_TXI2(void); void __attribute__ ((interrupt)) RXRS_SCI2_TEI2(void); void __attribute__ ((interrupt)) RXRS_SCI3_RXI3(void); void __attribute__ ((interrupt)) RXRS_SCI3_TXI3(void); void __attribute__ ((interrupt)) RXRS_SCI3_TEI3(void); void __attribute__ ((interrupt)) RXRS_SCI5_RXI5(void); void __attribute__ ((interrupt)) RXRS_SCI5_TXI5(void); void __attribute__ ((interrupt)) RXRS_SCI5_TEI5(void); void __attribute__ ((interrupt)) RXRS_SCI6_RXI6(void); void __attribute__ ((interrupt)) RXRS_SCI6_TXI6(void); void __attribute__ ((interrupt)) RXRS_SCI6_TEI6(void); void __attribute__ ((interrupt)) RXRS_SCI8_RXI8(void); void __attribute__ ((interrupt)) RXRS_SCI8_TXI8(void); void __attribute__ ((interrupt)) RXRS_SCI8_TEI8(void); void __attribute__ ((interrupt)) RXRS_SCI12_RXI12(void); void __attribute__ ((interrupt)) RXRS_SCI12_TXI12(void); void __attribute__ ((interrupt)) RXRS_SCI12_TEI12(void); |
//comment disabled struct { unsigned char MPBT:1; unsigned char MPB:1; unsigned char TEND:1; unsigned char PER:1; unsigned char FER:1; unsigned char ORER:1; unsigned char :2; } BIT; |
//comment disabled struct { unsigned char MPBT:1; unsigned char MPB:1; unsigned char TEND:1; unsigned char PER:1; unsigned char FER:1; unsigned char ORER:1; unsigned char :2; } BIT; |
#include "rxrslib.h" |
#include <rxduino.h> // e2studioの場合は #include <Arduino.h> #include "rxrslib.h" int ncom=0; void setup() { pinMode(PIN_SW,INPUT); //青ボタン使用 pinMode(PIN_LED0,OUTPUT); //LED0使用 RXRS_Open(ncom,12); //brr=12 -> 230769.2 bps } int n,led,t0; void loop() { if(millis()-t0 >= 200){ while(RXRS_CheckSend(ncom)<7); RXRS_Printf(ncom,"%05d\r\n",n++); t0= millis(); digitalWrite(PIN_LED0, led); led=1-led; } //青ボタン処理 if(!digitalRead(PIN_SW)){ while(RXRS_CheckSend(ncom)<13); RXRS_Puts(ncom,"Blue button"); } //受信処理 while(RXRS_CheckRecv(ncom)){ int c; c= RXRS_Getc(ncom); RXRS_Putc(ncom,c); } } |
brr ->ボーレート[bps] 0 ->3000000.0 [bps] 1 ->1500000.0 [bps] 2 ->1000000.0 [bps] 3 -> 750000.0 [bps] 4 -> 600000.0 [bps] 5 -> 500000.0 [bps] 6 -> 428571.4 [bps] 7 -> 375000.0 [bps] 8 -> 333333.3 [bps] 9 -> 300000.0 [bps] 10 -> 272727.3 [bps] 11 -> 250000.0 [bps] 12 -> 230769.2 [bps] 25 -> 115384.6 [bps] 51 -> 57692.3 [bps] 77 -> 38461.5 [bps] 95 -> 31250.0 [bps] 155 -> 19230.8 [bps] |
SCI0: P21(IO0) =RXD, P20(IO1) =TXD SCI1: P30(CN6-6)=RXD, P26(CN6-3)=TXD ※ SCI2: P12(IO30) =RXD, P13(IO31) =TXD SCI3: P25(IO5) =RXD, P23(IO3) =TXD SCI5: PC2(IO8) =RXD, PC3(IO9) =TXD SCI6: P33(IO7) =RXD, P32(IO6) =TXD SCI8: PC6(IO11) =RXD, PC7(IO12) =TXD SCI12: PE2(IO46) =RXD, PE1(IO45) =TXD |
// SCI0で P33(IO7)=RXD, P32(IO6)=TXDを使うとき #define SCI0_RXDTXD_P33P32 // SCI2で P52(IO26)=RXD, P50(IO24)=TXDを使うとき #define SCI2_RXDTXD_P52P50 |
#define RXRS_RECVBUFFERSIZE0 50 #define RXRS_RECVBUFFERSIZE1 40 #define RXRS_RECVBUFFERSIZE12 30 #define RXRS_SENDBUFFERSIZE2 30 #define RXRS_SENDBUFFERSIZE3 40 #define RXRS_SENDBUFFERSIZE8 50 #define SCI0_PARITY_EVEN #define SCI0_STOP_2 #define SCI0_DATA_7 #define SCI1_PARITY_ODD #define SCI0_RXDTXD_P33P32 #define SCI2_RXDTXD_P52P50 #define RXRS_PRINTF_BUFFERSIZE 512 #include "rxrslib.h" |