class HardwareSerial:publicStream{protected:volatileuint8_t*const_ubrrh;volatileuint8_t*const_ubrrl;volatileuint8_t*const_ucsra;volatileuint8_t*const_ucsrb;volatileuint8_t*const_ucsrc;volatileuint8_t*const_udr;// Has any byte been written to the UART since begin()
bool_written;volatilerx_buffer_index_t_rx_buffer_head;volatilerx_buffer_index_t_rx_buffer_tail;volatiletx_buffer_index_t_tx_buffer_head;volatiletx_buffer_index_t_tx_buffer_tail;// Don't put any members after these buffers, since only the first
// 32 bytes of this struct can be accessed quickly using the ldd
// instruction.
unsignedchar_rx_buffer[SERIAL_RX_BUFFER_SIZE];unsignedchar_tx_buffer[SERIAL_TX_BUFFER_SIZE];public:inlineHardwareSerial(volatileuint8_t*ubrrh,volatileuint8_t*ubrrl,volatileuint8_t*ucsra,volatileuint8_t*ucsrb,volatileuint8_t*ucsrc,volatileuint8_t*udr);voidbegin(unsignedlongbaud){begin(baud,SERIAL_8N1);}voidbegin(unsignedlong,uint8_t);voidend();virtualintavailable(void);virtualintpeek(void);virtualintread(void);intavailableForWrite(void);virtualvoidflush(void);virtualsize_twrite(uint8_t);inlinesize_twrite(unsignedlongn){returnwrite((uint8_t)n);}inlinesize_twrite(longn){returnwrite((uint8_t)n);}inlinesize_twrite(unsignedintn){returnwrite((uint8_t)n);}inlinesize_twrite(intn){returnwrite((uint8_t)n);}usingPrint::write;// pull in write(str) and write(buf, size) from Print
operatorbool(){returntrue;}// Interrupt handlers - Not intended to be called externally
inlinevoid_rx_complete_irq(void);void_tx_udr_empty_irq(void);};