diff --git a/components/soc/include/hal/rmt_types.h b/components/soc/include/hal/rmt_types.h index 4e463cdfd1..0e2e3735f8 100644 --- a/components/soc/include/hal/rmt_types.h +++ b/components/soc/include/hal/rmt_types.h @@ -18,11 +18,25 @@ extern "C" { #endif +#include "soc/rmt_caps.h" + /** - * @brief RMT Channel Type - * - */ -typedef rmt_channel_id_t rmt_channel_t; +* @brief RMT channel ID +* +*/ +typedef enum { + RMT_CHANNEL_0, /*!< RMT channel number 0 */ + RMT_CHANNEL_1, /*!< RMT channel number 1 */ + RMT_CHANNEL_2, /*!< RMT channel number 2 */ + RMT_CHANNEL_3, /*!< RMT channel number 3 */ +#if RMT_CHANNELS_NUM > 4 + RMT_CHANNEL_4, /*!< RMT channel number 4 */ + RMT_CHANNEL_5, /*!< RMT channel number 5 */ + RMT_CHANNEL_6, /*!< RMT channel number 6 */ + RMT_CHANNEL_7, /*!< RMT channel number 7 */ +#endif + RMT_CHANNEL_MAX /*!< Number of RMT channels */ +} rmt_channel_t; /** * @brief RMT Internal Memory Owner diff --git a/components/soc/soc/esp32/include/soc/rmt_caps.h b/components/soc/soc/esp32/include/soc/rmt_caps.h index 7b3eaf4ade..a1c4e7eb54 100644 --- a/components/soc/soc/esp32/include/soc/rmt_caps.h +++ b/components/soc/soc/esp32/include/soc/rmt_caps.h @@ -18,25 +18,8 @@ extern "C" { #endif -#include - #define RMT_CHANNEL_MEM_WORDS (64) /*!< Each channel owns 64 words memory */ - -/** -* @brief RMT channel ID -* -*/ -typedef enum { - RMT_CHANNEL_0, /*!< RMT channel number 0 */ - RMT_CHANNEL_1, /*!< RMT channel number 1 */ - RMT_CHANNEL_2, /*!< RMT channel number 2 */ - RMT_CHANNEL_3, /*!< RMT channel number 3 */ - RMT_CHANNEL_4, /*!< RMT channel number 4 */ - RMT_CHANNEL_5, /*!< RMT channel number 5 */ - RMT_CHANNEL_6, /*!< RMT channel number 6 */ - RMT_CHANNEL_7, /*!< RMT channel number 7 */ - RMT_CHANNEL_MAX /*!< Number of RMT channels */ -} rmt_channel_id_t; +#define RMT_CHANNELS_NUM (8) /*!< Total 8 channels */ #ifdef __cplusplus } diff --git a/components/soc/soc/esp32s2/include/soc/rmt_caps.h b/components/soc/soc/esp32s2/include/soc/rmt_caps.h index 8313d3463b..9973964e72 100644 --- a/components/soc/soc/esp32s2/include/soc/rmt_caps.h +++ b/components/soc/soc/esp32s2/include/soc/rmt_caps.h @@ -18,21 +18,8 @@ extern "C" { #endif -#include - #define RMT_CHANNEL_MEM_WORDS (64) /*!< Each channel owns 64 words memory */ - -/** -* @brief RMT channel ID -* -*/ -typedef enum { - RMT_CHANNEL_0, /*!< RMT channel number 0 */ - RMT_CHANNEL_1, /*!< RMT channel number 1 */ - RMT_CHANNEL_2, /*!< RMT channel number 2 */ - RMT_CHANNEL_3, /*!< RMT channel number 3 */ - RMT_CHANNEL_MAX /*!< Number of RMT channels */ -} rmt_channel_id_t; +#define RMT_CHANNELS_NUM (4) /*!< Total 4 channels */ #ifdef __cplusplus } diff --git a/tools/unit-test-app/components/test_utils/ref_clock.c b/tools/unit-test-app/components/test_utils/ref_clock.c index cecb5aed29..21de24ad91 100644 --- a/tools/unit-test-app/components/test_utils/ref_clock.c +++ b/tools/unit-test-app/components/test_utils/ref_clock.c @@ -49,7 +49,7 @@ #include "sdkconfig.h" /* Select which RMT and PCNT channels, and GPIO to use */ -#define REF_CLOCK_RMT_CHANNEL RMT_CHANNEL_MAX - 1 +#define REF_CLOCK_RMT_CHANNEL RMT_CHANNELS_NUM - 1 #define REF_CLOCK_PCNT_UNIT 0 #define REF_CLOCK_GPIO 21