X-Git-Url: https://git.gag.com/?p=fw%2Faltos;a=blobdiff_plain;f=src%2Fsamd21%2Fao_serial.h;h=1120f65f567219e69b932b922b9ba1111cb17e02;hp=440b562b0b26e5c00ad3bf2ca8b22093b51e5d54;hb=f3d95af6866018bf8d472bae192907efcbe5aaa1;hpb=a06c84a27bd760039c522460f79bfe242d2d22c8 diff --git a/src/samd21/ao_serial.h b/src/samd21/ao_serial.h index 440b562b..1120f65f 100644 --- a/src/samd21/ao_serial.h +++ b/src/samd21/ao_serial.h @@ -26,8 +26,7 @@ #define AO_SERIAL_SPEED_115200 4 #if HAS_SERIAL_0 -extern volatile struct ao_fifo ao_serial0_rx_fifo; -extern volatile struct ao_fifo ao_serial0_tx_fifo; +extern struct ao_samd21_usart ao_samd21_usart0; char ao_serial0_getchar(void); @@ -49,8 +48,7 @@ ao_serial0_set_speed(uint8_t speed); #endif #if HAS_SERIAL_1 -extern volatile struct ao_fifo ao_serial1_rx_fifo; -extern volatile struct ao_fifo ao_serial1_tx_fifo; +extern struct ao_samd21_usart ao_samd21_usart1; char ao_serial1_getchar(void); @@ -72,8 +70,7 @@ ao_serial1_set_speed(uint8_t speed); #endif #if HAS_SERIAL_2 -extern volatile struct ao_fifo ao_serial2_rx_fifo; -extern volatile struct ao_fifo ao_serial2_tx_fifo; +extern struct ao_samd21_usart ao_samd21_usart2; char ao_serial2_getchar(void); @@ -95,8 +92,7 @@ ao_serial2_set_speed(uint8_t speed); #endif #if HAS_SERIAL_3 -extern volatile struct ao_fifo ao_serial3_rx_fifo; -extern volatile struct ao_fifo ao_serial3_tx_fifo; +extern struct ao_samd21_usart ao_samd21_usart3; char ao_serial3_getchar(void); @@ -117,6 +113,50 @@ void ao_serial3_set_speed(uint8_t speed); #endif +#if HAS_SERIAL_4 +extern struct ao_samd21_usart ao_samd21_usart4; + +char +ao_serial4_getchar(void); + +int +_ao_serial4_pollchar(void); + +uint8_t +_ao_serial4_sleep_for(uint16_t timeout); + +void +ao_serial4_putchar(char c); + +void +ao_serial4_drain(void); + +void +ao_serial4_set_speed(uint8_t speed); +#endif + +#if HAS_SERIAL_5 +extern struct ao_samd21_usart ao_samd21_usart5; + +char +ao_serial5_getchar(void); + +int +_ao_serial5_pollchar(void); + +uint8_t +_ao_serial5_sleep_for(uint16_t timeout); + +void +ao_serial5_putchar(char c); + +void +ao_serial5_drain(void); + +void +ao_serial5_set_speed(uint8_t speed); +#endif + void ao_serial_init(void);