46 #ifndef NIBOBURGER_USART_H_
47 #define NIBOBURGER_USART_H_
50 #include <avr/pgmspace.h>
60 #define USART_TXBUF_SIZE 16
66 #define USART_RXBUF_SIZE 8
73 extern volatile uint8_t usart_txbuf_begin;
74 extern volatile uint8_t usart_txbuf_end;
76 extern volatile uint8_t usart_rxbuf_begin;
77 extern volatile uint8_t usart_rxbuf_end;
143 void usart_send(
const char * s,
unsigned int len);
161 static inline char usart_rxempty() {
162 return usart_rxbuf_begin==usart_rxbuf_end;
169 static inline char usart_txempty() {
170 return usart_txbuf_begin==usart_txbuf_end;
177 static inline char usart_rxfull() {
185 static inline char usart_txfull() {
193 static inline char usart_rxavail() {
195 int s=(int)usart_rxbuf_end-(
int)usart_rxbuf_begin;
204 static inline char usart_txfree() {
206 int s=(int)usart_txbuf_end-(
int)usart_txbuf_begin;
207 if (usart_txfull())
return 0;
216 #endif // NIBOBURGER_USART_H_
void usart_send_P(PGM_P s, unsigned int len)
void usart_send(const char *s, unsigned int len)
#define USART_TXBUF_SIZE
Definition: usart.h:60
void usart_write(const char *s)
char usart_putchar(char c)
void usart_setbaudrate(uint16_t baud)
void usart_write_P(PGM_P s)
#define USART_RXBUF_SIZE
Definition: usart.h:66