How do I use the ESP-IDF functions?
Posted: Tue Apr 07, 2020 9:55 am
Hello,
I just recently started to work with the ESP-IDF, I know the ESP32 has two cores one for protocols and the other for user apps, both can run tasks with different priorities.
I'm using Visual Studio Code with PlatformIO extension and I was trying to configure the touch sensor module and found this example in the Espressif GitHub: https://github.com/espressif/esp-idf/bl ... ead_main.c
but I need to add "esp_err_t" in front of each function in order for it to work.
I'm having trouble with the "touch_pad_config" function, it accepted the "touch_pad_tTOUCH_PAD_NUM0" as the first parameter but doesn't seem to accept anything as the second parameter.
Should I include the "touch_pad.h" header?
How do I use this function?
I'm sorry for asking such beginner stuff, I'm sure it must be quite simple but I'm having trouble understanding the ESP-IDF functions.
Thanks in advance!
They also have documented the functions here:
https://docs.espressif.com/projects/esp ... _pad_initv
The header file they used:
I just recently started to work with the ESP-IDF, I know the ESP32 has two cores one for protocols and the other for user apps, both can run tasks with different priorities.
I'm using Visual Studio Code with PlatformIO extension and I was trying to configure the touch sensor module and found this example in the Espressif GitHub: https://github.com/espressif/esp-idf/bl ... ead_main.c
but I need to add "esp_err_t" in front of each function in order for it to work.
Code: Select all
#include <stdio.h>
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "freertos/queue.h"
#include "esp_log.h"
#define TOUCH_THRESH_NO_USE (0)
void app_main(void)
{
esp_err_t touch_pad_init();
esp_err_t touch_pad_config(touch_pad_tTOUCH_PAD_NUM0, 1 );
//esp_err_t touch_pad_filter_start(uint32_t filter_period_ms);
//esp_err_t touch_pad_read_filtered(touch_pad_t touch_num, uint16_t *touch_value);
}
Should I include the "touch_pad.h" header?
How do I use this function?
I'm sorry for asking such beginner stuff, I'm sure it must be quite simple but I'm having trouble understanding the ESP-IDF functions.
Thanks in advance!
They also have documented the functions here:
https://docs.espressif.com/projects/esp ... _pad_initv
The header file they used:
Code: Select all
https://github.com/espressif/esp-idf/blob/v4.0/components/driver/include/driver/touch_pad.h