resets.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2020 Raspberry Pi (Trading) Ltd.
3  *
4  * SPDX-License-Identifier: BSD-3-Clause
5  */
6 
7 #ifndef _HARDWARE_RESETS_H
8 #define _HARDWARE_RESETS_H
9 
10 #include "pico.h"
11 #include "hardware/structs/resets.h"
12 
59 #ifdef __cplusplus
60 extern "C" {
61 #endif
62 
64 
70 static inline void reset_block(uint32_t bits) {
71  hw_set_bits(&resets_hw->reset, bits);
72 }
73 
79 static inline void unreset_block(uint32_t bits) {
80  hw_clear_bits(&resets_hw->reset, bits);
81 }
82 
88 static inline void unreset_block_wait(uint32_t bits) {
89  hw_clear_bits(&resets_hw->reset, bits);
90  while (~resets_hw->reset_done & bits)
92 }
94 
95 #ifdef __cplusplus
96 }
97 #endif
98 
99 #endif
hw_clear_bits
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:131
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
unreset_block
static void unreset_block(uint32_t bits)
bring specified HW blocks out of reset
Definition: resets.h:79
reset_block
static void reset_block(uint32_t bits)
Reset the specified HW blocks.
Definition: resets.h:70
hw_set_bits
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:121
tight_loop_contents
static __always_inline void tight_loop_contents(void)
No-op function for the body of tight loops.
Definition: platform.h:358
pico.h