1
6
7
8
9
10
11
12
13
14
15
16
20
21
28
32
33
40
44
45
50
54
55
56
57
58
59
60
61
62
63
64
65
68
69
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
121
122
123
124
131
132
133
140
141
142
147
148
149
154
155
156
157
158
159
160
/* ... */
#pragma once
#include <stdint.h>
#include "sdkconfig.h"
#include "soc/periph_defs.h"
#ifdef __cplusplus
extern "C" {
#endif
/* ... */
/* ... */
#define PERIPH_RCC_ACQUIRE_ATOMIC(rc_periph, rc_name) \
for (uint8_t rc_name, _rc_cnt = 1, __DECLARE_RCC_RC_ATOMIC_ENV; \
_rc_cnt ? (rc_name = periph_rcc_acquire_enter(rc_periph), 1) : 0; \
periph_rcc_acquire_exit(rc_periph, rc_name), _rc_cnt--)...
/* ... */
#define PERIPH_RCC_RELEASE_ATOMIC(rc_periph, rc_name) \
for (uint8_t rc_name, _rc_cnt = 1, __DECLARE_RCC_RC_ATOMIC_ENV; \
_rc_cnt ? (rc_name = periph_rcc_release_enter(rc_periph), 1) : 0; \
periph_rcc_release_exit(rc_periph, rc_name), _rc_cnt--)...
/* ... */
#define PERIPH_RCC_ATOMIC() \
for (int _rc_cnt = 1, __DECLARE_RCC_ATOMIC_ENV; \
_rc_cnt ? (periph_rcc_enter(), 1) : 0; \
periph_rcc_exit(), _rc_cnt--)...
uint8_t periph_rcc_acquire_enter(periph_module_t periph);
void periph_rcc_acquire_exit(periph_module_t periph, uint8_t ref_count);
uint8_t periph_rcc_release_enter(periph_module_t periph);
void periph_rcc_release_exit(periph_module_t periph, uint8_t ref_count);
void periph_rcc_enter(void);
void periph_rcc_exit(void);
/* ... */
/* ... */
#if defined(CONFIG_IDF_TARGET_ESP32) || \
defined(CONFIG_IDF_TARGET_ESP32S2) || \
defined(CONFIG_IDF_TARGET_ESP32S3) || \
defined(CONFIG_IDF_TARGET_ESP32C2) || \
defined(CONFIG_IDF_TARGET_ESP32C3) || \
defined(CONFIG_IDF_TARGET_ESP32C6) || \
defined(CONFIG_IDF_TARGET_ESP32H2)
#define __PERIPH_CTRL_ALLOW_LEGACY_API
#endif
#ifdef __PERIPH_CTRL_ALLOW_LEGACY_API
#define __PERIPH_CTRL_DEPRECATE_ATTR
#else
#define __PERIPH_CTRL_DEPRECATE_ATTR __attribute__((deprecated("This function is not functional on "CONFIG_IDF_TARGET)))
#endif
/* ... */
__PERIPH_CTRL_DEPRECATE_ATTR
void periph_module_enable(periph_module_t periph);
/* ... */
__PERIPH_CTRL_DEPRECATE_ATTR
void periph_module_disable(periph_module_t periph);
/* ... */
__PERIPH_CTRL_DEPRECATE_ATTR
void periph_module_reset(periph_module_t periph);
/* ... */
void wifi_bt_common_module_enable(void);
/* ... */
void wifi_bt_common_module_disable(void);
/* ... */
void wifi_module_enable(void);
/* ... */
void wifi_module_disable(void);
#undef __PERIPH_CTRL_DEPRECATE_ATTR
#ifdef __cplusplus
}{...}
#endif