NEORV32 Software Framework Documentation
The NEORV32 RISC-V Processor
Loading...
Searching...
No Matches
neorv32_sdi.c File Reference

Serial data interface controller (SDI) HW driver source file. More...

#include <neorv32.h>

Functions

int neorv32_sdi_available (void)
 
void neorv32_sdi_setup (uint32_t irq_mask)
 
void neorv32_sdi_disable (void)
 
void neorv32_sdi_enable (void)
 
int neorv32_sdi_get_fifo_depth (void)
 
void neorv32_sdi_put (uint8_t data)
 
uint8_t neorv32_sdi_get (void)
 
void neorv32_sdi_put_nonblocking (uint8_t data)
 
uint8_t neorv32_sdi_get_nonblocking (void)
 
void neorv32_sdi_rx_clear (void)
 
void neorv32_sdi_tx_clear (void)
 
int neorv32_sdi_check_cs (void)
 
Prototypes
int neorv32_sdi_rx_empty (void)
 
int neorv32_sdi_rx_full (void)
 
int neorv32_sdi_tx_empty (void)
 
int neorv32_sdi_tx_full (void)
 

Detailed Description

Serial data interface controller (SDI) HW driver source file.

Function Documentation

◆ neorv32_sdi_available()

int neorv32_sdi_available ( void )

Check if SDI unit was synthesized.

Returns
0 if SDI was not synthesized, non-zero if SPI is available.

◆ neorv32_sdi_check_cs()

int neorv32_sdi_check_cs ( void )

Get status of chip-select line.

Returns
Non-zero if chip-select line is enabled/active (driven low), zero otherwise.

◆ neorv32_sdi_disable()

void neorv32_sdi_disable ( void )

Disable SDI controller.

◆ neorv32_sdi_enable()

void neorv32_sdi_enable ( void )

Enable SDI controller.

◆ neorv32_sdi_get()

uint8_t neorv32_sdi_get ( void )

Get data from SDI input FIFO (blocking).

Returns
Data byte read from RX FIFO.

◆ neorv32_sdi_get_fifo_depth()

int neorv32_sdi_get_fifo_depth ( void )

Get SDI FIFO depth.

Returns
FIFO depth (number of entries).

◆ neorv32_sdi_get_nonblocking()

uint8_t neorv32_sdi_get_nonblocking ( void )

Get data from SDI input FIFO (non-blocking).

Returns
Data byte read from RX FIFO.

◆ neorv32_sdi_put()

void neorv32_sdi_put ( uint8_t data)

Push data to SDI output FIFO (blocking).

Parameters
[in]dataByte to push into TX FIFO.

◆ neorv32_sdi_put_nonblocking()

void neorv32_sdi_put_nonblocking ( uint8_t data)

Push data to SDI output FIFO (non-blocking).

Parameters
[in]dataByte to push into TX FIFO.

◆ neorv32_sdi_rx_clear()

void neorv32_sdi_rx_clear ( void )

Clear RX FIFO.

◆ neorv32_sdi_rx_empty()

int neorv32_sdi_rx_empty ( void )

Check if RX FIFO is empty.

Returns
Zero if RX FIFO is not empty, non-zero if RX FIFO is empty.

◆ neorv32_sdi_rx_full()

int neorv32_sdi_rx_full ( void )

Check if RX FIFO is full.

Returns
Zero if RX FIFO is not full, non-zero if RX FIFO is full.

◆ neorv32_sdi_setup()

void neorv32_sdi_setup ( uint32_t irq_mask)

Reset, enable and configure SDI controller. The SDI control register bits are listed in NEORV32_SDI_CTRL_enum.

Parameters
[in]irq_maskInterrupt configuration bit mask (CTRL's irq_* bits).

◆ neorv32_sdi_tx_clear()

void neorv32_sdi_tx_clear ( void )

Clear TX FIFO.

◆ neorv32_sdi_tx_empty()

int neorv32_sdi_tx_empty ( void )

Check if TX FIFO is empty.

Returns
Zero if RX FIFO is not empty, non-zero if RX FIFO is empty.

◆ neorv32_sdi_tx_full()

int neorv32_sdi_tx_full ( void )

Check if TX FIFO is full.

Returns
Zero if TX FIFO is not full, non-zero if TX FIFO is full.