RV32 SoC DS UG
High-Perf RV32 SoC DS UG
RV64 SoC DS UG API and Examples
Embedded IDE UG
Loading...
Searching...
No Matches
uart.h File Reference
#include "type.h"
#include "io.h"

Go to the source code of this file.

Overview

UART driver API definitions.

Author
Efinix Inc

This file provides data structures and APIs for controlling the UART peripheral on the EfxSapphireSoC platform.

Definition in file uart.h.

Data Structures

struct  uart_hwreg_t
 UART hardware register map. More...
struct  uart_instance_t
 UART instance. Holds the software registers and hardware pointer. More...

Enumerations

enum  cfg_dataLength_t { BITS_6 = 6 , BITS_7 = 7 , BITS_8 = 8 }
 UART data Length. More...
enum  cfg_dataParity_t { NONE = 0 , EVEN = 1 , ODD = 2 }
 UART data Parity. More...
enum  cfg_stopBits_t { ONE = 0 , TWO = 1 }
 UART Stop Bits. More...

Functions

u32 uart_read (uart_instance_t *inst)
 Read 32-bit UART data.
u32 uart_readStatus (uart_instance_t *inst)
 Write 32-bit UART data.
u32 uart_getReadOccupancy (uart_instance_t *inst)
 Get the occupancy of the UART buffer for reading data.
u32 uart_getWriteAvailability (uart_instance_t *inst)
 Get the availability of the UART buffer for writing data.
void uart_applyConfig (uart_instance_t *inst)
 Apply stored UART configuration to hardware.
void uart_write (uart_instance_t *inst, char data)
 Writes a single character to the UART data register.
void uart_writeStr (uart_instance_t *inst, const char *str)
 Write string to UART.
void uart_writeHex (uart_instance_t *inst, int value)
 Write integer as decimal to UART.
void uart_writeStatus (uart_instance_t *inst, u32 data)
 Writes a value to the UART status register.
void uart_setTxInterruptEnable (uart_instance_t *inst, char Ena)
 Enable or Disable UART TX Empty Interrupt.
void uart_setRxInterruptEnable (uart_instance_t *inst, char Ena)
 Enable or Disable UART RX Not Empty Interrupt.