|
epio
A cycle-accurate RP2350 PIO emulator
|
Functions for creating and updating an epio instance from apio state. More...
Functions | |
| EPIO_EXPORT epio_t * | epio_from_apio (void) |
| Create an epio instance configured from the current apio state. | |
| EPIO_EXPORT void | epio_update_from_apio (epio_t *epio) |
| Update a live epio instance from the current accumulated apio state. | |
| EPIO_EXPORT int | epio_disassemble_sm (epio_t *epio, uint8_t block, uint8_t sm, char *buffer, size_t buffer_size) |
| Disassemble the instructions of a state machine. | |
Functions for creating and updating an epio instance from apio state.
| EPIO_EXPORT int epio_disassemble_sm | ( | epio_t * | epio, |
| uint8_t | block, | ||
| uint8_t | sm, | ||
| char * | buffer, | ||
| size_t | buffer_size | ||
| ) |
Disassemble the instructions of a state machine.
| epio | The epio instance. |
| block | PIO block number. |
| sm | State machine number. |
| buffer | Buffer to store the disassembled instructions. |
| buffer_size | Size of the buffer. |
| EPIO_EXPORT epio_t * epio_from_apio | ( | void | ) |
Create an epio instance configured from the current apio state.
Reads the PIO program, SM configuration, and GPIO state assembled by apio and uses it to initialise and return a fully configured epio instance. This is the recommended entry point when using epio with apio.
After applying all apio state, the accumulated pre_instr_count, tx_fifo_count, and rx_fifo_count in the apio global state are reset to zero. This marks those items as consumed, so that a subsequent call to epio_update_from_apio() sees only the delta accumulated since this call.
Only available when APIO_EMULATION is defined (i.e. on non-RP2350 hosts).
| EPIO_EXPORT void epio_update_from_apio | ( | epio_t * | epio | ) |
Update a live epio instance from the current accumulated apio state.
Applies any apio configuration or state accumulated since the last call to epio_from_apio() or epio_update_from_apio() to the running epio instance, without disturbing the live runtime state of already-enabled SMs.
Specifically:
After applying, the accumulated pre_instr_count, tx_fifo_count, and rx_fifo_count in the apio global state are reset to zero so that the next call sees only the delta.
Must be called after any firmware function that uses APIO_ASM_CONTINUE() to extend the PIO configuration of a live epio instance:
| epio | The live epio instance to update. Must not be NULL. |