YAHAL
Yet Another Hardware Abstraction Library
Loading...
Searching...
No Matches
pico_bootrom

Macros

#define ROM_TABLE_CODE(c1, c2)
 Return a bootrom lookup code based on two ASCII characters.
 

Typedefs

typedef void __attribute__((noreturn)) reset_usb_boot(uint32_t usb_activity_gpio_pin_mask
 Reboot the device into BOOTSEL mode.
 

Functions

void * rom_func_lookup (uint32_t code)
 Lookup a bootrom function by code.
 
void * rom_data_lookup (uint32_t code)
 Lookup a bootrom address by code.
 
bool rom_funcs_lookup (uint32_t *table, unsigned int count)
 Helper function to lookup the addresses of multiple bootrom functions.
 

Detailed Description

Access to functions and data in the RP2040 bootrom

This header may be included by assembly code

Macro Definition Documentation

◆ ROM_TABLE_CODE

#define ROM_TABLE_CODE ( c1,
c2 )
Value:
((c1) | ((c2) << 8))

Return a bootrom lookup code based on two ASCII characters.

These codes are uses to lookup data or function addresses in the bootrom

Parameters
c1the first character
c2the second character
Returns
the 'code' to use in rom_func_lookup() or rom_data_lookup()

Definition at line 52 of file bootrom.h.

Typedef Documentation

◆ __attribute__

void __attribute__
inline

Reboot the device into BOOTSEL mode.

This function reboots the device into the BOOTSEL mode ('usb boot"). Facilities are provided to enable an "activity light" via GPIO attached LED for the USB Mass Storage Device, and to limit the USB interfaces exposed.

Parameters
usb_activity_gpio_pin_mask0 No pins are used as per a cold boot. Otherwise a single bit set indicating which GPIO pin should be set to output and raised whenever there is mass storage activity from the host.
disable_interface_maskvalue to control exposed interfaces
  • 0 To enable both interfaces (as per a cold boot)
  • 1 To disable the USB Mass Storage Interface
  • 2 To disable the USB PICOBOOT Interface

Definition at line 66 of file bootrom.h.

Function Documentation

◆ rom_data_lookup()

void * rom_data_lookup ( uint32_t code)

Lookup a bootrom address by code.

Parameters
codethe code
Returns
a pointer to the data, or NULL if the code does not match any bootrom function

Definition at line 19 of file bootrom.c.

◆ rom_func_lookup()

void * rom_func_lookup ( uint32_t code)

Lookup a bootrom function by code.

Parameters
codethe code
Returns
a pointer to the function, or NULL if the code does not match any bootrom function

Definition at line 15 of file bootrom.c.

◆ rom_funcs_lookup()

bool rom_funcs_lookup ( uint32_t * table,
unsigned int count )

Helper function to lookup the addresses of multiple bootrom functions.

This method looks up the 'codes' in the table, and convert each table entry to the looked up function pointer, if there is a function for that code in the bootrom.

Parameters
tablean IN/OUT array, elements are codes on input, function pointers on success.
countthe number of elements in the table
Returns
true if all the codes were found, and converted to function pointers, false otherwise

Helper function to lookup the addresses of multiple bootrom functions.

Definition at line 26 of file bootrom.c.