sw_fifo_1.h 1.2 KB

12345678910111213141516171819202122232425262728293031
  1. #ifndef __SW_FIFO_1__
  2. #define __SW_FIFO_1__
  3. #include <stdint.h>
  4. #define FIFO_1_BUFFER_SIZE 3096 // software buffer size (in bytes)
  5. // UART data receive function
  6. // - checks if data exists in the receive sw buffer
  7. // - if data exists, it returns the oldest element contained in the buffer
  8. // - automatically handles "uart_rx_buffer_full_flag"
  9. // - if no data exists, it clears the uart_rx_flag
  10. uint8_t uart_1_get_byte(void);
  11. volatile extern uint8_t uart1_rx_fifo_not_empty_flag; // this flag is automatically set and cleared by the software buffer
  12. volatile extern uint8_t uart1_rx_fifo_full_flag; // this flag is automatically set and cleared by the software buffer
  13. volatile extern uint8_t uart1_rx_fifo_ovf_flag; // this flag is not automatically cleared by the software buffer
  14. volatile extern uint8_t uart1_tx_fifo_full_flag; // this flag is automatically set and cleared by the software buffer
  15. volatile extern uint8_t uart1_tx_fifo_ovf_flag; // this flag is not automatically cleared by the software buffer
  16. volatile extern uint8_t uart1_tx_fifo_not_empty_flag; // this flag is automatically set and cleared by the software buffer
  17. void uart1Interrupt(void);
  18. int uart1serialAvailable();
  19. void send_usart1(unsigned char c);
  20. #endif