NEORV32 - Software Framework Documentation
Loading...
Searching...
No Matches
neorv32_slink.c File Reference

Stream Link Interface HW driver source file. More...

#include "neorv32.h"
#include "neorv32_slink.h"

Functions

int neorv32_slink_available (void)
 
void neorv32_slink_setup (uint32_t rx_irq, uint32_t tx_irq)
 
void neorv32_slink_rx_clear (void)
 
void neorv32_slink_tx_clear (void)
 
int neorv32_slink_get_rx_fifo_depth (void)
 
int neorv32_slink_get_tx_fifo_depth (void)
 
uint32_t neorv32_slink_get (void)
 
uint32_t neorv32_slink_check_last (void)
 
void neorv32_slink_set_dst (uint32_t dst)
 
uint32_t neorv32_slink_get_src (void)
 
void neorv32_slink_put (uint32_t tx_data)
 
void neorv32_slink_put_last (uint32_t tx_data)
 
int neorv32_slink_rx_status (void)
 
int neorv32_slink_tx_status (void)
 

Detailed Description

Stream Link Interface HW driver source file.

Note
These functions should only be used if the SLINK unit was synthesized (IO_SLINK_EN = true).
See also
https://stnolting.github.io/neorv32/sw/files.html

Function Documentation

◆ neorv32_slink_available()

int neorv32_slink_available ( void )

Check if stream link interface was synthesized.

Returns
0 if SLINK was not synthesized, 1 if SLINK is available.

◆ neorv32_slink_check_last()

uint32_t neorv32_slink_check_last ( void )
inline

Check if last RX word has "end-of-stream" delimiter.

Note
This needs has to be called AFTER reading the actual data word using neorv32_slink_get(void).
Returns
0 if not end of stream, !=0 if end of stream.

◆ neorv32_slink_get()

uint32_t neorv32_slink_get ( void )
inline

Read data from RX link (non-blocking)

Returns
Data received from link.

◆ neorv32_slink_get_rx_fifo_depth()

int neorv32_slink_get_rx_fifo_depth ( void )

Get FIFO depth of RX link.

Returns
FIFO depth of RX link (1..32768).

◆ neorv32_slink_get_src()

uint32_t neorv32_slink_get_src ( void )
inline

Get RX link routing source

Note
This needs has to be called AFTER reading the actual data word using neorv32_slink_get(void).
Returns
4-bit source routing ID.

◆ neorv32_slink_get_tx_fifo_depth()

int neorv32_slink_get_tx_fifo_depth ( void )

Get FIFO depth of TX link.

Returns
FIFO depth of TX link (1..32768).

◆ neorv32_slink_put()

void neorv32_slink_put ( uint32_t tx_data)
inline

Write data to TX link (non-blocking)

Parameters
[in]tx_dataData to send to link.

◆ neorv32_slink_put_last()

void neorv32_slink_put_last ( uint32_t tx_data)
inline

Write data to TX link (non-blocking) and set "last" (end-of-stream) delimiter.

Parameters
[in]tx_dataData to send to link.

◆ neorv32_slink_rx_clear()

void neorv32_slink_rx_clear ( void )

Clear RX FIFO.

◆ neorv32_slink_rx_status()

int neorv32_slink_rx_status ( void )

Get RX link FIFO status.

Returns
FIFO status NEORV32_SLINK_STATUS_enum.

◆ neorv32_slink_set_dst()

void neorv32_slink_set_dst ( uint32_t dst)
inline

Set TX link routing destination

Parameters
[in]dstRouting destination ID (4-bit, LSB-aligned).

◆ neorv32_slink_setup()

void neorv32_slink_setup ( uint32_t rx_irq,
uint32_t tx_irq )

Reset, enable and configure SLINK.

Parameters
[in]rx_irqConfigure RX interrupt conditions (NEORV32_SLINK_CTRL_enum).
[in]tx_irqConfigure TX interrupt conditions (NEORV32_SLINK_CTRL_enum).

◆ neorv32_slink_tx_clear()

void neorv32_slink_tx_clear ( void )

Clear TX FIFO.

◆ neorv32_slink_tx_status()

int neorv32_slink_tx_status ( void )

Get TX link FIFO status.

Returns
FIFO status NEORV32_SLINK_STATUS_enum.