24 #ifndef HardwareSerial_h 25 #define HardwareSerial_h 42 #if !defined(SERIAL_TX_BUFFER_SIZE) 43 #if ((RAMEND - RAMSTART) < 1023) 44 #define SERIAL_TX_BUFFER_SIZE 16 46 #define SERIAL_TX_BUFFER_SIZE 64 49 #if !defined(SERIAL_RX_BUFFER_SIZE) 50 #if ((RAMEND - RAMSTART) < 1023) 51 #define SERIAL_RX_BUFFER_SIZE 16 53 #define SERIAL_RX_BUFFER_SIZE 64 56 #if (SERIAL_TX_BUFFER_SIZE>256) 61 #if (SERIAL_RX_BUFFER_SIZE>256) 68 #define SERIAL_5N1 0x00 69 #define SERIAL_6N1 0x02 70 #define SERIAL_7N1 0x04 71 #define SERIAL_8N1 0x06 72 #define SERIAL_5N2 0x08 73 #define SERIAL_6N2 0x0A 74 #define SERIAL_7N2 0x0C 75 #define SERIAL_8N2 0x0E 76 #define SERIAL_5E1 0x20 77 #define SERIAL_6E1 0x22 78 #define SERIAL_7E1 0x24 79 #define SERIAL_8E1 0x26 80 #define SERIAL_5E2 0x28 81 #define SERIAL_6E2 0x2A 82 #define SERIAL_7E2 0x2C 83 #define SERIAL_8E2 0x2E 84 #define SERIAL_5O1 0x30 85 #define SERIAL_6O1 0x32 86 #define SERIAL_7O1 0x34 87 #define SERIAL_8O1 0x36 88 #define SERIAL_5O2 0x38 89 #define SERIAL_6O2 0x3A 90 #define SERIAL_7O2 0x3C 91 #define SERIAL_8O2 0x3E 118 volatile uint8_t *ubrrh,
volatile uint8_t *ubrrl,
119 volatile uint8_t *ucsra,
volatile uint8_t *ucsrb,
120 volatile uint8_t *ucsrc,
volatile uint8_t *udr);
122 void begin(
unsigned long, uint8_t);
125 virtual int peek(
void);
126 virtual int read(
void);
128 virtual void flush(
void);
129 virtual size_t write(uint8_t);
130 inline size_t write(
unsigned long n) {
return write((uint8_t)n); }
135 operator bool() {
return true; }
142 #if defined(UBRRH) || defined(UBRR0H) 144 #define HAVE_HWSERIAL0 148 #define HAVE_HWSERIAL1 152 #define HAVE_HWSERIAL2 156 #define HAVE_HWSERIAL3 volatile uint8_t *const _ucsrb
virtual size_t write(uint8_t)
virtual size_t write(uint8_t)=0
volatile rx_buffer_index_t _rx_buffer_head
volatile uint8_t *const _ubrrh
volatile tx_buffer_index_t _tx_buffer_head
volatile uint8_t *const _ucsrc
uint8_t rx_buffer_index_t
virtual int availableForWrite(void)
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)
#define SERIAL_TX_BUFFER_SIZE
virtual int available(void)
volatile rx_buffer_index_t _rx_buffer_tail
void _rx_complete_irq(void)
rp::arch::net::raw_serial __attribute__
size_t write(unsigned long n)
#define SERIAL_RX_BUFFER_SIZE
void serialEventRun(void) __attribute__((weak))
volatile tx_buffer_index_t _tx_buffer_tail
uint8_t tx_buffer_index_t
unsigned char _rx_buffer[SERIAL_RX_BUFFER_SIZE]
volatile uint8_t *const _udr
volatile uint8_t *const _ubrrl
unsigned char _tx_buffer[SERIAL_TX_BUFFER_SIZE]
size_t write(unsigned int n)
void _tx_udr_empty_irq(void)
volatile uint8_t *const _ucsra
void begin(unsigned long baud)