diff options
author | Karel Kočí <cynerd@email.cz> | 2015-10-11 13:33:40 +0200 |
---|---|---|
committer | Karel Kočí <cynerd@email.cz> | 2015-10-11 13:33:40 +0200 |
commit | 861ed124caf5a403748c948b88afa4ef89cc1787 (patch) | |
tree | adf25c1873549c22a93ee4308c0a40361c0e22b3 /usart.h | |
parent | c7c4a803c23829093914970af1e2336f261d66fa (diff) | |
download | avr-ioe-861ed124caf5a403748c948b88afa4ef89cc1787.tar.gz avr-ioe-861ed124caf5a403748c948b88afa4ef89cc1787.tar.bz2 avr-ioe-861ed124caf5a403748c948b88afa4ef89cc1787.zip |
Add USART FILE interface
! NOT TESTED !
Diffstat (limited to 'usart.h')
-rw-r--r-- | usart.h | 11 |
1 files changed, 11 insertions, 0 deletions
@@ -1,6 +1,7 @@ #include <avr/io.h> #include <avr/interrupt.h> #include <stdint.h> +#include <stdio.h> #include "mcu/mcu_def.h" #include "buffers.h" @@ -51,6 +52,13 @@ enum usartDataBits { #define USART_DATAOVERRUN _BV(DOR0) #define USART_PARITYERROR _BV(UPE0) +#if (defined CONFIG_IOE_USART_INFILE) && (CONFIG_IOE_USART_INBUFFER_SIZE <= 0) +#error "USART Input file can't be enabled without input buffer" +#endif +#if (defined CONFIG_IOE_USART_OUTFILE) && (CONFIG_IOE_USART_OUTBUFFER_SIZE <= 0) +#error "USART Input file can't be enabled without output buffer" +#endif + #if CONFIG_IOE_USART_INBUFFER_SIZE > 0 #define _IOE_USART_INBUFFER volatile IOEBUFFER(_ioe_usart_inbuffer, CONFIG_IOE_USART_INBUFFER_SIZE); @@ -85,6 +93,9 @@ uint8_t usart_inbuffered(void); #ifdef _IOE_USART_OUTBUFFER uint8_t usart_outbuffered(void); #endif +#if (defined CONFIG_IOE_USART_INFILE) || (defined CONFIG_IOE_USART_OUTFILE) +FILE *spi_open(void); +#endif // Following function must be user defined if relevant buffers not used. extern void (*usart_receive)(uint8_t data); |