esp_sleep.h 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547
  1. /*
  2. * SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. */
  6. #pragma once
  7. #include <stdint.h>
  8. #include "esp_err.h"
  9. #include "hal/touch_sensor_types.h"
  10. #include "hal/gpio_types.h"
  11. #include "soc/soc_caps.h"
  12. #ifdef __cplusplus
  13. extern "C" {
  14. #endif
  15. /**
  16. * @brief Logic function used for EXT1 wakeup mode.
  17. */
  18. typedef enum {
  19. ESP_EXT1_WAKEUP_ALL_LOW = 0, //!< Wake the chip when all selected GPIOs go low
  20. ESP_EXT1_WAKEUP_ANY_HIGH = 1 //!< Wake the chip when any of the selected GPIOs go high
  21. } esp_sleep_ext1_wakeup_mode_t;
  22. #if SOC_GPIO_SUPPORT_DEEPSLEEP_WAKEUP
  23. typedef enum {
  24. ESP_GPIO_WAKEUP_GPIO_LOW = 0,
  25. ESP_GPIO_WAKEUP_GPIO_HIGH = 1
  26. } esp_deepsleep_gpio_wake_up_mode_t;
  27. #endif
  28. /**
  29. * @brief Power domains which can be powered down in sleep mode
  30. */
  31. typedef enum {
  32. #if SOC_PM_SUPPORT_RTC_PERIPH_PD
  33. ESP_PD_DOMAIN_RTC_PERIPH, //!< RTC IO, sensors and ULP co-processor
  34. #endif
  35. #if SOC_PM_SUPPORT_RTC_SLOW_MEM_PD
  36. ESP_PD_DOMAIN_RTC_SLOW_MEM, //!< RTC slow memory
  37. #endif
  38. #if SOC_PM_SUPPORT_RTC_FAST_MEM_PD
  39. ESP_PD_DOMAIN_RTC_FAST_MEM, //!< RTC fast memory
  40. #endif
  41. ESP_PD_DOMAIN_XTAL, //!< XTAL oscillator
  42. #if SOC_PM_SUPPORT_CPU_PD
  43. ESP_PD_DOMAIN_CPU, //!< CPU core
  44. #endif
  45. ESP_PD_DOMAIN_RTC8M, //!< Internal 8M oscillator
  46. ESP_PD_DOMAIN_VDDSDIO, //!< VDD_SDIO
  47. ESP_PD_DOMAIN_MAX //!< Number of domains
  48. } esp_sleep_pd_domain_t;
  49. /**
  50. * @brief Power down options
  51. */
  52. typedef enum {
  53. ESP_PD_OPTION_OFF, //!< Power down the power domain in sleep mode
  54. ESP_PD_OPTION_ON, //!< Keep power domain enabled during sleep mode
  55. ESP_PD_OPTION_AUTO //!< Keep power domain enabled in sleep mode, if it is needed by one of the wakeup options. Otherwise power it down.
  56. } esp_sleep_pd_option_t;
  57. /**
  58. * @brief Sleep wakeup cause
  59. */
  60. typedef enum {
  61. ESP_SLEEP_WAKEUP_UNDEFINED, //!< In case of deep sleep, reset was not caused by exit from deep sleep
  62. ESP_SLEEP_WAKEUP_ALL, //!< Not a wakeup cause, used to disable all wakeup sources with esp_sleep_disable_wakeup_source
  63. ESP_SLEEP_WAKEUP_EXT0, //!< Wakeup caused by external signal using RTC_IO
  64. ESP_SLEEP_WAKEUP_EXT1, //!< Wakeup caused by external signal using RTC_CNTL
  65. ESP_SLEEP_WAKEUP_TIMER, //!< Wakeup caused by timer
  66. ESP_SLEEP_WAKEUP_TOUCHPAD, //!< Wakeup caused by touchpad
  67. ESP_SLEEP_WAKEUP_ULP, //!< Wakeup caused by ULP program
  68. ESP_SLEEP_WAKEUP_GPIO, //!< Wakeup caused by GPIO (light sleep only on ESP32, S2 and S3)
  69. ESP_SLEEP_WAKEUP_UART, //!< Wakeup caused by UART (light sleep only)
  70. ESP_SLEEP_WAKEUP_WIFI, //!< Wakeup caused by WIFI (light sleep only)
  71. ESP_SLEEP_WAKEUP_COCPU, //!< Wakeup caused by COCPU int
  72. ESP_SLEEP_WAKEUP_COCPU_TRAP_TRIG, //!< Wakeup caused by COCPU crash
  73. ESP_SLEEP_WAKEUP_BT, //!< Wakeup caused by BT (light sleep only)
  74. } esp_sleep_source_t;
  75. /* Leave this type define for compatibility */
  76. typedef esp_sleep_source_t esp_sleep_wakeup_cause_t;
  77. enum {
  78. ESP_ERR_SLEEP_REJECT = ESP_ERR_INVALID_STATE,
  79. ESP_ERR_SLEEP_TOO_SHORT_SLEEP_DURATION = ESP_ERR_INVALID_ARG,
  80. };
  81. /**
  82. * @brief Disable wakeup source
  83. *
  84. * This function is used to deactivate wake up trigger for source
  85. * defined as parameter of the function.
  86. *
  87. * @note This function does not modify wake up configuration in RTC.
  88. * It will be performed in esp_deep_sleep_start/esp_light_sleep_start function.
  89. *
  90. * See docs/sleep-modes.rst for details.
  91. *
  92. * @param source - number of source to disable of type esp_sleep_source_t
  93. * @return
  94. * - ESP_OK on success
  95. * - ESP_ERR_INVALID_STATE if trigger was not active
  96. */
  97. esp_err_t esp_sleep_disable_wakeup_source(esp_sleep_source_t source);
  98. #if SOC_ULP_SUPPORTED
  99. /**
  100. * @brief Enable wakeup by ULP coprocessor
  101. * @note On ESP32, ULP wakeup source cannot be used when RTC_PERIPH power domain is forced,
  102. * to be powered on (ESP_PD_OPTION_ON) or when ext0 wakeup source is used.
  103. * @return
  104. * - ESP_OK on success
  105. * - ESP_ERR_NOT_SUPPORTED if additional current by touch (CONFIG_RTC_EXT_CRYST_ADDIT_CURRENT) is enabled.
  106. * - ESP_ERR_INVALID_STATE if ULP co-processor is not enabled or if wakeup triggers conflict
  107. */
  108. esp_err_t esp_sleep_enable_ulp_wakeup(void);
  109. #endif // SOC_ULP_SUPPORTED
  110. /**
  111. * @brief Enable wakeup by timer
  112. * @param time_in_us time before wakeup, in microseconds
  113. * @return
  114. * - ESP_OK on success
  115. * - ESP_ERR_INVALID_ARG if value is out of range (TBD)
  116. */
  117. esp_err_t esp_sleep_enable_timer_wakeup(uint64_t time_in_us);
  118. #if SOC_TOUCH_SENSOR_SUPPORTED
  119. /**
  120. * @brief Enable wakeup by touch sensor
  121. *
  122. * @note On ESP32, touch wakeup source can not be used when RTC_PERIPH power domain is forced
  123. * to be powered on (ESP_PD_OPTION_ON) or when ext0 wakeup source is used.
  124. *
  125. * @note The FSM mode of the touch button should be configured
  126. * as the timer trigger mode.
  127. *
  128. * @return
  129. * - ESP_OK on success
  130. * - ESP_ERR_NOT_SUPPORTED if additional current by touch (CONFIG_RTC_EXT_CRYST_ADDIT_CURRENT) is enabled.
  131. * - ESP_ERR_INVALID_STATE if wakeup triggers conflict
  132. */
  133. esp_err_t esp_sleep_enable_touchpad_wakeup(void);
  134. /**
  135. * @brief Get the touch pad which caused wakeup
  136. *
  137. * If wakeup was caused by another source, this function will return TOUCH_PAD_MAX;
  138. *
  139. * @return touch pad which caused wakeup
  140. */
  141. touch_pad_t esp_sleep_get_touchpad_wakeup_status(void);
  142. #endif // SOC_TOUCH_SENSOR_SUPPORTED
  143. /**
  144. * @brief Returns true if a GPIO number is valid for use as wakeup source.
  145. *
  146. * @note For SoCs with RTC IO capability, this can be any valid RTC IO input pin.
  147. *
  148. * @param gpio_num Number of the GPIO to test for wakeup source capability
  149. *
  150. * @return True if this GPIO number will be accepted as a sleep wakeup source.
  151. */
  152. bool esp_sleep_is_valid_wakeup_gpio(gpio_num_t gpio_num);
  153. #if SOC_PM_SUPPORT_EXT_WAKEUP
  154. /**
  155. * @brief Enable wakeup using a pin
  156. *
  157. * This function uses external wakeup feature of RTC_IO peripheral.
  158. * It will work only if RTC peripherals are kept on during sleep.
  159. *
  160. * This feature can monitor any pin which is an RTC IO. Once the pin transitions
  161. * into the state given by level argument, the chip will be woken up.
  162. *
  163. * @note This function does not modify pin configuration. The pin is
  164. * configured in esp_deep_sleep_start/esp_light_sleep_start,
  165. * immediately before entering sleep mode.
  166. *
  167. * @note ESP32: ext0 wakeup source can not be used together with touch or ULP wakeup sources.
  168. *
  169. * @param gpio_num GPIO number used as wakeup source. Only GPIOs with the RTC
  170. * functionality can be used. For different SoCs, the related GPIOs are:
  171. * - ESP32: 0, 2, 4, 12-15, 25-27, 32-39;
  172. * - ESP32-S2: 0-21;
  173. * - ESP32-S3: 0-21.
  174. * @param level input level which will trigger wakeup (0=low, 1=high)
  175. * @return
  176. * - ESP_OK on success
  177. * - ESP_ERR_INVALID_ARG if the selected GPIO is not an RTC GPIO,
  178. * or the mode is invalid
  179. * - ESP_ERR_INVALID_STATE if wakeup triggers conflict
  180. */
  181. esp_err_t esp_sleep_enable_ext0_wakeup(gpio_num_t gpio_num, int level);
  182. /**
  183. * @brief Enable wakeup using multiple pins
  184. *
  185. * This function uses external wakeup feature of RTC controller.
  186. * It will work even if RTC peripherals are shut down during sleep.
  187. *
  188. * This feature can monitor any number of pins which are in RTC IOs.
  189. * Once any of the selected pins goes into the state given by mode argument,
  190. * the chip will be woken up.
  191. *
  192. * @note This function does not modify pin configuration. The pins are
  193. * configured in esp_deep_sleep_start/esp_light_sleep_start,
  194. * immediately before entering sleep mode.
  195. *
  196. * @note Internal pullups and pulldowns don't work when RTC peripherals are
  197. * shut down. In this case, external resistors need to be added.
  198. * Alternatively, RTC peripherals (and pullups/pulldowns) may be
  199. * kept enabled using esp_sleep_pd_config function.
  200. *
  201. * @param mask bit mask of GPIO numbers which will cause wakeup. Only GPIOs
  202. * which have RTC functionality can be used in this bit map.
  203. * For different SoCs, the related GPIOs are:
  204. * - ESP32: 0, 2, 4, 12-15, 25-27, 32-39;
  205. * - ESP32-S2: 0-21;
  206. * - ESP32-S3: 0-21.
  207. * @param mode select logic function used to determine wakeup condition:
  208. * - ESP_EXT1_WAKEUP_ALL_LOW: wake up when all selected GPIOs are low
  209. * - ESP_EXT1_WAKEUP_ANY_HIGH: wake up when any of the selected GPIOs is high
  210. * @return
  211. * - ESP_OK on success
  212. * - ESP_ERR_INVALID_ARG if any of the selected GPIOs is not an RTC GPIO,
  213. * or mode is invalid
  214. */
  215. esp_err_t esp_sleep_enable_ext1_wakeup(uint64_t mask, esp_sleep_ext1_wakeup_mode_t mode);
  216. #endif // SOC_PM_SUPPORT_EXT_WAKEUP
  217. #if SOC_GPIO_SUPPORT_DEEPSLEEP_WAKEUP
  218. /**
  219. * @brief Enable wakeup using specific gpio pins
  220. *
  221. * This function enables an IO pin to wake up the chip from deep sleep.
  222. *
  223. * @note This function does not modify pin configuration. The pins are
  224. * configured inside esp_deep_sleep_start, immediately before entering sleep mode.
  225. *
  226. * @note You don't need to care to pull-up or pull-down before using this
  227. * function, because this will be set internally in esp_deep_sleep_start
  228. * based on the wakeup mode. BTW, when you use low level to wake up the
  229. * chip, we strongly recommend you to add external resistors (pull-up).
  230. *
  231. * @param gpio_pin_mask Bit mask of GPIO numbers which will cause wakeup. Only GPIOs
  232. * which have RTC functionality (pads that powered by VDD3P3_RTC) can be used in this bit map.
  233. * @param mode Select logic function used to determine wakeup condition:
  234. * - ESP_GPIO_WAKEUP_GPIO_LOW: wake up when the gpio turn to low.
  235. * - ESP_GPIO_WAKEUP_GPIO_HIGH: wake up when the gpio turn to high.
  236. * @return
  237. * - ESP_OK on success
  238. * - ESP_ERR_INVALID_ARG if the mask contains any invalid deep sleep wakeup pin or wakeup mode is invalid
  239. */
  240. esp_err_t esp_deep_sleep_enable_gpio_wakeup(uint64_t gpio_pin_mask, esp_deepsleep_gpio_wake_up_mode_t mode);
  241. #endif
  242. /**
  243. * @brief Enable wakeup from light sleep using GPIOs
  244. *
  245. * Each GPIO supports wakeup function, which can be triggered on either low level
  246. * or high level. Unlike EXT0 and EXT1 wakeup sources, this method can be used
  247. * both for all IOs: RTC IOs and digital IOs. It can only be used to wakeup from
  248. * light sleep though.
  249. *
  250. * To enable wakeup, first call gpio_wakeup_enable, specifying gpio number and
  251. * wakeup level, for each GPIO which is used for wakeup.
  252. * Then call this function to enable wakeup feature.
  253. *
  254. * @note On ESP32, GPIO wakeup source can not be used together with touch or ULP wakeup sources.
  255. *
  256. * @return
  257. * - ESP_OK on success
  258. * - ESP_ERR_INVALID_STATE if wakeup triggers conflict
  259. */
  260. esp_err_t esp_sleep_enable_gpio_wakeup(void);
  261. /**
  262. * @brief Enable wakeup from light sleep using UART
  263. *
  264. * Use uart_set_wakeup_threshold function to configure UART wakeup threshold.
  265. *
  266. * Wakeup from light sleep takes some time, so not every character sent
  267. * to the UART can be received by the application.
  268. *
  269. * @note ESP32 does not support wakeup from UART2.
  270. *
  271. * @param uart_num UART port to wake up from
  272. * @return
  273. * - ESP_OK on success
  274. * - ESP_ERR_INVALID_ARG if wakeup from given UART is not supported
  275. */
  276. esp_err_t esp_sleep_enable_uart_wakeup(int uart_num);
  277. /**
  278. * @brief Enable wakeup by bluetooth
  279. * @return
  280. * - ESP_OK on success
  281. * - ESP_ERR_NOT_SUPPORTED if wakeup from bluetooth is not supported
  282. */
  283. esp_err_t esp_sleep_enable_bt_wakeup(void);
  284. /**
  285. * @brief Disable wakeup by bluetooth
  286. * @return
  287. * - ESP_OK on success
  288. * - ESP_ERR_NOT_SUPPORTED if wakeup from bluetooth is not supported
  289. */
  290. esp_err_t esp_sleep_disable_bt_wakeup(void);
  291. /**
  292. * @brief Enable wakeup by WiFi MAC
  293. * @return
  294. * - ESP_OK on success
  295. */
  296. esp_err_t esp_sleep_enable_wifi_wakeup(void);
  297. /**
  298. * @brief Disable wakeup by WiFi MAC
  299. * @return
  300. * - ESP_OK on success
  301. */
  302. esp_err_t esp_sleep_disable_wifi_wakeup(void);
  303. /**
  304. * @brief Get the bit mask of GPIOs which caused wakeup (ext1)
  305. *
  306. * If wakeup was caused by another source, this function will return 0.
  307. *
  308. * @return bit mask, if GPIOn caused wakeup, BIT(n) will be set
  309. */
  310. uint64_t esp_sleep_get_ext1_wakeup_status(void);
  311. #if SOC_GPIO_SUPPORT_DEEPSLEEP_WAKEUP
  312. /**
  313. * @brief Get the bit mask of GPIOs which caused wakeup (gpio)
  314. *
  315. * If wakeup was caused by another source, this function will return 0.
  316. *
  317. * @return bit mask, if GPIOn caused wakeup, BIT(n) will be set
  318. */
  319. uint64_t esp_sleep_get_gpio_wakeup_status(void);
  320. #endif //SOC_GPIO_SUPPORT_DEEPSLEEP_WAKEUP
  321. /**
  322. * @brief Set power down mode for an RTC power domain in sleep mode
  323. *
  324. * If not set set using this API, all power domains default to ESP_PD_OPTION_AUTO.
  325. *
  326. * @param domain power domain to configure
  327. * @param option power down option (ESP_PD_OPTION_OFF, ESP_PD_OPTION_ON, or ESP_PD_OPTION_AUTO)
  328. * @return
  329. * - ESP_OK on success
  330. * - ESP_ERR_INVALID_ARG if either of the arguments is out of range
  331. */
  332. esp_err_t esp_sleep_pd_config(esp_sleep_pd_domain_t domain,
  333. esp_sleep_pd_option_t option);
  334. /**
  335. * @brief Enter deep sleep with the configured wakeup options
  336. *
  337. * This function does not return.
  338. */
  339. void esp_deep_sleep_start(void) __attribute__((noreturn));
  340. /**
  341. * @brief Enter light sleep with the configured wakeup options
  342. *
  343. * @return
  344. * - ESP_OK on success (returned after wakeup)
  345. * - ESP_ERR_SLEEP_REJECT sleep request is rejected(wakeup source set before the sleep request)
  346. * - ESP_ERR_SLEEP_TOO_SHORT_SLEEP_DURATION after deducting the sleep flow overhead, the final sleep duration
  347. * is too short to cover the minimum sleep duration of the chip, when
  348. * rtc timer wakeup source enabled
  349. */
  350. esp_err_t esp_light_sleep_start(void);
  351. /**
  352. * @brief Enter deep-sleep mode
  353. *
  354. * The device will automatically wake up after the deep-sleep time
  355. * Upon waking up, the device calls deep sleep wake stub, and then proceeds
  356. * to load application.
  357. *
  358. * Call to this function is equivalent to a call to esp_deep_sleep_enable_timer_wakeup
  359. * followed by a call to esp_deep_sleep_start.
  360. *
  361. * esp_deep_sleep does not shut down WiFi, BT, and higher level protocol
  362. * connections gracefully.
  363. * Make sure relevant WiFi and BT stack functions are called to close any
  364. * connections and deinitialize the peripherals. These include:
  365. * - esp_bluedroid_disable
  366. * - esp_bt_controller_disable
  367. * - esp_wifi_stop
  368. *
  369. * This function does not return.
  370. *
  371. * @note The device will wake up immediately if the deep-sleep time is set to 0
  372. *
  373. * @param time_in_us deep-sleep time, unit: microsecond
  374. */
  375. void esp_deep_sleep(uint64_t time_in_us) __attribute__((noreturn));
  376. /**
  377. * @brief Get the wakeup source which caused wakeup from sleep
  378. *
  379. * @return cause of wake up from last sleep (deep sleep or light sleep)
  380. */
  381. esp_sleep_wakeup_cause_t esp_sleep_get_wakeup_cause(void);
  382. /**
  383. * @brief Default stub to run on wake from deep sleep.
  384. *
  385. * Allows for executing code immediately on wake from sleep, before
  386. * the software bootloader or ESP-IDF app has started up.
  387. *
  388. * This function is weak-linked, so you can implement your own version
  389. * to run code immediately when the chip wakes from
  390. * sleep.
  391. *
  392. * See docs/deep-sleep-stub.rst for details.
  393. */
  394. void esp_wake_deep_sleep(void);
  395. /**
  396. * @brief Function type for stub to run on wake from sleep.
  397. *
  398. */
  399. typedef void (*esp_deep_sleep_wake_stub_fn_t)(void);
  400. /**
  401. * @brief Install a new stub at runtime to run on wake from deep sleep
  402. *
  403. * If implementing esp_wake_deep_sleep() then it is not necessary to
  404. * call this function.
  405. *
  406. * However, it is possible to call this function to substitute a
  407. * different deep sleep stub. Any function used as a deep sleep stub
  408. * must be marked RTC_IRAM_ATTR, and must obey the same rules given
  409. * for esp_wake_deep_sleep().
  410. */
  411. void esp_set_deep_sleep_wake_stub(esp_deep_sleep_wake_stub_fn_t new_stub);
  412. /**
  413. * @brief Get current wake from deep sleep stub
  414. * @return Return current wake from deep sleep stub, or NULL if
  415. * no stub is installed.
  416. */
  417. esp_deep_sleep_wake_stub_fn_t esp_get_deep_sleep_wake_stub(void);
  418. /**
  419. * @brief The default esp-idf-provided esp_wake_deep_sleep() stub.
  420. *
  421. * See docs/deep-sleep-stub.rst for details.
  422. */
  423. void esp_default_wake_deep_sleep(void);
  424. /**
  425. * @brief Disable logging from the ROM code after deep sleep.
  426. *
  427. * Using LSB of RTC_STORE4.
  428. */
  429. void esp_deep_sleep_disable_rom_logging(void);
  430. #ifdef SOC_PM_SUPPORT_CPU_PD
  431. /**
  432. * @brief CPU Power down low-level initialize
  433. *
  434. * @param enable enable or disable CPU power down during light sleep
  435. * @return
  436. * - ESP_OK on success
  437. * - ESP_ERR_NO_MEM not enough retention memory
  438. */
  439. esp_err_t esp_sleep_cpu_pd_low_init(bool enable);
  440. #endif
  441. #if SOC_GPIO_SUPPORT_SLP_SWITCH
  442. /**
  443. * @brief Configure to isolate all GPIO pins in sleep state
  444. */
  445. void esp_sleep_config_gpio_isolate(void);
  446. /**
  447. * @brief Enable or disable GPIO pins status switching between slept status and waked status.
  448. * @param enable decide whether to switch status or not
  449. */
  450. void esp_sleep_enable_gpio_switch(bool enable);
  451. #endif
  452. #if CONFIG_MAC_BB_PD
  453. /**
  454. * @brief Function type for stub to run mac bb power down.
  455. */
  456. typedef void (* mac_bb_power_down_cb_t)(void);
  457. /**
  458. * @brief Function type for stub to run mac bb power up.
  459. */
  460. typedef void (* mac_bb_power_up_cb_t)(void);
  461. /**
  462. * @brief Registet mac bb power down callback.
  463. * @param cb mac bb power down callback.
  464. * @return
  465. * - ESP_OK on success
  466. */
  467. esp_err_t esp_register_mac_bb_pd_callback(mac_bb_power_down_cb_t cb);
  468. /**
  469. * @brief Unregistet mac bb power down callback.
  470. * @param cb mac bb power down callback.
  471. * @return
  472. * - ESP_OK on success
  473. */
  474. esp_err_t esp_unregister_mac_bb_pd_callback(mac_bb_power_down_cb_t cb);
  475. /**
  476. * @brief Registet mac bb power up callback.
  477. * @param cb mac bb power up callback.
  478. * @return
  479. * - ESP_OK on success
  480. */
  481. esp_err_t esp_register_mac_bb_pu_callback(mac_bb_power_up_cb_t cb);
  482. /**
  483. * @brief Unregistet mac bb power up callback.
  484. * @param cb mac bb power up callback.
  485. * @return
  486. * - ESP_OK on success
  487. */
  488. esp_err_t esp_unregister_mac_bb_pu_callback(mac_bb_power_up_cb_t cb);
  489. #endif
  490. #ifdef __cplusplus
  491. }
  492. #endif