multicore.h File Reference
#include "pico/types.h"
#include "pico/sync.h"
#include "hardware/structs/sio.h"
Include dependency graph for multicore.h:

Go to the source code of this file.

Macros

#define PICO_CORE1_STACK_SIZE   0x800
 

Functions

void multicore_reset_core1 (void)
 Reset core 1This function can be used to reset core 1 into its initial state (ready for launching code against via multicore_launch_core1 and similar methods) More...
 
void multicore_launch_core1 (void(*entry)(void))
 Run code on core 1Wake up (a previously reset) core 1 and enter the given function on core 1 using the default core 1 stack (below core 0 stack). More...
 
void multicore_launch_core1_with_stack (void(*entry)(void), uint32_t *stack_bottom, size_t stack_size_bytes)
 Launch code on core 1 with stackWake up (a previously reset) core 1 and enter the given function on core 1 using the passed stack for core 1. More...
 
void multicore_launch_core1_raw (void(*entry)(void), uint32_t *sp, uint32_t vector_table)
 Launch code on core 1 with no stack protectionWake up (a previously reset) core 1 and start it executing with a specific entry point, stack pointer and vector table. More...
 
static bool multicore_fifo_rvalid (void)
 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. More...
 
static bool multicore_fifo_wready (void)
 Check the write FIFO to see if it has space for more dataSee the note in the fifo section for considerations regarding use of the inter-core FIFOs. More...
 
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. 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.This function will block until there is space for the data to be sent or the timeout is reached. More...
 
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. 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.This function will block until there is data ready to be read or the timeout is reached. More...
 
static void multicore_fifo_drain (void)
 Discard any data in the read FIFOSee the note in the fifo section for considerations regarding use of the inter-core FIFOs.
 
static void multicore_fifo_clear_irq (void)
 Clear FIFO interruptNote 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. More...
 
static uint32_t multicore_fifo_get_status (void)
 Get FIFO statuses. More...
 
void multicore_lockout_victim_init (void)
 Initialize the current core such that it can be a "victim" of lockout (i.e. forced to pause in a known state by the other core)This code hooks the intercore FIFO IRQ, and the FIFO may not be used for any other purpose after this.
 
void multicore_lockout_start_blocking (void)
 Request the other core to pause in a known state and wait for it to do soThe other (victim) core must have previously executed multicore_lockout_victim_init() More...
 
bool multicore_lockout_start_timeout_us (uint64_t timeout_us)
 Request the other core to pause in a known state and wait up to a time limit for it to do soThe other core must have previously executed multicore_lockout_victim_init() More...
 
void multicore_lockout_end_blocking (void)
 Release the other core from a locked out state amd wait for it to acknowledge. More...
 
bool multicore_lockout_end_timeout_us (uint64_t timeout_us)
 Release the other core from a locked out state amd wait up to a time limit for it to acknowledgeThe other core must previously have been "locked out" by calling a multicore_lockout_start_ function from this core. More...