28 #if defined(HAVE_HWSERIAL0) || defined(HAVE_HWSERIAL1) || defined(HAVE_HWSERIAL2) || defined(HAVE_HWSERIAL3) 39 #if !defined(UPE) && defined(PE) 62 #error No UART found in HardwareSerial.cpp 64 #endif // !defined TXC0 69 #if defined(TXC1) && (TXC1 != TXC0 || RXEN1 != RXEN0 || RXCIE1 != RXCIE0 || \ 70 UDRIE1 != UDRIE0 || U2X1 != U2X0 || UPE1 != UPE0 || \ 72 #error "Not all bit positions for UART1 are the same as for UART0" 74 #if defined(TXC2) && (TXC2 != TXC0 || RXEN2 != RXEN0 || RXCIE2 != RXCIE0 || \ 75 UDRIE2 != UDRIE0 || U2X2 != U2X0 || UPE2 != UPE0 || \ 77 #error "Not all bit positions for UART2 are the same as for UART0" 79 #if defined(TXC3) && (TXC3 != TXC0 || RXEN3 != RXEN0 || RXCIE3 != RXCIE0 || \ 80 UDRIE3 != UDRIE0 || U3X3 != U3X0 || UPE3 != UPE0 || \ 82 #error "Not all bit positions for UART3 are the same as for UART0" 88 volatile uint8_t *ubrrh,
volatile uint8_t *ubrrl,
89 volatile uint8_t *ucsra,
volatile uint8_t *ucsrb,
90 volatile uint8_t *ucsrc,
volatile uint8_t *udr) :
91 _ubrrh(ubrrh), _ubrrl(ubrrl),
92 _ucsra(ucsra), _ucsrb(ucsrb), _ucsrc(ucsrc),
94 _rx_buffer_head(0), _rx_buffer_tail(0),
95 _tx_buffer_head(0), _tx_buffer_tail(0)
103 if (bit_is_clear(*
_ucsra, UPE0)) {
106 unsigned char c = *
_udr;
volatile rx_buffer_index_t _rx_buffer_head
uint8_t rx_buffer_index_t
HardwareSerial(volatile uint8_t *ubrrh, volatile uint8_t *ubrrl, volatile uint8_t *ucsra, volatile uint8_t *ucsrb, volatile uint8_t *ucsrc, volatile uint8_t *udr)
typedef int(WINAPI *PFNWGLRELEASEPBUFFERDCARBPROC)(HPBUFFERARB hPbuffer
volatile rx_buffer_index_t _rx_buffer_tail
void _rx_complete_irq(void)
#define SERIAL_RX_BUFFER_SIZE
unsigned char _rx_buffer[SERIAL_RX_BUFFER_SIZE]
volatile uint8_t *const _udr
volatile uint8_t *const _ucsra