Hardware Reset API
The reset controller allows software control of the resets to all of the peripherals that are not critical to boot the processor in the RP2040.
reset_bitmask
Multiple blocks are referred to using a bitmask as follows:
Block to reset | Bit |
USB | 24 |
UART 1 | 23 |
UART 0 | 22 |
Timer | 21 |
TB Manager | 20 |
SysInfo | 19 |
System Config | 18 |
SPI 1 | 17 |
SPI 0 | 16 |
RTC | 15 |
PWM | 14 |
PLL USB | 13 |
PLL System | 12 |
PIO 1 | 11 |
PIO 0 | 10 |
Pads - QSPI | 9 |
Pads - bank 0 | 8 |
JTAG | 7 |
IO Bank 1 | 6 |
IO Bank 0 | 5 |
I2C 1 | 4 |
I2C 0 | 3 |
DMA | 2 |
Bus Control | 1 |
ADC 0 | 0 |
Example
int main() {
printf("Hello, reset!\n");
reset_block(RESETS_RESET_PWM_BITS | RESETS_RESET_RTC_BITS);
return 0;
}
static void reset_block(uint32_t bits)
Reset the specified HW blocks.
Definition: resets.h:70
static void unreset_block_wait(uint32_t bits)
Bring specified HW blocks out of reset and wait for completion.
Definition: resets.h:88
bool stdio_init_all(void)
Initialize all of the present standard stdio types that are linked into the binary.
Definition: stdio.c:283
◆ reset_block()
static void reset_block |
( |
uint32_t |
bits | ) |
|
|
inlinestatic |
Reset the specified HW blocks.
- Parameters
-
◆ unreset_block()
static void unreset_block |
( |
uint32_t |
bits | ) |
|
|
inlinestatic |
bring specified HW blocks out of reset
- Parameters
-
◆ unreset_block_wait()
static void unreset_block_wait |
( |
uint32_t |
bits | ) |
|
|
inlinestatic |
Bring specified HW blocks out of reset and wait for completion.
- Parameters
-