39 #ifndef NIBOBEE_USART_H_
40 #define NIBOBEE_USART_H_
43 #include <avr/pgmspace.h>
49 #define USART_TXBUF_SIZE 16
50 #define USART_RXBUF_SIZE 8
57 extern uint8_t usart_txbuf[USART_TXBUF_SIZE];
58 extern uint8_t usart_rxbuf[USART_RXBUF_SIZE];
60 extern volatile uint8_t usart_txbuf_begin;
61 extern volatile uint8_t usart_txbuf_end;
63 extern volatile uint8_t usart_rxbuf_begin;
64 extern volatile uint8_t usart_rxbuf_end;
109 void usart_send(
const char * s,
unsigned int len);
123 static inline char usart_rxempty() {
124 return usart_rxbuf_begin==usart_rxbuf_end;
131 static inline char usart_txempty() {
132 return usart_txbuf_begin==usart_txbuf_end;
139 static inline char usart_rxfull() {
140 return usart_rxbuf_end==USART_RXBUF_SIZE;
147 static inline char usart_txfull() {
148 return usart_txbuf_end==USART_TXBUF_SIZE;
156 #endif // NIBOBEE_USART_H_
void usart_send_P(PGM_P s, unsigned int len)
void usart_send(const char *s, unsigned int len)
void usart_write(const char *s)
char usart_putchar(char c)
void usart_setbaudrate(uint16_t baud)
void usart_write_P(PGM_P s)