rmt: use gpio_num_t to define gpio number

This commit is contained in:
morris
2023-02-28 17:11:33 +08:00
parent 20f200a1c9
commit d82981c437
4 changed files with 10 additions and 8 deletions

View File

@@ -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 */

View File

@@ -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 */

View File

@@ -10,6 +10,7 @@
#include <stdbool.h>
#include <stddef.h>
#include "hal/rmt_types.h"
#include "hal/gpio_types.h" // for gpio_num_t
#ifdef __cplusplus
extern "C" {