Functions for the inter-core FIFOs. More...
Functions | |
static bool | multicore_fifo_rvalid (void) |
Check the read FIFO to see if there is data available (sent by the other core) More... | |
static bool | multicore_fifo_wready (void) |
Check the write FIFO to see if it has space for more data. More... | |
void | multicore_fifo_push_blocking (uint32_t data) |
Push data on to the write FIFO (data to the other core). More... | |
bool | multicore_fifo_push_timeout_us (uint32_t data, uint64_t timeout_us) |
Push data on to the write FIFO (data to the other core) with timeout. More... | |
uint32_t | multicore_fifo_pop_blocking (void) |
Pop data from the read FIFO (data from the other core). More... | |
bool | multicore_fifo_pop_timeout_us (uint64_t timeout_us, uint32_t *out) |
Pop data from the read FIFO (data from the other core) with timeout. More... | |
static void | multicore_fifo_drain (void) |
Discard any data in the read FIFO. More... | |
static void | multicore_fifo_clear_irq (void) |
Clear FIFO interrupt. More... | |
static uint32_t | multicore_fifo_get_status (void) |
Get FIFO statuses. More... | |
Functions for the inter-core FIFOs.
The RP2040 contains two FIFOs for passing data, messages or ordered events between the two cores. Each FIFO is 32 bits wide, and 8 entries deep. One of the FIFOs can only be written by core 0, and read by core 1. The other can only be written by core 1, and read by core 0.
|
inlinestatic |
Clear FIFO interrupt.
Note that this only clears an interrupt that was caused by the ROE or WOF flags. To clear the VLD flag you need to use one of the 'pop' or 'drain' functions.
See the note in the fifo section for considerations regarding use of the inter-core FIFOs
|
inlinestatic |
Discard any data in the read FIFO.
See the note in the fifo section for considerations regarding use of the inter-core FIFOs
|
inlinestatic |
Get FIFO statuses.
Bit | Description |
---|---|
3 | Sticky flag indicating the RX FIFO was read when empty (ROE). This read was ignored by the FIFO. |
2 | Sticky flag indicating the TX FIFO was written when full (WOF). This write was ignored by the FIFO. |
1 | Value is 1 if this core’s TX FIFO is not full (i.e. if FIFO_WR is ready for more data) |
0 | Value is 1 if this core’s RX FIFO is not empty (i.e. if FIFO_RD is valid) |
See the note in the fifo section for considerations regarding use of the inter-core FIFOs
uint32_t multicore_fifo_pop_blocking | ( | void | ) |
Pop data from the read FIFO (data from the other core).
This function will block until there is data ready to be read Use multicore_fifo_rvalid() to check if data is ready to be read if you don't want to block.
See the note in the fifo section for considerations regarding use of the inter-core FIFOs
bool multicore_fifo_pop_timeout_us | ( | uint64_t | timeout_us, |
uint32_t * | out | ||
) |
Pop data from the read FIFO (data from the other core) with timeout.
This function will block until there is data ready to be read or the timeout is reached
See the note in the fifo section for considerations regarding use of the inter-core FIFOs
timeout_us | the timeout in microseconds |
out | the location to store the popped data if available |
out
, false if the timeout occurred before data could be popped void multicore_fifo_push_blocking | ( | uint32_t | data | ) |
Push data on to the write FIFO (data to the other core).
This function will block until there is space for the data to be sent. Use multicore_fifo_wready() to check if it is possible to write to the FIFO if you don't want to block.
See the note in the fifo section for considerations regarding use of the inter-core FIFOs
data | A 32 bit value to push on to the FIFO |
bool multicore_fifo_push_timeout_us | ( | uint32_t | data, |
uint64_t | timeout_us | ||
) |
Push data on to the write FIFO (data to the other core) with timeout.
This function will block until there is space for the data to be sent or the timeout is reached
data | A 32 bit value to push on to the FIFO |
timeout_us | the timeout in microseconds |
|
inlinestatic |
Check the read FIFO to see if there is data available (sent by the other core)
See the note in the fifo section for considerations regarding use of the inter-core FIFOs
|
inlinestatic |
Check the write FIFO to see if it has space for more data.
See the note in the fifo section for considerations regarding use of the inter-core FIFOs