Hi,
I'd like use the GPIO43 on ESP32-S3 as Input.
I'm doing this (I don't know what I have to put on <XX>):
[Codebox]
gpio_iomux_in(GPIO_NUM_43, <XX>);
gpio_config_t config{BIT(43), GPIO_MODE_INPUT, GPIO_PULLUP_ENABLE, GPIO_PULLDOWN_DISABLE, GPIO_INTR_POSEDGE}; gpio_config(&config);
gpio_install_isr_service(0);
gpio_isr_handler_add(GPIO_NUM_43, button_handler, this);
[/Codebox]
How do I have to do to use the GPIO43 as Input?
Thank you
How to use GPIO43 as Input on a ESP32-S3
-
- Posts: 2
- Joined: Thu Aug 01, 2024 6:45 pm
-
- Posts: 2
- Joined: Thu Aug 01, 2024 6:45 pm
Re: How to use GPIO43 as Input on a ESP32-S3
Hi,
I found the solution:
I found the solution:
- void init(void)
- {
- gpio_set_direction(GPIO_NUM_43, GPIO_MODE_INPUT);
- gpio_config_t config{(1ULL << 43),
- GPIO_MODE_INPUT,
- GPIO_PULLUP_DISABLE,
- GPIO_PULLDOWN_DISABLE,
- GPIO_INTR_POSEDGE};
- gpio_config(&config);
- gpio_install_isr_service(0);
- gpio_isr_handler_add(GPIO_NUM_43, button_handler, this);
- }
-
- Posts: 9709
- Joined: Thu Nov 26, 2015 4:08 am
Re: How to use GPIO43 as Input on a ESP32-S3
Note the gpio_set_direction is not needed, and generally you want to install the interrupt handler before you configure the GPIO to generate an interrupt.
Who is online
Users browsing this forum: Bing [Bot] and 109 guests