bootrom.h File Reference
#include "pico.h"
#include "pico/bootrom_constants.h"
#include <string.h>
#include "pico/bootrom/lock.h"
Include dependency graph for bootrom.h:

Go to the source code of this file.

Macros

#define rom_hword_as_ptr(rom_address)   (void *)(uintptr_t)(*(uint16_t *)(uintptr_t)(rom_address))
 

Typedefs

typedef uint32_t(* rom_popcount32_fn) (uint32_t)
 
typedef uint32_t(* rom_reverse32_fn) (uint32_t)
 
typedef uint32_t(* rom_clz32_fn) (uint32_t)
 
typedef uint32_t(* rom_ctz32_fn) (uint32_t)
 
typedef uint8_t *(* rom_memset_fn) (uint8_t *, uint8_t, uint32_t)
 
typedef uint32_t *(* rom_memset4_fn) (uint32_t *, uint8_t, uint32_t)
 
typedef uint32_t *(* rom_memcpy_fn) (uint8_t *, const uint8_t *, uint32_t)
 
typedef uint32_t *(* rom_memcpy44_fn) (uint32_t *, const uint32_t *, uint32_t)
 
typedef void(* rom_reset_usb_boot_fn) (uint32_t, uint32_t)
 
typedef int(* rom_reboot_fn) (uint32_t flags, uint32_t delay_ms, uint32_t p0, uint32_t p1)
 
typedef rom_reset_usb_boot_fn reset_usb_boot_fn
 
typedef void(* rom_connect_internal_flash_fn) (void)
 
typedef void(* rom_flash_exit_xip_fn) (void)
 
typedef void(* rom_flash_range_erase_fn) (uint32_t, size_t, uint32_t, uint8_t)
 
typedef void(* rom_flash_range_program_fn) (uint32_t, const uint8_t *, size_t)
 
typedef void(* rom_flash_flush_cache_fn) (void)
 
typedef void(* rom_flash_enter_cmd_xip_fn) (void)
 
typedef void *(* rom_table_lookup_fn) (uint16_t *table, uint32_t code)
 

Functions

static uint32_t rom_table_code (uint8_t c1, uint8_t c2)
 Return a bootrom lookup code based on two ASCII characters. More...
 
void * rom_func_lookup (uint32_t code)
 Lookup a bootrom function by its code. More...
 
void * rom_data_lookup (uint32_t code)
 Lookup a bootrom data address by its code. More...
 
bool rom_funcs_lookup (uint32_t *table, unsigned int count)
 Helper function to lookup the addresses of multiple bootrom functions. More...
 
static __force_inline void * rom_func_lookup_inline (uint32_t code)
 Lookup a bootrom function by code. This method is forcibly inlined into the caller for FLASH/RAM sensitive code usage. More...
 
void rom_reset_usb_boot (uint32_t usb_activity_gpio_pin_mask, uint32_t disable_interface_mask)
 Reboot the device into BOOTSEL mode. More...
 
static void reset_usb_boot (uint32_t usb_activity_gpio_pin_mask, uint32_t disable_interface_mask)
 
static void rom_connect_internal_flash ()
 Connect the SSI/QMI to the QSPI pads. More...
 
static void rom_flash_exit_xip ()
 Return the QSPI device from its XIP state to a serial command state. More...
 
static void rom_flash_range_erase (uint32_t addr, size_t count, uint32_t block_size, uint8_t block_cmd)
 Erase bytes in flash. More...
 
static void rom_flash_range_program (uint32_t addr, const uint8_t *data, size_t count)
 Program bytes in flash. More...
 
static void rom_flash_flush_cache ()
 Flush the XIP cache. More...
 
static void rom_flash_enter_cmd_xip ()
 Configure the SSI/QMI with a standard command. More...