|
epio
A cycle-accurate RP2350 PIO emulator
|
Functions for interacting with PIO TX and RX FIFOs. More...
Functions | |
| EPIO_EXPORT int32_t | epio_wait_tx_fifo (epio_t *epio, uint8_t block, uint8_t sm, int32_t count) |
Wait for a maximum of count cycles until the TX FIFO of a state machine has an entry pushed to it. | |
| EPIO_EXPORT uint8_t | epio_tx_fifo_depth (epio_t *epio, uint8_t block, uint8_t sm) |
| Return the current number of entries in the TX FIFO. | |
| EPIO_EXPORT uint8_t | epio_rx_fifo_depth (epio_t *epio, uint8_t block, uint8_t sm) |
| Return the current number of entries in the RX FIFO. | |
| EPIO_EXPORT uint32_t | epio_pop_rx_fifo (epio_t *epio, uint8_t block, uint8_t sm) |
| Pop a value from the RX FIFO. | |
| EPIO_EXPORT uint32_t | epio_pop_tx_fifo (epio_t *epio, uint8_t block, uint8_t sm) |
| Pop a value from the TX FIFO. | |
| EPIO_EXPORT void | epio_push_tx_fifo (epio_t *epio, uint8_t block, uint8_t sm, uint32_t value) |
| Push a value into the TX FIFO. | |
| EPIO_EXPORT void | epio_push_rx_fifo (epio_t *epio, uint8_t block, uint8_t sm, uint32_t value) |
| Push a value directly into the RX FIFO from the host. | |
Functions for interacting with PIO TX and RX FIFOs.
| EPIO_EXPORT uint32_t epio_pop_rx_fifo | ( | epio_t * | epio, |
| uint8_t | block, | ||
| uint8_t | sm | ||
| ) |
Pop a value from the RX FIFO.
Removes and returns the oldest entry from the RX FIFO. The RX FIFO is written by the SM (via PUSH instructions) and read by the host.
Asserts if the RX FIFO is empty (i.e. has no entries to pop).
| epio | The epio instance. |
| block | PIO block index (0 to NUM_PIO_BLOCKS-1). |
| sm | State machine index within the block (0 to NUM_SMS_PER_BLOCK-1). |
| EPIO_EXPORT uint32_t epio_pop_tx_fifo | ( | epio_t * | epio, |
| uint8_t | block, | ||
| uint8_t | sm | ||
| ) |
Pop a value from the TX FIFO.
Removes and returns the oldest entry from the TX FIFO. The TX FIFO is read by the SM (via PULL instructions).
Asserts if the TX FIFO is empty (i.e. has no entries to pop).
| epio | The epio instance. |
| block | PIO block index (0 to NUM_PIO_BLOCKS-1). |
| sm | State machine index within the block (0 to NUM_SMS_PER_BLOCK-1). |
| EPIO_EXPORT void epio_push_rx_fifo | ( | epio_t * | epio, |
| uint8_t | block, | ||
| uint8_t | sm, | ||
| uint32_t | value | ||
| ) |
Push a value directly into the RX FIFO from the host.
Allows the host to inject a value into the RX FIFO, simulating a DMA write or other external data source.
Asserts if the RX FIFO is full (i.e. has MAX_FIFO_DEPTH entries).
| epio | The epio instance. |
| block | PIO block index (0 to NUM_PIO_BLOCKS-1). |
| sm | State machine index within the block (0 to NUM_SMS_PER_BLOCK-1). |
| value | The 32-bit value to push. |
| EPIO_EXPORT void epio_push_tx_fifo | ( | epio_t * | epio, |
| uint8_t | block, | ||
| uint8_t | sm, | ||
| uint32_t | value | ||
| ) |
Push a value into the TX FIFO.
Adds value to the TX FIFO. The SM will consume this via PULL instructions. The TX FIFO is written by the host and read by the SM.
Asserts if the TX FIFO is full (i.e. has MAX_FIFO_DEPTH entries).
| epio | The epio instance. |
| block | PIO block index (0 to NUM_PIO_BLOCKS-1). |
| sm | State machine index within the block (0 to NUM_SMS_PER_BLOCK-1). |
| value | The 32-bit value to push. |
| EPIO_EXPORT uint8_t epio_rx_fifo_depth | ( | epio_t * | epio, |
| uint8_t | block, | ||
| uint8_t | sm | ||
| ) |
Return the current number of entries in the RX FIFO.
| epio | The epio instance. |
| block | PIO block index (0 to NUM_PIO_BLOCKS-1). |
| sm | State machine index within the block (0 to NUM_SMS_PER_BLOCK-1). |
| EPIO_EXPORT uint8_t epio_tx_fifo_depth | ( | epio_t * | epio, |
| uint8_t | block, | ||
| uint8_t | sm | ||
| ) |
Return the current number of entries in the TX FIFO.
| epio | The epio instance. |
| block | PIO block index (0 to NUM_PIO_BLOCKS-1). |
| sm | State machine index within the block (0 to NUM_SMS_PER_BLOCK-1). |
| EPIO_EXPORT int32_t epio_wait_tx_fifo | ( | epio_t * | epio, |
| uint8_t | block, | ||
| uint8_t | sm, | ||
| int32_t | count | ||
| ) |
Wait for a maximum of count cycles until the TX FIFO of a state machine has an entry pushed to it.
Blocks (in the emulation sense, by stepping the SM) until the TX FIFO has an entry. Returns the number of cycles waited.
| epio | The epio instance. |
| block | PIO block index (0 to NUM_PIO_BLOCKS-1). |
| sm | State machine index within the block (0 to NUM_SMS_PER_BLOCK-1). |
| count | Number of cycles to wait for, or -1 to wait forever. |