7#ifndef _HARDWARE_RESETS_H
8#define _HARDWARE_RESETS_H
11#include "hardware/structs/resets.h"
98#ifndef PARAM_ASSERTIONS_ENABLED_HARDWARE_RESETS
99#ifdef PARAM_ASSERTIONS_ENABLED_RESET
100#define PARAM_ASSERTIONS_ENABLED_HARDWARE_RESETS PARAM_ASSERTIONS_ENABLED_RESET
102#define PARAM_ASSERTIONS_ENABLED_HARDWARE_RESETS 0
109static_assert(RESET_COUNT == NUM_RESETS,
"");
111static __force_inline void reset_block_reg_mask(io_rw_32 *reset, uint32_t mask) {
115static __force_inline void unreset_block_reg_mask(io_rw_32 *reset, uint32_t mask) {
119static __force_inline void unreset_block_reg_mask_wait_blocking(io_rw_32 *reset, io_ro_32 *reset_done, uint32_t mask) {
121 while (~*reset_done & mask)
133 reset_block_reg_mask(&resets_hw->reset, bits);
142 unreset_block_reg_mask(&resets_hw->reset, bits);
151 unreset_block_reg_mask_wait_blocking(&resets_hw->reset, &resets_hw->reset_done, bits);
156#ifndef HARDWARE_RESETS_ENABLE_SDK1XX_COMPATIBILITY
157#define HARDWARE_RESETS_ENABLE_SDK1XX_COMPATIBILITY 1
160#if HARDWARE_RESETS_ENABLE_SDK1XX_COMPATIBILITY
180 invalid_params_if(HARDWARE_RESETS, block_num >= RESET_COUNT);
181 reset_block_reg_mask(&resets_hw->reset, 1u << block_num);
190 invalid_params_if(HARDWARE_RESETS, block_num >= RESET_COUNT);
191 unreset_block_reg_mask(&resets_hw->reset, 1u << block_num);
200 invalid_params_if(HARDWARE_RESETS, block_num >= RESET_COUNT);
201 unreset_block_reg_mask_wait_blocking(&resets_hw->reset, &resets_hw->reset_done, 1u << block_num);
210 invalid_params_if(HARDWARE_RESETS, block_num >= RESET_COUNT);
211 reset_block_reg_mask(&resets_hw->reset, 1u << block_num);
212 unreset_block_reg_mask_wait_blocking(&resets_hw->reset, &resets_hw->reset_done, 1u << block_num);
static __force_inline void hw_set_bits(io_rw_32 *addr, uint32_t mask)
Atomically set the specified bits to 1 in a HW register.
Definition address_mapped.h:135
static __force_inline void hw_clear_bits(io_rw_32 *addr, uint32_t mask)
Atomically clear the specified bits to 0 in a HW register.
Definition address_mapped.h:145
static void reset_block_num(reset_num_t block_num)
Reset the specified HW block.
Definition resets.h:179
static void unreset_block_num_wait_blocking(reset_num_t block_num)
Bring specified HW block out of reset and wait for completion.
Definition resets.h:199
static void unreset_block_num(reset_num_t block_num)
bring specified HW block out of reset
Definition resets.h:189
enum reset_num_rp2350 reset_num_t
Resettable component numbers on RP2350 (used as typedef reset_num_t).
static __force_inline void unreset_block_mask(uint32_t bits)
bring specified HW blocks out of reset
Definition resets.h:141
static void reset_unreset_block_num_wait_blocking(reset_num_t block_num)
Reset the specified HW block, and then bring at back out of reset and wait for completion.
Definition resets.h:209
static __force_inline void reset_block_mask(uint32_t bits)
Reset the specified HW blocks.
Definition resets.h:132
static __force_inline void unreset_block_mask_wait_blocking(uint32_t bits)
Bring specified HW blocks out of reset and wait for completion.
Definition resets.h:150