12345678910111213141516171819202122232425262728293031 |
- #ifndef __SW_FIFO_2__
- #define __SW_FIFO_2__
- #include <stdint.h>
- #define FIFO_2_BUFFER_SIZE 512 // software buffer size (in bytes)
- // UART data receive function
- // - checks if data exists in the receive sw buffer
- // - if data exists, it returns the oldest element contained in the buffer
- // - automatically handles "uart_rx_buffer_full_flag"
- // - if no data exists, it clears the uart_rx_flag
- uint8_t uart_2_get_byte(void);
- volatile extern uint8_t uart2_rx_fifo_not_empty_flag; // this flag is automatically set and cleared by the software buffer
- volatile extern uint8_t uart2_rx_fifo_full_flag; // this flag is automatically set and cleared by the software buffer
- volatile extern uint8_t uart2_rx_fifo_ovf_flag; // this flag is not automatically cleared by the software buffer
- volatile extern uint8_t uart2_tx_fifo_full_flag; // this flag is automatically set and cleared by the software buffer
- volatile extern uint8_t uart2_tx_fifo_ovf_flag; // this flag is not automatically cleared by the software buffer
- volatile extern uint8_t uart2_tx_fifo_not_empty_flag; // this flag is automatically set and cleared by the software buffer
- void uart2Interrupt(void);
- int uart2serialAvailable();
- void send_usart2(unsigned char c);
- #endif
|