/*
 * uart7.h
 *
 *  Created on: Sep 17, 2021
 *      Author: thomm
 */

#ifndef PHFETSOS_UART7_H_
#define PHFETSOS_UART7_H_

#if BOARD_MSC == 3
#define UART7_RX_BUFFER_SIZE     16     //128
#define UART7_TX_BUFFER_SIZE     16     //128
#else
#define UART7_RX_BUFFER_SIZE     128
#define UART7_TX_BUFFER_SIZE     128
#endif

// get is blocking

void uart7_init(void);
void uart7_setup(uint32_t ui32Baud, uint32_t ui32SrcClock);

int uart7_write(const char *pcBuf, uint32_t ui32Len);
int uart7_rx_str(char *pcBuf, uint32_t ui32Len);

unsigned char uart7_rx_byte(void);
int uart7_tx_byte(unsigned char c);

int uart7_rx_bytes_avail(void);
int uart7_tx_bufr_bytes_free(void);
int uart7_rx_bufr_peek(unsigned char ucChar);
void uart7_rx_bufr_flush(void);
void uart7_tx_bufr_flush(bool bDiscard);

void uart7_echo_set(bool bEnable);

void uart7_isr(void);           // plug this into interrupt table in tm4c123gh6pge_startup_ccs.c



#endif /* PHFETSOS_UART7_H_ */
