diff --git a/components/driver/rmt/include/driver/rmt_rx.h b/components/driver/rmt/include/driver/rmt_rx.h index c750a59a73..a5ec79dba0 100644 --- a/components/driver/rmt/include/driver/rmt_rx.h +++ b/components/driver/rmt/include/driver/rmt_rx.h @@ -29,7 +29,7 @@ typedef struct { * @brief RMT RX channel specific configuration */ typedef struct { - int gpio_num; /*!< GPIO number used by RMT RX channel. Set to -1 if unused */ + gpio_num_t gpio_num; /*!< GPIO number used by RMT RX channel. Set to -1 if unused */ rmt_clock_source_t clk_src; /*!< Clock source of RMT RX channel, channels in the same group must use the same clock source */ uint32_t resolution_hz; /*!< Channel clock resolution, in Hz */ size_t mem_block_symbols; /*!< Size of memory block, in number of `rmt_symbol_word_t`, must be an even */ diff --git a/components/driver/rmt/include/driver/rmt_tx.h b/components/driver/rmt/include/driver/rmt_tx.h index 83b1cef392..f47a955519 100644 --- a/components/driver/rmt/include/driver/rmt_tx.h +++ b/components/driver/rmt/include/driver/rmt_tx.h @@ -30,7 +30,7 @@ typedef struct { * @brief RMT TX channel specific configuration */ typedef struct { - int gpio_num; /*!< GPIO number used by RMT TX channel. Set to -1 if unused */ + gpio_num_t gpio_num; /*!< GPIO number used by RMT TX channel. Set to -1 if unused */ rmt_clock_source_t clk_src; /*!< Clock source of RMT TX channel, channels in the same group must use the same clock source */ uint32_t resolution_hz; /*!< Channel clock resolution, in Hz */ size_t mem_block_symbols; /*!< Size of memory block, in number of `rmt_symbol_word_t`, must be an even */ diff --git a/components/driver/rmt/include/driver/rmt_types.h b/components/driver/rmt/include/driver/rmt_types.h index 2dea896ea6..63032d4d99 100644 --- a/components/driver/rmt/include/driver/rmt_types.h +++ b/components/driver/rmt/include/driver/rmt_types.h @@ -10,6 +10,7 @@ #include #include #include "hal/rmt_types.h" +#include "hal/gpio_types.h" // for gpio_num_t #ifdef __cplusplus extern "C" { diff --git a/components/hal/include/hal/rmt_types.h b/components/hal/include/hal/rmt_types.h index 1082761d87..7650c78bb7 100644 --- a/components/hal/include/hal/rmt_types.h +++ b/components/hal/include/hal/rmt_types.h @@ -1,11 +1,12 @@ /* - * SPDX-FileCopyrightText: 2015-2022 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2015-2023 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 */ #pragma once +#include #include "soc/clk_tree_defs.h" #include "soc/soc_caps.h" @@ -28,12 +29,12 @@ typedef int rmt_clock_source_t; */ typedef union { struct { - unsigned int duration0 : 15; /*!< Duration of level0 */ - unsigned int level0 : 1; /*!< Level of the first part */ - unsigned int duration1 : 15; /*!< Duration of level1 */ - unsigned int level1 : 1; /*!< Level of the second part */ + 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 */ }; - unsigned int val; /*!< Equivalent unsigned value for the RMT symbol */ + uint32_t val; /*!< Equivalent unsigned value for the RMT symbol */ } rmt_symbol_word_t; #ifdef __cplusplus