8#include "freertos/FreeRTOS.h"
10#if CONFIG_SOFTWARE_ILI9342C_SUPPORT || CONFIG_SOFTWARE_SDCARD_SUPPORT
11#include "freertos/semphr.h"
13#include "disp_driver.h"
47#if CONFIG_SOFTWARE_FT6336U_SUPPORT
51#if CONFIG_SOFTWARE_SK6812_SUPPORT
57#define SK6812_SIDE_LEFT 0
64#define SK6812_SIDE_RIGHT 1
68#if CONFIG_SOFTWARE_BUTTON_SUPPORT
72#if CONFIG_SOFTWARE_MPU6886_SUPPORT
76#if CONFIG_SOFTWARE_RTC_SUPPORT
80#if CONFIG_SOFTWARE_ATECC608_SUPPORT
81#include "cryptoauthlib.h"
85#if CONFIG_SOFTWARE_SPEAKER_SUPPORT || CONFIG_SOFTWARE_MIC_SUPPORT
86#include "driver/i2s.h"
89#if CONFIG_SOFTWARE_MIC_SUPPORT
93#if CONFIG_SOFTWARE_SPEAKER_SUPPORT
97#if CONFIG_SOFTWARE_SDCARD_SUPPORT
98#include "driver/gpio.h"
99#include "esp_freertos_hooks.h"
100#include "esp_vfs_fat.h"
101#include "sdmmc_cmd.h"
104#if CONFIG_SOFTWARE_EXPPORTS_SUPPORT
105#include "driver/gpio.h"
106#include "driver/uart.h"
116#define PORT_A_SDA_PIN GPIO_NUM_32
126#define PORT_A_SCL_PIN GPIO_NUM_33
137#define PORT_B_ADC_PIN GPIO_NUM_36
148#define PORT_B_DAC_PIN GPIO_NUM_26
159#define PORT_C_UART_TX_PIN GPIO_NUM_14
170#define PORT_C_UART_RX_PIN GPIO_NUM_13
180#define PORT_C_UART_NUM UART_NUM_2
191#define PORT_A_I2C_STANDARD_BAUD 100000
202#define UART_RX_BUF_SIZE 2048
228#if CONFIG_SOFTWARE_ILI9342C_SUPPORT || CONFIG_SOFTWARE_SDCARD_SUPPORT
238#define SPI_HOST_USE HSPI_HOST
248#define SPI_DMA_CHAN 2
272#if CONFIG_SOFTWARE_BUTTON_SUPPORT
357#if CONFIG_SOFTWARE_SPEAKER_SUPPORT
394void Core2ForAWS_PMU_Init(uint16_t ldo2_volt, uint16_t ldo3_volt, uint16_t dc2_volt, uint16_t dc3_volt);
433#if CONFIG_SOFTWARE_ILI9342C_SUPPORT
494#if CONFIG_SOFTWARE_SK6812_SUPPORT
623#if CONFIG_SOFTWARE_SDCARD_SUPPORT
722#if CONFIG_SOFTWARE_EXPPORTS_SUPPORT
Functions for the ATECC608 Trust&GO secure element.
Functions for the AXP192 Power Management Unit (PMU)
Functions for the BM8563 Real-Time Clock (RTC).
void Core2ForAWS_Port_A_I2C_Close(I2CDevice_t device)
Frees the configuration pointer to the I2C peripheral connected on port A.
Definition: core2forAWS.c:530
uint32_t Core2ForAWS_Port_B_ADC_ReadRaw(void)
Read the raw ADC value from GPIO36.
Definition: core2forAWS.c:534
void Core2ForAWS_Button_Init(void)
Initializes the button_left, button_middle, button_right virtual buttons using the ft6336u touch cont...
Definition: core2forAWS.c:89
void Core2ForAWS_Motor_SetStrength(uint8_t strength)
Sets the speed of the vibration motor.
Definition: core2forAWS.c:139
void Core2ForAWS_Sk6812_SetColor(uint16_t pos, uint32_t color)
Sets the color of a single LED in the LED bars.
Definition: core2forAWS.c:232
void Core2ForAWS_Sk6812_Clear(void)
Turns off the LEDs in the LED bars and removes any set color.
Definition: core2forAWS.c:256
esp_err_t Core2ForAWS_Port_PinMode(gpio_num_t pin, pin_mode_t mode)
Sets the pin mode of the specified pin.
Definition: core2forAWS.c:431
float Core2ForAWS_PMU_GetBatCurrent(void)
Gets the battery current draw with the AXP192.
Definition: core2forAWS.c:164
uint32_t Core2ForAWS_Port_B_ADC_ReadMilliVolts(void)
Read the calibrated ADC voltage from GPIO36.
Definition: core2forAWS.c:538
SemaphoreHandle_t xGuiSemaphore
FreeRTOS semaphore to be used when performing any operation on the display.
Definition: core2forAWS.c:271
Button_t * button_left
Left virtual touch button.
Definition: core2forAWS.c:85
I2CDevice_t Core2ForAWS_Port_A_I2C_Begin(uint8_t device_address, uint32_t baud)
Allocates a peripheral connected to expansion port A.
Definition: core2forAWS.c:518
void Core2ForAWS_Init(void)
Initializes the power chip with default values, enables battery charging, and initializes all enabled...
Definition: core2forAWS.c:32
esp_err_t Core2ForAWS_Port_C_UART_Begin(uint32_t baud)
Configures the UART interface at the specified baud rate.
Definition: core2forAWS.c:549
Button_t * button_middle
Middle virtual touch button.
Definition: core2forAWS.c:86
esp_err_t Core2ForAWS_SDcard_Unmount(const char *mount_path, sdmmc_card_t *out_card)
Removes the FAT partition and unmounts the SD-Card.
Definition: core2forAWS.c:132
void Core2ForAWS_Sk6812_Show(void)
Updates the LEDs in the LED bars with any new values set using Core2ForAWS_Sk6812_SetColor,...
Definition: core2forAWS.c:252
void Core2ForAWS_Display_Init(void)
Initializes the display.
Definition: core2forAWS.c:280
float Core2ForAWS_PMU_GetBatVolt(void)
Gets the battery voltage with the AXP192.
Definition: core2forAWS.c:160
void Core2ForAWS_Sk6812_SetBrightness(uint8_t brightness)
Sets the brightness of the LED bars.
Definition: core2forAWS.c:248
void Core2ForAWS_Sk6812_SetSideColor(uint8_t side, uint32_t color)
Sets the color of all the LEDs on one side of the LED bars.
Definition: core2forAWS.c:236
void Core2ForAWS_Display_SetBrightness(uint8_t brightness)
Sets the brightness of the display.
Definition: core2forAWS.c:333
void Core2ForAWS_LED_Enable(uint8_t enable)
Turns on or off green LED.
Definition: core2forAWS.c:341
esp_err_t Core2ForAWS_SDcard_Mount(const char *mount_path, sdmmc_card_t **out_card)
Initializes and mounts the SD-Card.
Definition: core2forAWS.c:102
pin_mode_t
Modes supported by the BSP for the GPIO pins.
Definition: core2forAWS.h:212
@ DAC
Enable DAC mode. Only available on Port B—GPIO 26.
Definition: core2forAWS.h:219
@ OUTPUT
Set GPIO to output mode.
Definition: core2forAWS.h:214
@ ADC
Enable ADC mode. Only available on Port B—GPIO 36.
Definition: core2forAWS.h:218
@ I2C
Enable I2C mode. Only available on Port A—GPIO 32(SDA) and Port A—GPIO 33 (SCL).
Definition: core2forAWS.h:216
@ UART
Enable UART RX/TX mode. UART TX only available on Port C—GPIO 14 and UART RX is only available on Por...
Definition: core2forAWS.h:220
@ NONE
Reset GPIO to default state.
Definition: core2forAWS.h:213
@ INPUT
Set GPIO to input mode.
Definition: core2forAWS.h:215
esp_err_t Core2ForAWS_Port_Write(gpio_num_t pin, bool level)
Writes the specified level (0 or 1) to the specified digital pin.
Definition: core2forAWS.c:508
int Core2ForAWS_Port_C_UART_Receive(uint8_t *message_buffer)
Reads messages in the UART2 receiver ring buffer.
Definition: core2forAWS.c:572
esp_err_t Core2ForAWS_Port_A_I2C_Read(I2CDevice_t device, uint32_t register_address, uint8_t *data, uint16_t length)
Reads from I2C peripheral connected to expansion port A.
Definition: core2forAWS.c:522
int Core2ForAWS_Port_C_UART_Send(const char *message, size_t len)
Sends a specified length of a user defined message over UART2.
Definition: core2forAWS.c:568
void Core2ForAWS_Speaker_Enable(bool state)
Enables or disables the NS4168 speaker amplifier.
Definition: core2forAWS.c:153
void Core2ForAWS_Sk6812_Init(void)
Initializes the SK6812 LED bars.
Definition: core2forAWS.c:217
Button_t * button_right
Right virtual touch button.
Definition: core2forAWS.c:87
esp_err_t Core2ForAWS_Port_A_I2C_Write(I2CDevice_t device, uint32_t register_address, uint8_t *data, uint16_t length)
Writes to I2C peripheral connected to expansion port A.
Definition: core2forAWS.c:526
void Core2ForAWS_PMU_Init(uint16_t ldo2_volt, uint16_t ldo3_volt, uint16_t dc2_volt, uint16_t dc3_volt)
Initializes the AXP192 Power Management Unit (PMU).
Definition: core2forAWS.c:178
bool Core2ForAWS_Port_Read(gpio_num_t pin)
Reads the value from a specified digital pin that's set as an input — either 1 (high) or 0 (low).
Definition: core2forAWS.c:502
esp_err_t Core2ForAWS_Port_B_DAC_WriteMilliVolts(uint16_t mvolts)
Outputs the specified voltage (millivolts) to the DAC.
Definition: core2forAWS.c:544
Functions for the FT6336U capacitive touch panel controller.
void * I2CDevice_t
A pointer to the I2C peripheral configuration.
Definition: i2c_device.h:41
Functions for the SPM1423 microphone.
Functions for the MPU6886 inertial measurement unit (IMU).
Functions for the on-board 1W-0928 speaker using the NS4168 power amplifier.