Select one of the symbols to view example projects that use it.
 
Outline
#define _HARDWARE_RESETS_H
#include "pico.h"
#include "hardware/structs/resets.h"
#define PARAM_ASSERTIONS_ENABLED_HARDWARE_RESETS
#define PARAM_ASSERTIONS_ENABLED_HARDWARE_RESETS
reset_block_reg_mask(io_rw_32 *, uint32_t)
unreset_block_reg_mask(io_rw_32 *, uint32_t)
unreset_block_reg_mask_wait_blocking(io_rw_32 *, io_ro_32 *, uint32_t)
reset_block_mask(uint32_t)
unreset_block_mask(uint32_t)
unreset_block_mask_wait_blocking(uint32_t)
#define HARDWARE_RESETS_ENABLE_SDK1XX_COMPATIBILITY
reset_block(uint32_t)
unreset_block(uint32_t)
unreset_block_wait(uint32_t)
reset_block_num(uint32_t)
unreset_block_num(uint)
unreset_block_num_wait_blocking(uint)
reset_unreset_block_num_wait_blocking(uint)
Files
loading...
SourceVuRaspberry Pi Pico SDK and ExamplesPicoSDKsrc/rp2_common/hardware_resets/include/hardware/resets.h
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
/* * Copyright (c) 2020 Raspberry Pi (Trading) Ltd. * * SPDX-License-Identifier: BSD-3-Clause *//* ... */ #ifndef _HARDWARE_RESETS_H #define _HARDWARE_RESETS_H #include "pico.h" #include "hardware/structs/resets.h" /** \file hardware/resets.h * \defgroup hardware_resets hardware_resets * * \brief 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 RP-series microcontroller. * * \subsubsection reset_bitmask * \addtogroup hardware_resets * * 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 * * \subsection reset_example Example * \addtogroup hardware_resets * \include hello_reset.c *//* ... */ // PICO_CONFIG: PARAM_ASSERTIONS_ENABLED_HARDWARE_RESETS, Enable/disable assertions in the hardware_resets module, type=bool, default=0, group=hardware_adc #ifndef PARAM_ASSERTIONS_ENABLED_HARDWARE_RESETS #ifdef PARAM_ASSERTIONS_ENABLED_RESET // backwards compatibility with SDK < 2.0.0 #define PARAM_ASSERTIONS_ENABLED_HARDWARE_RESETS PARAM_ASSERTIONS_ENABLED_RESET #else #define PARAM_ASSERTIONS_ENABLED_HARDWARE_RESETS 0 #endif/* ... */ #endif #ifdef __cplusplus extern "C" { #endif static __force_inline void reset_block_reg_mask(io_rw_32 *reset, uint32_t mask) { hw_set_bits(reset, mask); }{ ... } static __force_inline void unreset_block_reg_mask(io_rw_32 *reset, uint32_t mask) { hw_clear_bits(reset, mask); }{ ... } static __force_inline void unreset_block_reg_mask_wait_blocking(io_rw_32 *reset, io_ro_32 *reset_done, uint32_t mask) { hw_clear_bits(reset, mask); while (~*reset_done & mask) tight_loop_contents(); }{ ... } /// \tag::reset_funcs[] /*! \brief Reset the specified HW blocks * \ingroup hardware_resets * * \param bits Bit pattern indicating blocks to reset. See \ref reset_bitmask *//* ... */ static __force_inline void reset_block_mask(uint32_t bits) { reset_block_reg_mask(&resets_hw->reset, bits); }{ ... } /*! \brief bring specified HW blocks out of reset * \ingroup hardware_resets * * \param bits Bit pattern indicating blocks to unreset. See \ref reset_bitmask *//* ... */ static __force_inline void unreset_block_mask(uint32_t bits) { unreset_block_reg_mask(&resets_hw->reset, bits); }{ ... } /*! \brief Bring specified HW blocks out of reset and wait for completion * \ingroup hardware_resets * * \param bits Bit pattern indicating blocks to unreset. See \ref reset_bitmask *//* ... */ static __force_inline void unreset_block_mask_wait_blocking(uint32_t bits) { unreset_block_reg_mask_wait_blocking(&resets_hw->reset, &resets_hw->reset_done, bits); }{ ... } /// \end::reset_funcs[] #ifndef HARDWARE_RESETS_ENABLE_SDK1XX_COMPATIBILITY #define HARDWARE_RESETS_ENABLE_SDK1XX_COMPATIBILITY 1 #endif #if HARDWARE_RESETS_ENABLE_SDK1XX_COMPATIBILITY static __force_inline void reset_block(uint32_t bits) { reset_block_mask(bits); }{ ... } static __force_inline void unreset_block(uint32_t bits) { unreset_block_mask(bits); }{ ... } static __force_inline void unreset_block_wait(uint32_t bits) { return unreset_block_mask_wait_blocking(bits); }{ ... } #endif/* ... */ /*! \brief Reset the specified HW block * \ingroup hardware_resets * * \param block_num the block number *//* ... */ static inline void reset_block_num(uint32_t block_num) { reset_block_reg_mask(&resets_hw->reset, 1u << block_num); }{ ... } /*! \brief bring specified HW block out of reset * \ingroup hardware_resets * * \param block_num the block number *//* ... */ static inline void unreset_block_num(uint block_num) { invalid_params_if(HARDWARE_RESETS, block_num > NUM_RESETS); unreset_block_reg_mask(&resets_hw->reset, 1u << block_num); }{ ... } /*! \brief Bring specified HW block out of reset and wait for completion * \ingroup hardware_resets * * \param block_num the block number *//* ... */ static inline void unreset_block_num_wait_blocking(uint block_num) { invalid_params_if(HARDWARE_RESETS, block_num > NUM_RESETS); unreset_block_reg_mask_wait_blocking(&resets_hw->reset, &resets_hw->reset_done, 1u << block_num); }{ ... } /*! \brief Reset the specified HW block, and then bring at back out of reset and wait for completion * \ingroup hardware_resets * * \param block_num the block number *//* ... */ static inline void reset_unreset_block_num_wait_blocking(uint block_num) { invalid_params_if(HARDWARE_RESETS, block_num > NUM_RESETS); reset_block_reg_mask(&resets_hw->reset, 1u << block_num); unreset_block_reg_mask_wait_blocking(&resets_hw->reset, &resets_hw->reset_done, 1u << block_num); }{ ... } #ifdef __cplusplus }extern "C" { ... } #endif /* ... */ #endif
Details