-
Notifications
You must be signed in to change notification settings - Fork 7k
/
rmt_types.h
42 lines (36 loc) · 1017 Bytes
/
rmt_types.h
1
2
3
4
5
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
/*
* SPDX-FileCopyrightText: 2015-2023 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
#pragma once
#include <stdint.h>
#include "soc/clk_tree_defs.h"
#include "soc/soc_caps.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
* @brief RMT group clock source
* @note User should select the clock source based on the power and resolution requirement
*/
#if SOC_RMT_SUPPORTED
typedef soc_periph_rmt_clk_src_t rmt_clock_source_t;
#else
typedef int rmt_clock_source_t;
#endif
/**
* @brief The layout of RMT symbol stored in memory, which is decided by the hardware design
*/
typedef union {
struct {
uint16_t duration0 : 15; /*!< Duration of level0 */
uint16_t level0 : 1; /*!< Level of the first part */
uint16_t duration1 : 15; /*!< Duration of level1 */
uint16_t level1 : 1; /*!< Level of the second part */
};
uint32_t val; /*!< Equivalent unsigned value for the RMT symbol */
} rmt_symbol_word_t;
#ifdef __cplusplus
}
#endif