Core2 for AWS IoT EduKit BSP 1.5.1
Button (virtual)

The button library provides convenience functions to interact with the virtual buttons drawn over specified areas of the front of the device. There are three virtual buttons aligned to the circles etched on the front of the Core2 for AWS IoT EduKit reference hardware.

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 features to set the features you want to enable.


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 and virtual touch buttons. It then creates a FreeRTOS task of priority 1 that prints "MIDDLE PRESSED!" using the ESP logger if the middle button touch is pressed.

#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "esp_log.h"
#include "core2forAWS.h"
static const char *TAG = "EXAMPLE";
static void button_task(void* pvParameters){
vTaskDelete(NULL); // Should never get to here...
void app_main(void){
xTaskCreatePinnedToCore(button_task, "buttonTask", configMINIMAL_STACK_SIZE * 3, NULL, 1, NULL, 1);
uint8_t Button_WasPressed(Button_t *button)
See if the specified button was pressed.
Definition: button.c:43
void Core2ForAWS_Init(void)
Initializes the power chip with default values, enables battery charging, and initializes all enabled...
Definition: core2forAWS.c:32
Button_t * button_middle
Middle virtual touch button.
Definition: core2forAWS.c:86
Functions to initialize and access Core2 for AWS IoT EduKit hardware features.
#define TAG
Definition: i2c_device.c:10

Enumerated Type Definitions