32 #ifndef _SSD1306_UART_H_ 33 #define _SSD1306_UART_H_ 36 #ifndef CONFIG_AVR_UART_AVAILABLE 40 #if defined(CONFIG_AVR_UART_AVAILABLE) && defined(CONFIG_AVR_UART_ENABLE) 49 #define UART_BUFFER_RX 32 // :( Still need large buffer to process USART RX bytes 51 #ifndef DOXYGEN_SHOULD_SKIP_THIS 52 extern volatile uint8_t g_uart_put_ptr;
54 extern volatile uint8_t g_uart_buf[];
56 void uart_init_internal(uint32_t baud, uint8_t interrupt);
70 #ifdef UART_INTERRUPT_ENABLE 71 uart_init_internal(baud, 1);
73 uart_init_internal(baud, 0);
102 #ifndef DOXYGEN_SHOULD_SKIP_THIS 103 static inline void __uart_read_byte(
void)
105 g_uart_buf[g_uart_put_ptr] = UDR0;
110 #ifdef UART_INTERRUPT_ENABLE 112 ISR(USART_RX_vect, ISR_BLOCK)
114 if (bit_is_clear(UCSR0A, FE0))
120 volatile unsigned char data __attribute__((unused)) = UDR0;
125 #endif // DOXYGEN_SHOULD_SKIP_THIS
static void uart_init(uint32_t baud)
Initializes uart module.
uint8_t uart_read_byte(void)
Reads byte from UART RX buffer.
uint8_t uart_byte_available(void)
Returns non-zero code if there are bytes in RX buffer.
void uart_send_byte(uint8_t c)
Sends single byte over UART.