1 /*
2  * SPDX-FileCopyrightText: 2015-2023 Espressif Systems (Shanghai) CO LTD
3  *
4  * SPDX-License-Identifier: Apache-2.0
5  */
6 
7 #pragma once
8 
9 #include <stdint.h>
10 #include "soc/clk_tree_defs.h"
11 #include "soc/soc_caps.h"
12 
13 #ifdef __cplusplus
14 extern "C" {
15 #endif
16 
17 /**
18  * @brief RMT group clock source
19  * @note User should select the clock source based on the power and resolution requirement
20  */
21 #if SOC_RMT_SUPPORTED
22 typedef soc_periph_rmt_clk_src_t rmt_clock_source_t;
23 #else
24 typedef int rmt_clock_source_t;
25 #endif
26 
27 /**
28  * @brief The layout of RMT symbol stored in memory, which is decided by the hardware design
29  */
30 typedef union {
31     struct {
32         uint16_t duration0 : 15; /*!< Duration of level0 */
33         uint16_t level0 : 1;     /*!< Level of the first part */
34         uint16_t duration1 : 15; /*!< Duration of level1 */
35         uint16_t level1 : 1;     /*!< Level of the second part */
36     };
37     uint32_t val; /*!< Equivalent unsigned value for the RMT symbol */
38 } rmt_symbol_word_t;
39 
40 #ifdef __cplusplus
41 }
42 #endif
43