NEORV32 - Software Framework Documentation
Loading...
Searching...
No Matches
Functions
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 irq_config)
 
void neorv32_slink_enable (void)
 
void neorv32_slink_disable (void)
 
int neorv32_slink_get_link_num (int sel)
 
int neorv32_slink_get_fifo_depth (int sel)
 
int neorv32_slink_tx (int link_id, uint32_t tx_data, int last)
 
int neorv32_slink_rx (int link_id, uint32_t *rx_data)
 

Detailed Description

Stream Link Interface HW driver source file.

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_disable()

void neorv32_slink_disable ( void  )

Deactivate stream link interface.

Note
This will also clear all link FIFOs.

◆ neorv32_slink_enable()

void neorv32_slink_enable ( void  )

Activate stream link interface.

◆ neorv32_slink_get_fifo_depth()

int neorv32_slink_get_fifo_depth ( int  sel)

Get FIFO depth of RX/TX links

Parameters
[in]sel=0 -> RX, =!0 -> TX
Returns
FIFO depth of RX/TX links (1..32768); 0 if no RX/TX links implemented.

◆ neorv32_slink_get_link_num()

int neorv32_slink_get_link_num ( int  sel)

Get number of implemented RX/TX links

Parameters
[in]sel=0 -> RX, =!0 -> TX
Returns
Number of implemented RX/TX links (0..8).

◆ neorv32_slink_rx()

int neorv32_slink_rx ( int  link_id,
uint32_t *  rx_data 
)

Read data from RX stream link i (non-blocking)

Parameters
[in]link_idLink ID (0..7).
[in]rx_dataPointer for received data.
Returns
0 if data was received, -1 if no data available, +1 if data was received and data was marked as "end of packet".

◆ neorv32_slink_setup()

void neorv32_slink_setup ( uint32_t  irq_config)

Reset and enable SLINK.

Parameters
[in]irq_configConfigure RX and TX interrupts per link (NEORV32_SLINK_IRQ_enum).

◆ neorv32_slink_tx()

int neorv32_slink_tx ( int  link_id,
uint32_t  tx_data,
int  last 
)

Write data to TX stream link i (non-blocking)

Parameters
[in]link_idLink ID (0..7).
[in]tx_dataData to send to link.
[in]lastSet to 1 to indicate this is the "end of packet".
Returns
0 if data was send, -1 if link is still busy (FIFO full)