Sapphire SoC DS Sapphire SoC UG Sapphire HP SoC DS Sapphire HP SoC UG RISC-V Embedded IDE UG Board Support Package
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_status_read (uart_instance_t *inst)
 Write 32-bit UART data.
u32 uart_readOccupancy (uart_instance_t *inst)
 Checks the occupancy of the UART buffer for reading data.
u32 uart_writeAvailability (uart_instance_t *inst)
 Checks 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_status_write (uart_instance_t *inst, u32 data)
 Writes a value to the UART status register.
void uart_TX_emptyInterruptEna (uart_instance_t *inst, char Ena)
 Enable or Disable UART TX Empty Interrupt.
void uart_RX_NotemptyInterruptEna (uart_instance_t *inst, char Ena)
 Enable or Disable UART RX Not Empty Interrupt.