platform.h File Reference
#include "hardware/platform_defs.h"
#include "hardware/regs/addressmap.h"
#include "hardware/regs/sio.h"
#include "pico/types.h"
Include dependency graph for platform.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define PICO_RP2040   1
 
#define PICO_STACK_SIZE   _u(0x800)
 
#define PICO_HEAP_SIZE   _u(0x800)
 
#define PICO_NO_RAM_VECTOR_TABLE   0
 
#define PICO_RP2040_B0_SUPPORTED   1
 
#define PICO_FLOAT_SUPPORT_ROM_V1   1
 
#define PICO_DOUBLE_SUPPORT_ROM_V1   1
 
#define PICO_RP2040_B1_SUPPORTED   1
 
#define PICO_RP2040_B2_SUPPORTED   1
 
#define GCC_Like_Pragma(x)
 
#define Clang_Pragma(x)
 
#define GCC_Pragma(x)
 
#define __isr
 Marker for an interrupt handler. More...
 
#define __after_data(group)   __attribute__((section(".after_data." group)))
 Section attribute macro for placement in RAM after the .data section. More...
 
#define __not_in_flash(group)   __attribute__((section(".time_critical." group)))
 Section attribute macro for placement not in flash (i.e in RAM) More...
 
#define __scratch_x(group)   __attribute__((section(".scratch_x." group)))
 Section attribute macro for placement in the SRAM bank 4 (known as "scratch X") More...
 
#define __scratch_y(group)   __attribute__((section(".scratch_y." group)))
 Section attribute macro for placement in the SRAM bank 5 (known as "scratch Y") More...
 
#define __uninitialized_ram(group)   __attribute__((section(".uninitialized_data." #group))) group
 Section attribute macro for data that is to be left uninitialized. More...
 
#define __in_flash(group)   __attribute__((section(".flashdata." group)))
 Section attribute macro for placement in flash even in a COPY_TO_RAM binary. More...
 
#define __not_in_flash_func(func_name)   __not_in_flash(__STRING(func_name)) func_name
 Indicates a function should not be stored in flash. More...
 
#define __time_critical_func(func_name)   __not_in_flash_func(func_name)
 Indicates a function is time/latency critical and should not run from flash. More...
 
#define __no_inline_not_in_flash_func(func_name)   __noinline __not_in_flash_func(func_name)
 Indicate a function should not be stored in flash and should not be inlined. More...
 
#define __packed_aligned   __packed __aligned(4)
 
#define __force_inline   __always_inline
 Attribute to force inlining of a function regardless of optimization level. More...
 
#define count_of(a)   (sizeof(a)/sizeof((a)[0]))
 Macro to determine the number of elements in an array.
 
#define MAX(a, b)   ((a)>(b)?(a):(b))
 Macro to return the maximum of two comparable values.
 
#define MIN(a, b)   ((b)>(a)?(a):(b))
 Macro to return the minimum of two comparable values.
 
#define pico_default_asm(...)   __asm (".syntax unified\n" __VA_ARGS__)
 
#define pico_default_asm_volatile(...)   __asm volatile (".syntax unified\n" __VA_ARGS__)
 
#define host_safe_hw_ptr(x)   ((uintptr_t)(x))
 Macro for converting memory addresses to 32 bit addresses suitable for DMA. More...
 
#define native_safe_hw_ptr(x)   host_safe_hw_ptr(x)
 
#define panic_compact(...)   panic("")
 
#define PICO_NO_FPGA_CHECK   0
 
#define __fast_mul(a, b)
 multiply two integer values using the fastest method possible More...
 
#define __check_type_compatible(type_a, type_b)   static_assert(__builtin_types_compatible_p(type_a, type_b), __STRING(type_a) " is not compatible with " __STRING(type_b));
 Utility macro to assert two types are equivalent. More...
 
#define WRAPPER_FUNC(x)   __wrap_ ## x
 
#define REAL_FUNC(x)   __real_ ## x
 

Functions

static void __breakpoint (void)
 Execute a breakpoint instruction.
 
static __always_inline void __compiler_memory_barrier (void)
 Ensure that the compiler does not move memory access across this method call. More...
 
void panic_unsupported (void)
 Panics with the message "Unsupported". More...
 
void panic (const char *fmt,...)
 Displays a panic message and halts execution. More...
 
bool running_on_fpga (void)
 
uint8_t rp2040_chip_version (void)
 Returns the RP2040 chip revision number. More...
 
static uint8_t rp2040_rom_version (void)
 Returns the RP2040 rom version number. More...
 
static __always_inline void tight_loop_contents (void)
 No-op function for the body of tight loops. More...
 
static __always_inline int32_t __mul_instruction (int32_t a, int32_t b)
 Multiply two integers using an assembly MUL instruction. More...
 
static __always_inline uint __get_current_exception (void)
 Get the current exception level on this core. More...
 
static void busy_wait_at_least_cycles (uint32_t minimum_cycles)
 Helper method to busy-wait for at least the given number of cycles. More...
 
static __always_inline uint get_core_num (void)
 Get the current core number. More...