|
#define | ROM_TABLE_CODE(c1, c2) ((c1) | ((c2) << 8)) |
| Return a bootrom lookup code based on two ASCII characters. More...
|
|
|
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 code. More...
|
|
void * | rom_data_lookup (uint32_t code) |
| Lookup a bootrom address by 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...
|
|
static void | reset_usb_boot (uint32_t usb_activity_gpio_pin_mask, uint32_t disable_interface_mask) |
| Reboot the device into BOOTSEL mode. More...
|
|
Access to functions and data in the RP2040 bootrom
This header may be included by assembly code
◆ ROM_TABLE_CODE
#define ROM_TABLE_CODE |
( |
|
c1, |
|
|
|
c2 |
|
) |
| ((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
-
c1 | the first character |
c2 | the second character |
- Returns
- the 'code' to use in rom_func_lookup() or rom_data_lookup()
◆ reset_usb_boot()
static void reset_usb_boot |
( |
uint32_t |
usb_activity_gpio_pin_mask, |
|
|
uint32_t |
disable_interface_mask |
|
) |
| |
|
inlinestatic |
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_mask | 0 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_mask | value 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
|
◆ rom_data_lookup()
void* rom_data_lookup |
( |
uint32_t |
code | ) |
|
Lookup a bootrom address by code.
- Parameters
-
- Returns
- a pointer to the data, or NULL if the code does not match any bootrom function
◆ rom_func_lookup()
void* rom_func_lookup |
( |
uint32_t |
code | ) |
|
Lookup a bootrom function by code.
- Parameters
-
- Returns
- a pointer to the function, or NULL if the code does not match any bootrom function
◆ rom_func_lookup_inline()
Lookup a bootrom function by code. This method is forcibly inlined into the caller for FLASH/RAM sensitive code usage.
- Parameters
-
- Returns
- a pointer to the function, or NULL if the code does not match any bootrom function
◆ 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
-
table | an IN/OUT array, elements are codes on input, function pointers on success. |
count | the number of elements in the table |
- Returns
- true if all the codes were found, and converted to function pointers, false otherwise
◆ rom_table_code()
static uint32_t rom_table_code |
( |
uint8_t |
c1, |
|
|
uint8_t |
c2 |
|
) |
| |
|
inlinestatic |
Return a bootrom lookup code based on two ASCII characters.
These codes are uses to lookup data or function addresses in the bootrom
- Parameters
-
c1 | the first character |
c2 | the second character |
- Returns
- the 'code' to use in rom_func_lookup() or rom_data_lookup()