SensorLib
0.5.0
Multi-platform sensor driver library for Arduino, PlatformIO, and ESP-IDF
Loading...
Searching...
No Matches
esp_idf_touch/main/main.cpp
Go to the documentation of this file.
1
30
#include "sdkconfig.h"
31
#include "freertos/FreeRTOS.h"
32
#include "freertos/task.h"
33
#include "driver/gpio.h"
34
#include "freertos/queue.h"
35
#include "
i2c_driver.h
"
36
37
static
const
char
*TAG =
"main"
;
38
39
extern
esp_err_t
sensor_drv_init
();
40
extern
esp_err_t
touch_drv_init
();
41
extern
void
touch_loop
();
42
static
void
touch_task(
void
*);
43
44
extern
"C"
void
app_main
(
void
)
45
{
46
ESP_ERROR_CHECK(
i2c_drv_init
());
47
ESP_LOGI(TAG,
"I2C initialized successfully"
);
48
49
ESP_ERROR_CHECK(
touch_drv_init
());
50
51
xTaskCreate(touch_task,
"touch"
, 4 * 1024, NULL, 10, NULL);
52
53
ESP_LOGI(TAG,
"Run..."
);
54
}
55
56
57
static
void
touch_task(
void
*args)
58
{
59
while
(1) {
60
touch_loop
();
61
// vTaskDelay(pdMS_TO_TICKS(10));
62
vTaskDelay(1 / portTICK_PERIOD_MS);
63
}
64
}
65
66
67
i2c_drv_init
esp_err_t i2c_drv_init(void)
i2c master initialization
Definition
esp_idf_touch/main/i2c_driver.cpp:174
i2c_driver.h
@license MIT License
touch_drv_init
esp_err_t touch_drv_init()
Definition
touch_drv.cpp:73
app_main
void app_main(void)
Definition
esp_idf_touch/main/main.cpp:44
sensor_drv_init
esp_err_t sensor_drv_init()
touch_loop
void touch_loop()
Definition
touch_drv.cpp:209
examples
platform
esp_idf_touch
main
main.cpp
Generated by
1.9.8