hardware_resets

Hardware Reset API. More...

Functions

static void reset_block (uint32_t bits)
 Reset the specified HW blocks. More...
 
static void unreset_block (uint32_t bits)
 bring specified HW blocks out of reset More...
 
static void unreset_block_wait (uint32_t bits)
 Bring specified HW blocks out of reset and wait for completion. More...
 

Detailed Description

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

#include <stdio.h>
#include "pico/stdlib.h"
int main() {
printf("Hello, reset!\n");
// Put the PWM block into reset
reset_block(RESETS_RESET_PWM_BITS);
// And bring it out
unreset_block_wait(RESETS_RESET_PWM_BITS);
// Put the PWM and RTC block into reset
reset_block(RESETS_RESET_PWM_BITS | RESETS_RESET_RTC_BITS);
// Wait for both to come out of reset
unreset_block_wait(RESETS_RESET_PWM_BITS | RESETS_RESET_RTC_BITS);
return 0;
}

Function Documentation

◆ reset_block()

static void reset_block ( uint32_t  bits)
inlinestatic

Reset the specified HW blocks.

Parameters
bitsBit pattern indicating blocks to reset. See reset_bitmask

◆ unreset_block()

static void unreset_block ( uint32_t  bits)
inlinestatic

bring specified HW blocks out of reset

Parameters
bitsBit pattern indicating blocks to unreset. See reset_bitmask

◆ unreset_block_wait()

static void unreset_block_wait ( uint32_t  bits)
inlinestatic

Bring specified HW blocks out of reset and wait for completion.

Parameters
bitsBit pattern indicating blocks to unreset. See reset_bitmask
unreset_block_wait
static void unreset_block_wait(uint32_t bits)
Bring specified HW blocks out of reset and wait for completion.
Definition: resets.h:88
resets.h
reset_block
static void reset_block(uint32_t bits)
Reset the specified HW blocks.
Definition: resets.h:70
stdio.h
stdlib.h
stdio_init_all
bool stdio_init_all(void)
Initialize all of the present standard stdio types that are linked into the binary.
Definition: stdio.c:283