1
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
66
67
68
69
70
71
74
75
78
79
84
85
86
87
92
95
96
101
104
105
110
113
114
115
116
117
118
119
120
121
122
123
124
125
128
129
132
133
134
139
142
143
148
152
153
158
162
163
168
173
174
175
176
177
178
/* ... */
#ifndef _HARDWARE_RESETS_H
#define _HARDWARE_RESETS_H
#include "pico.h"
#include "hardware/structs/resets.h"
/* ... */
#ifndef PARAM_ASSERTIONS_ENABLED_HARDWARE_RESETS
#ifdef PARAM_ASSERTIONS_ENABLED_RESET
#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();
}{ ... }
/* ... */
static __force_inline void reset_block_mask(uint32_t bits) {
reset_block_reg_mask(&resets_hw->reset, bits);
}{ ... }
/* ... */
static __force_inline void unreset_block_mask(uint32_t bits) {
unreset_block_reg_mask(&resets_hw->reset, bits);
}{ ... }
/* ... */
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);
}{ ... }
#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/* ... */
/* ... */
static inline void reset_block_num(uint32_t block_num) {
reset_block_reg_mask(&resets_hw->reset, 1u << block_num);
}{ ... }
/* ... */
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);
}{ ... }
/* ... */
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);
}{ ... }
/* ... */
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