Core2 for AWS IoT EduKit BSP  1.4.0
FT6336U

The FT6336U library provides convenience functions to interact with the capacitive touch panel. The initialization function configures the Espressif I2C driver and the FT6336U capacitive touch controller with preset parameters. It creates a FreeRTOS task and installs an ISR on the interrupt pin FT6336U_INTR_PIN.

Circuit Block Diagram for the FT6336U capacitive touch sensor

To enable this feature using KConfig, use the command pio run --environment core2foraws --target menuconfig from within the root of the project directory in your PlatformIO terminal window and go to the menu Component Config --> Core2 for AWS hardware enable to set the features you want to enable.

Example

The following example initializes the Core2 for AWS, which initializes the PMU for the battery and other user enabled hardware features — such as the FT6336U. It then creates a FreeRTOS task of priority 1 that prints "PRESSED!" using the ESP logger if the screen is pressed anywhere.

#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "esp_log.h"
#include "core2foraws.h"
#include "ft6336u.h"
static const char *TAG = "EXAMPLE";
static void touch_task(void* pvParameters){
for(;;){
if(FT6336U_WasPressed() == 1){
ESP_LOGI(TAG, "PRESSED!");
}
vTaskDelay(pdMS_TO_TICKS(100));
}
vTaskDelete(NULL); /* Should never get to here... */
}
void app_main(void){
xTaskCreatePinnedToCore(touch_task, "touchTask", configMINIMAL_STACK_SIZE * 3, NULL, 1, NULL, 1);
}
Functions to initialize and access Core2 for AWS IoT EduKit hardware features.
void Core2ForAWS_Init(void)
Initializes the power chip with default values, enables battery charging, and initializes all enabled...
Definition: core2forAWS.c:32
Functions for the FT6336U capacitive touch panel controller.
bool FT6336U_WasPressed()
Retrieves the pressed state of the touch screen.
Definition: ft6336u.c:74

Functions