24 #if defined(BOARD_ATTINY) 31 #include <avr/power.h> 39 UART __attribute__ ((weak))
uart(0, &ibuf, &obuf);
51 uint16_t setting = ((F_CPU / 4 / baudrate) - 1) / 2;
53 setting = ((F_CPU / 8 / baudrate) - 1) / 2;
86 #define USE_FAST_TRACK 92 #define USE_SYNC_DELAY 100 #if defined(USE_FAST_TRACK) 107 #if defined(USE_SYNC_DELAY) 153 #if defined(power_usart0_enable) 155 power_usart0_enable();
158 #if defined(power_usart1_enable) 160 power_usart1_enable();
163 #if defined(power_usart2_enable) 165 power_usart2_enable();
168 #if defined(power_usart3_enable) 170 power_usart3_enable();
182 #if defined(power_usart0_disable) 184 power_usart0_disable();
187 #if defined(power_usart1_disable) 189 power_usart1_disable();
192 #if defined(power_usart2_disable) 194 power_usart2_disable();
197 #if defined(power_usart3_disable) 199 power_usart3_disable();
226 #define UART_ISR(vec,nr) \ 227 ISR(vec ## _UDRE_vect) \ 229 if (UNLIKELY(UART::uart[nr] == NULL)) return; \ 230 UART::uart[nr]->on_udre_interrupt(); \ 233 ISR(vec ## _RX_vect) \ 235 if (UNLIKELY(UART::uart[nr] == NULL)) return; \ 236 UART::uart[nr]->on_rx_interrupt(); \ 239 #if defined(USART_UDRE_vect) 242 #if defined(USART1_UDRE_vect) 245 #if defined(USART2_UDRE_vect) 248 #if defined(USART3_UDRE_vect)
virtual int putchar(char c)
IOStream::Device * m_obuf
Output Buffer/Device.
volatile uint8_t * UCSRnA() const
volatile uint8_t * UCSRnC() const
virtual bool begin(uint32_t baudrate=DEFAULT_BAUDRATE, uint8_t format=DEFAULT_FORMAT)
bool m_idle
Flag idle mode.
static UART * uart[Board::UART_MAX]
volatile uint16_t * UBRRn() const
virtual void on_udre_interrupt()
static IOBuffer< UART::TX_BUFFER_MAX > obuf
IOStream::Device * m_ibuf
Input Buffer/Device.
virtual void on_rx_interrupt()
#define UART_ISR(vec, nr)
static IOBuffer< UART::RX_BUFFER_MAX > ibuf
uint8_t m_port
UART port index.
volatile uint8_t * UCSRnB() const
volatile uint8_t * UDRn() const
virtual int putchar(char c)