fix(esp32p4): Fix compilation errors (#10371)
* fix(esp32p4): Add missing touchpad definitions * fix(esp32p4): Add missing target in SPI example * fix(esp32p4): Start touch driver fix * fix(esp32p4): Skip touch examples while it is not implemented * fix(esp32p4): Add missing analog pin definitions * refactor(formatting): Fix formatting that was broken in P4 PR * fix(openthread): Add missing targets to skip * fix(esp32p4): Skip ethernet sketches * fix(esp32p4): Disable periman test while touch is not implemented * fix(esp32p4): Disable touch test while touch is not implemented * fix(esp32p4): Fix UART test * fix(esp32p4): Skip Wi-Fi test * fix(esp32): Skip unsupported example * fix(esp32p4): Fix skip files * ci(pre-commit): Apply automatic fixes --------- Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com>
This commit is contained in:
parent
9398d52ddc
commit
4bb287eaf6
31 changed files with 497 additions and 470 deletions
|
|
@ -361,22 +361,20 @@ esp_err_t i2cSlaveInit(uint8_t num, int sda, int scl, uint16_t slaveID, uint32_t
|
||||||
|
|
||||||
if (!i2c->intr_handle) {
|
if (!i2c->intr_handle) {
|
||||||
uint32_t flags = ESP_INTR_FLAG_LOWMED | ESP_INTR_FLAG_SHARED;
|
uint32_t flags = ESP_INTR_FLAG_LOWMED | ESP_INTR_FLAG_SHARED;
|
||||||
#if !defined(CONFIG_IDF_TARGET_ESP32P4)
|
|
||||||
if (i2c->num == 0) {
|
if (i2c->num == 0) {
|
||||||
|
#if !defined(CONFIG_IDF_TARGET_ESP32P4)
|
||||||
ret = esp_intr_alloc(ETS_I2C_EXT0_INTR_SOURCE, flags, &i2c_slave_isr_handler, i2c, &i2c->intr_handle);
|
ret = esp_intr_alloc(ETS_I2C_EXT0_INTR_SOURCE, flags, &i2c_slave_isr_handler, i2c, &i2c->intr_handle);
|
||||||
|
#else
|
||||||
|
ret = esp_intr_alloc(ETS_I2C0_INTR_SOURCE, flags, &i2c_slave_isr_handler, i2c, &i2c->intr_handle);
|
||||||
|
#endif
|
||||||
#if SOC_HP_I2C_NUM > 1
|
#if SOC_HP_I2C_NUM > 1
|
||||||
} else {
|
} else {
|
||||||
|
#if !defined(CONFIG_IDF_TARGET_ESP32P4)
|
||||||
ret = esp_intr_alloc(ETS_I2C_EXT1_INTR_SOURCE, flags, &i2c_slave_isr_handler, i2c, &i2c->intr_handle);
|
ret = esp_intr_alloc(ETS_I2C_EXT1_INTR_SOURCE, flags, &i2c_slave_isr_handler, i2c, &i2c->intr_handle);
|
||||||
#endif
|
#else
|
||||||
#endif // !defined(CONFIG_IDF_TARGET_ESP32P4)
|
|
||||||
#ifdef CONFIG_IDF_TARGET_ESP32P4
|
|
||||||
if (i2c->num == 0) {
|
|
||||||
ret = esp_intr_alloc(ETS_I2C0_INTR_SOURCE, flags, &i2c_slave_isr_handler, i2c, &i2c->intr_handle);
|
|
||||||
#if SOC_I2C_NUM > 1
|
|
||||||
} else {
|
|
||||||
ret = esp_intr_alloc(ETS_I2C1_INTR_SOURCE, flags, &i2c_slave_isr_handler, i2c, &i2c->intr_handle);
|
ret = esp_intr_alloc(ETS_I2C1_INTR_SOURCE, flags, &i2c_slave_isr_handler, i2c, &i2c->intr_handle);
|
||||||
#endif
|
#endif
|
||||||
#endif // #ifdef CONFIG_IDF_TARGET_ESP32P4
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ret != ESP_OK) {
|
if (ret != ESP_OK) {
|
||||||
|
|
@ -402,9 +400,9 @@ fail:
|
||||||
i2c_slave_free_resources(i2c);
|
i2c_slave_free_resources(i2c);
|
||||||
I2C_SLAVE_MUTEX_UNLOCK();
|
I2C_SLAVE_MUTEX_UNLOCK();
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
esp_err_t i2cSlaveDeinit(uint8_t num) {
|
esp_err_t i2cSlaveDeinit(uint8_t num) {
|
||||||
if (num >= SOC_HP_I2C_NUM) {
|
if (num >= SOC_HP_I2C_NUM) {
|
||||||
log_e("Invalid port num: %u", num);
|
log_e("Invalid port num: %u", num);
|
||||||
return ESP_ERR_INVALID_ARG;
|
return ESP_ERR_INVALID_ARG;
|
||||||
|
|
@ -425,9 +423,9 @@ fail:
|
||||||
perimanClearPinBus(sda);
|
perimanClearPinBus(sda);
|
||||||
I2C_SLAVE_MUTEX_UNLOCK();
|
I2C_SLAVE_MUTEX_UNLOCK();
|
||||||
return ESP_OK;
|
return ESP_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t i2cSlaveWrite(uint8_t num, const uint8_t *buf, uint32_t len, uint32_t timeout_ms) {
|
size_t i2cSlaveWrite(uint8_t num, const uint8_t *buf, uint32_t len, uint32_t timeout_ms) {
|
||||||
if (num >= SOC_HP_I2C_NUM) {
|
if (num >= SOC_HP_I2C_NUM) {
|
||||||
log_e("Invalid port num: %u", num);
|
log_e("Invalid port num: %u", num);
|
||||||
return 0;
|
return 0;
|
||||||
|
|
@ -483,13 +481,13 @@ fail:
|
||||||
}
|
}
|
||||||
I2C_SLAVE_MUTEX_UNLOCK();
|
I2C_SLAVE_MUTEX_UNLOCK();
|
||||||
return to_queue + to_fifo;
|
return to_queue + to_fifo;
|
||||||
}
|
}
|
||||||
|
|
||||||
//=====================================================================================================================
|
//=====================================================================================================================
|
||||||
//-------------------------------------- Private Functions ------------------------------------------------------------
|
//-------------------------------------- Private Functions ------------------------------------------------------------
|
||||||
//=====================================================================================================================
|
//=====================================================================================================================
|
||||||
|
|
||||||
static void i2c_slave_free_resources(i2c_slave_struct_t * i2c) {
|
static void i2c_slave_free_resources(i2c_slave_struct_t *i2c) {
|
||||||
i2c_slave_detach_gpio(i2c);
|
i2c_slave_detach_gpio(i2c);
|
||||||
i2c_ll_set_slave_addr(i2c->dev, 0, false);
|
i2c_ll_set_slave_addr(i2c->dev, 0, false);
|
||||||
i2c_ll_disable_intr_mask(i2c->dev, I2C_LL_INTR_MASK);
|
i2c_ll_disable_intr_mask(i2c->dev, I2C_LL_INTR_MASK);
|
||||||
|
|
@ -528,9 +526,9 @@ fail:
|
||||||
}
|
}
|
||||||
|
|
||||||
i2c->rx_data_count = 0;
|
i2c->rx_data_count = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool i2c_slave_set_frequency(i2c_slave_struct_t * i2c, uint32_t clk_speed) {
|
static bool i2c_slave_set_frequency(i2c_slave_struct_t *i2c, uint32_t clk_speed) {
|
||||||
if (i2c == NULL) {
|
if (i2c == NULL) {
|
||||||
log_e("no control buffer");
|
log_e("no control buffer");
|
||||||
return false;
|
return false;
|
||||||
|
|
@ -560,9 +558,9 @@ fail:
|
||||||
i2c_ll_master_set_bus_timing(i2c->dev, &clk_cal);
|
i2c_ll_master_set_bus_timing(i2c->dev, &clk_cal);
|
||||||
i2c_ll_master_set_filter(i2c->dev, 3);
|
i2c_ll_master_set_filter(i2c->dev, 3);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void i2c_slave_delay_us(uint64_t us) {
|
static void i2c_slave_delay_us(uint64_t us) {
|
||||||
uint64_t m = esp_timer_get_time();
|
uint64_t m = esp_timer_get_time();
|
||||||
if (us) {
|
if (us) {
|
||||||
uint64_t e = (m + us);
|
uint64_t e = (m + us);
|
||||||
|
|
@ -571,16 +569,16 @@ fail:
|
||||||
}
|
}
|
||||||
while ((uint64_t)esp_timer_get_time() < e);
|
while ((uint64_t)esp_timer_get_time() < e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void i2c_slave_gpio_mode(int8_t pin, gpio_mode_t mode) {
|
static void i2c_slave_gpio_mode(int8_t pin, gpio_mode_t mode) {
|
||||||
gpio_config_t conf = {
|
gpio_config_t conf = {
|
||||||
.pin_bit_mask = 1LL << pin, .mode = mode, .pull_up_en = GPIO_PULLUP_ENABLE, .pull_down_en = GPIO_PULLDOWN_DISABLE, .intr_type = GPIO_INTR_DISABLE
|
.pin_bit_mask = 1LL << pin, .mode = mode, .pull_up_en = GPIO_PULLUP_ENABLE, .pull_down_en = GPIO_PULLDOWN_DISABLE, .intr_type = GPIO_INTR_DISABLE
|
||||||
};
|
};
|
||||||
gpio_config(&conf);
|
gpio_config(&conf);
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool i2c_slave_check_line_state(int8_t sda, int8_t scl) {
|
static bool i2c_slave_check_line_state(int8_t sda, int8_t scl) {
|
||||||
if (sda < 0 || scl < 0) {
|
if (sda < 0 || scl < 0) {
|
||||||
return false; //return false since there is nothing to do
|
return false; //return false since there is nothing to do
|
||||||
}
|
}
|
||||||
|
|
@ -621,9 +619,9 @@ fail:
|
||||||
return false; // bus is busy
|
return false; // bus is busy
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool i2c_slave_attach_gpio(i2c_slave_struct_t * i2c, int8_t sda, int8_t scl) {
|
static bool i2c_slave_attach_gpio(i2c_slave_struct_t *i2c, int8_t sda, int8_t scl) {
|
||||||
if (i2c == NULL) {
|
if (i2c == NULL) {
|
||||||
log_e("no control block");
|
log_e("no control block");
|
||||||
return false;
|
return false;
|
||||||
|
|
@ -647,9 +645,9 @@ fail:
|
||||||
gpio_matrix_in(sda, I2C_SDA_IDX(i2c->num), false);
|
gpio_matrix_in(sda, I2C_SDA_IDX(i2c->num), false);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool i2c_slave_detach_gpio(i2c_slave_struct_t * i2c) {
|
static bool i2c_slave_detach_gpio(i2c_slave_struct_t *i2c) {
|
||||||
if (i2c == NULL) {
|
if (i2c == NULL) {
|
||||||
log_e("no control Block");
|
log_e("no control Block");
|
||||||
return false;
|
return false;
|
||||||
|
|
@ -667,9 +665,9 @@ fail:
|
||||||
i2c->sda = -1; // un attached
|
i2c->sda = -1; // un attached
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool i2c_slave_send_event(i2c_slave_struct_t * i2c, i2c_slave_queue_event_t * event) {
|
static bool i2c_slave_send_event(i2c_slave_struct_t *i2c, i2c_slave_queue_event_t *event) {
|
||||||
bool pxHigherPriorityTaskWoken = false;
|
bool pxHigherPriorityTaskWoken = false;
|
||||||
if (i2c->event_queue) {
|
if (i2c->event_queue) {
|
||||||
if (xQueueSendFromISR(i2c->event_queue, event, (BaseType_t *const)&pxHigherPriorityTaskWoken) != pdTRUE) {
|
if (xQueueSendFromISR(i2c->event_queue, event, (BaseType_t *const)&pxHigherPriorityTaskWoken) != pdTRUE) {
|
||||||
|
|
@ -677,9 +675,9 @@ fail:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return pxHigherPriorityTaskWoken;
|
return pxHigherPriorityTaskWoken;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool i2c_slave_handle_tx_fifo_empty(i2c_slave_struct_t * i2c) {
|
static bool i2c_slave_handle_tx_fifo_empty(i2c_slave_struct_t *i2c) {
|
||||||
bool pxHigherPriorityTaskWoken = false;
|
bool pxHigherPriorityTaskWoken = false;
|
||||||
uint32_t d = 0, moveCnt = 0;
|
uint32_t d = 0, moveCnt = 0;
|
||||||
i2c_ll_get_txfifo_len(i2c->dev, &moveCnt);
|
i2c_ll_get_txfifo_len(i2c->dev, &moveCnt);
|
||||||
|
|
@ -693,9 +691,9 @@ fail:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return pxHigherPriorityTaskWoken;
|
return pxHigherPriorityTaskWoken;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool i2c_slave_handle_rx_fifo_full(i2c_slave_struct_t * i2c, uint32_t len) {
|
static bool i2c_slave_handle_rx_fifo_full(i2c_slave_struct_t *i2c, uint32_t len) {
|
||||||
#if I2C_SLAVE_USE_RX_QUEUE
|
#if I2C_SLAVE_USE_RX_QUEUE
|
||||||
uint32_t d = 0;
|
uint32_t d = 0;
|
||||||
#else
|
#else
|
||||||
|
|
@ -724,9 +722,9 @@ fail:
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
return pxHigherPriorityTaskWoken;
|
return pxHigherPriorityTaskWoken;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void i2c_slave_isr_handler(void *arg) {
|
static void i2c_slave_isr_handler(void *arg) {
|
||||||
bool pxHigherPriorityTaskWoken = false;
|
bool pxHigherPriorityTaskWoken = false;
|
||||||
i2c_slave_struct_t *i2c = (i2c_slave_struct_t *)arg; // recover data
|
i2c_slave_struct_t *i2c = (i2c_slave_struct_t *)arg; // recover data
|
||||||
|
|
||||||
|
|
@ -803,9 +801,9 @@ fail:
|
||||||
if (pxHigherPriorityTaskWoken) {
|
if (pxHigherPriorityTaskWoken) {
|
||||||
portYIELD_FROM_ISR();
|
portYIELD_FROM_ISR();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static size_t i2c_slave_read_rx(i2c_slave_struct_t * i2c, uint8_t * data, size_t len) {
|
static size_t i2c_slave_read_rx(i2c_slave_struct_t *i2c, uint8_t *data, size_t len) {
|
||||||
if (!len) {
|
if (!len) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
@ -851,9 +849,9 @@ fail:
|
||||||
}
|
}
|
||||||
return (data) ? so_far : 0;
|
return (data) ? so_far : 0;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
static void i2c_slave_task(void *pv_args) {
|
static void i2c_slave_task(void *pv_args) {
|
||||||
i2c_slave_struct_t *i2c = (i2c_slave_struct_t *)pv_args;
|
i2c_slave_struct_t *i2c = (i2c_slave_struct_t *)pv_args;
|
||||||
i2c_slave_queue_event_t event;
|
i2c_slave_queue_event_t event;
|
||||||
size_t len = 0;
|
size_t len = 0;
|
||||||
|
|
@ -886,9 +884,9 @@ fail:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
vTaskDelete(NULL);
|
vTaskDelete(NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool i2cSlaveDetachBus(void *bus_i2c_num) {
|
static bool i2cSlaveDetachBus(void *bus_i2c_num) {
|
||||||
uint8_t num = (int)bus_i2c_num - 1;
|
uint8_t num = (int)bus_i2c_num - 1;
|
||||||
i2c_slave_struct_t *i2c = &_i2c_bus_array[num];
|
i2c_slave_struct_t *i2c = &_i2c_bus_array[num];
|
||||||
if (i2c->scl == -1 && i2c->sda == -1) {
|
if (i2c->scl == -1 && i2c->sda == -1) {
|
||||||
|
|
@ -900,6 +898,6 @@ fail:
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* SOC_I2C_SUPPORT_SLAVE */
|
#endif /* SOC_I2C_SUPPORT_SLAVE */
|
||||||
|
|
|
||||||
|
|
@ -148,13 +148,15 @@ struct spi_struct_t {
|
||||||
#if CONFIG_DISABLE_HAL_LOCKS
|
#if CONFIG_DISABLE_HAL_LOCKS
|
||||||
#define SPI_MUTEX_LOCK()
|
#define SPI_MUTEX_LOCK()
|
||||||
#define SPI_MUTEX_UNLOCK()
|
#define SPI_MUTEX_UNLOCK()
|
||||||
+ static spi_t _spi_bus_array[] = {
|
// clang-format off
|
||||||
|
static spi_t _spi_bus_array[] = {
|
||||||
#if CONFIG_IDF_TARGET_ESP32S2
|
#if CONFIG_IDF_TARGET_ESP32S2
|
||||||
{(volatile spi_dev_t *)(DR_REG_SPI1_BASE), 0, -1, -1, -1, -1},
|
{(volatile spi_dev_t *)(DR_REG_SPI1_BASE), 0, -1, -1, -1, -1},
|
||||||
{(volatile spi_dev_t *)(DR_REG_SPI2_BASE), 1, -1, -1, -1, -1},
|
{(volatile spi_dev_t *)(DR_REG_SPI2_BASE), 1, -1, -1, -1, -1},
|
||||||
{(volatile spi_dev_t *)(DR_REG_SPI3_BASE), 2, -1, -1, -1, -1}
|
{(volatile spi_dev_t *)(DR_REG_SPI3_BASE), 2, -1, -1, -1, -1}
|
||||||
#elif CONFIG_IDF_TARGET_ESP32S3 || CONFIG_IDF_TARGET_ESP32P4
|
#elif CONFIG_IDF_TARGET_ESP32S3 || CONFIG_IDF_TARGET_ESP32P4
|
||||||
{(volatile spi_dev_t *)(DR_REG_SPI2_BASE), 0, -1, -1, -1, -1}, {(volatile spi_dev_t *)(DR_REG_SPI3_BASE), 1, -1, -1, -1, -1}
|
{(volatile spi_dev_t *)(DR_REG_SPI2_BASE), 0, -1, -1, -1, -1},
|
||||||
|
{(volatile spi_dev_t *)(DR_REG_SPI3_BASE), 1, -1, -1, -1, -1}
|
||||||
#elif CONFIG_IDF_TARGET_ESP32C2
|
#elif CONFIG_IDF_TARGET_ESP32C2
|
||||||
{(volatile spi_dev_t *)(DR_REG_SPI2_BASE), 0, -1, -1, -1, -1}
|
{(volatile spi_dev_t *)(DR_REG_SPI2_BASE), 0, -1, -1, -1, -1}
|
||||||
#elif CONFIG_IDF_TARGET_ESP32C3
|
#elif CONFIG_IDF_TARGET_ESP32C3
|
||||||
|
|
@ -168,6 +170,7 @@ struct spi_struct_t {
|
||||||
{(volatile spi_dev_t *)(DR_REG_SPI3_BASE), 3, -1, -1, -1, -1}
|
{(volatile spi_dev_t *)(DR_REG_SPI3_BASE), 3, -1, -1, -1, -1}
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
// clang-format on
|
||||||
#else
|
#else
|
||||||
#define SPI_MUTEX_LOCK() \
|
#define SPI_MUTEX_LOCK() \
|
||||||
do { \
|
do { \
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,7 @@
|
||||||
#if SOC_TOUCH_SENSOR_VERSION == 1 // ESP32
|
#if SOC_TOUCH_SENSOR_VERSION == 1 // ESP32
|
||||||
static uint16_t __touchSleepCycles = 0x1000;
|
static uint16_t __touchSleepCycles = 0x1000;
|
||||||
static uint16_t __touchMeasureCycles = 0x1000;
|
static uint16_t __touchMeasureCycles = 0x1000;
|
||||||
#elif SOC_TOUCH_SENSOR_VERSION == 2 // ESP32S2, ESP32S3
|
#elif SOC_TOUCH_SENSOR_VERSION >= 2 // ESP32S2, ESP32S3, ESP32P4
|
||||||
static uint16_t __touchSleepCycles = TOUCH_PAD_SLEEP_CYCLE_DEFAULT;
|
static uint16_t __touchSleepCycles = TOUCH_PAD_SLEEP_CYCLE_DEFAULT;
|
||||||
static uint16_t __touchMeasureCycles = TOUCH_PAD_MEASURE_CYCLE_DEFAULT;
|
static uint16_t __touchMeasureCycles = TOUCH_PAD_MEASURE_CYCLE_DEFAULT;
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
{
|
{
|
||||||
"targets": {
|
"targets": {
|
||||||
|
"esp32": false,
|
||||||
"esp32p4": false,
|
"esp32p4": false,
|
||||||
"esp32s2": false
|
"esp32s2": false
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,7 @@
|
||||||
{
|
{
|
||||||
"targets": {
|
"targets": {
|
||||||
"esp32": false,
|
"esp32": false,
|
||||||
"esp32c2": false,
|
|
||||||
"esp32c3": false,
|
|
||||||
"esp32p4": false,
|
"esp32p4": false,
|
||||||
"esp32s2": false,
|
"esp32s2": false
|
||||||
"esp32s3": false
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,6 @@
|
||||||
{
|
{
|
||||||
"targets": {
|
"targets": {
|
||||||
"esp32": false,
|
"esp32": false,
|
||||||
"esp32c3": false,
|
|
||||||
"esp32c6": false,
|
|
||||||
"esp32h2": false,
|
|
||||||
"esp32p4": false,
|
"esp32p4": false,
|
||||||
"esp32s2": false
|
"esp32s2": false
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,5 @@
|
||||||
{
|
{
|
||||||
"targets": {
|
"targets": {
|
||||||
"esp32c3": false,
|
|
||||||
"esp32c6": false,
|
|
||||||
"esp32h2": false,
|
|
||||||
"esp32p4": false,
|
"esp32p4": false,
|
||||||
"esp32s2": false
|
"esp32s2": false
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,5 @@
|
||||||
{
|
{
|
||||||
"targets": {
|
"targets": {
|
||||||
"esp32c3": false,
|
|
||||||
"esp32p4": false,
|
"esp32p4": false,
|
||||||
"esp32s2": false
|
"esp32s2": false
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,5 @@
|
||||||
{
|
{
|
||||||
"targets": {
|
"targets": {
|
||||||
"esp32h2": false,
|
|
||||||
"esp32p4": false,
|
"esp32p4": false,
|
||||||
"esp32s2": false
|
"esp32s2": false
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,6 @@
|
||||||
{
|
{
|
||||||
"targets": {
|
"targets": {
|
||||||
"esp32": false,
|
|
||||||
"esp32c2": false,
|
|
||||||
"esp32c3": false,
|
|
||||||
"esp32p4": false,
|
"esp32p4": false,
|
||||||
"esp32s2": false,
|
"esp32s2": false
|
||||||
"esp32s3": false
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,5 @@
|
||||||
{
|
{
|
||||||
"targets": {
|
"targets": {
|
||||||
"esp32": false,
|
|
||||||
"esp32c3": false,
|
|
||||||
"esp32c6": false,
|
|
||||||
"esp32h2": false,
|
|
||||||
"esp32p4": false,
|
"esp32p4": false,
|
||||||
"esp32s2": false
|
"esp32s2": false
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,5 @@
|
||||||
{
|
{
|
||||||
"targets": {
|
"targets": {
|
||||||
"esp32c3": false,
|
|
||||||
"esp32c6": false,
|
|
||||||
"esp32h2": false,
|
|
||||||
"esp32p4": false,
|
"esp32p4": false,
|
||||||
"esp32s2": false
|
"esp32s2": false
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,5 @@
|
||||||
{
|
{
|
||||||
"targets": {
|
"targets": {
|
||||||
"esp32c3": false,
|
|
||||||
"esp32p4": false,
|
"esp32p4": false,
|
||||||
"esp32s2": false
|
"esp32s2": false
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,5 @@
|
||||||
{
|
{
|
||||||
"targets": {
|
"targets": {
|
||||||
"esp32h2": false,
|
|
||||||
"esp32p4": false,
|
"esp32p4": false,
|
||||||
"esp32s2": false
|
"esp32s2": false
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@
|
||||||
"targets": {
|
"targets": {
|
||||||
"esp32c3": false,
|
"esp32c3": false,
|
||||||
"esp32c6": false,
|
"esp32c6": false,
|
||||||
"esp32h2": false
|
"esp32h2": false,
|
||||||
|
"esp32p4": false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@
|
||||||
"esp32c3": false,
|
"esp32c3": false,
|
||||||
"esp32c6": false,
|
"esp32c6": false,
|
||||||
"esp32h2": false,
|
"esp32h2": false,
|
||||||
|
"esp32p4": false,
|
||||||
"esp32s2": false,
|
"esp32s2": false,
|
||||||
"esp32s3": false
|
"esp32s3": false
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@
|
||||||
"esp32": false,
|
"esp32": false,
|
||||||
"esp32c3": false,
|
"esp32c3": false,
|
||||||
"esp32c6": false,
|
"esp32c6": false,
|
||||||
"esp32h2": false
|
"esp32h2": false,
|
||||||
|
"esp32p4": false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@
|
||||||
"targets": {
|
"targets": {
|
||||||
"esp32c3": false,
|
"esp32c3": false,
|
||||||
"esp32c6": false,
|
"esp32c6": false,
|
||||||
"esp32h2": false
|
"esp32h2": false,
|
||||||
|
"esp32p4": false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@
|
||||||
"targets": {
|
"targets": {
|
||||||
"esp32c3": false,
|
"esp32c3": false,
|
||||||
"esp32c6": false,
|
"esp32c6": false,
|
||||||
"esp32h2": false
|
"esp32h2": false,
|
||||||
|
"esp32p4": false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@
|
||||||
"esp32c3": false,
|
"esp32c3": false,
|
||||||
"esp32c6": false,
|
"esp32c6": false,
|
||||||
"esp32h2": false,
|
"esp32h2": false,
|
||||||
|
"esp32p4": false,
|
||||||
"esp32s2": false,
|
"esp32s2": false,
|
||||||
"esp32s3": false
|
"esp32s3": false
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@
|
||||||
"esp32c3": false,
|
"esp32c3": false,
|
||||||
"esp32c6": false,
|
"esp32c6": false,
|
||||||
"esp32h2": false,
|
"esp32h2": false,
|
||||||
|
"esp32p4": false,
|
||||||
"esp32s2": false,
|
"esp32s2": false,
|
||||||
"esp32s3": false
|
"esp32s3": false
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,10 @@
|
||||||
{
|
{
|
||||||
"targets": {
|
"targets": {
|
||||||
"esp32": false,
|
"esp32": false,
|
||||||
|
"esp32c2": false,
|
||||||
"esp32c3": false,
|
"esp32c3": false,
|
||||||
"esp32c6": false,
|
|
||||||
"esp32h2": false,
|
|
||||||
"esp32p4": false,
|
"esp32p4": false,
|
||||||
"esp32s2": false
|
"esp32s2": false,
|
||||||
|
"esp32s3": false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,10 @@
|
||||||
{
|
{
|
||||||
"targets": {
|
"targets": {
|
||||||
|
"esp32": false,
|
||||||
|
"esp32c2": false,
|
||||||
"esp32c3": false,
|
"esp32c3": false,
|
||||||
"esp32c6": false,
|
|
||||||
"esp32h2": false,
|
|
||||||
"esp32p4": false,
|
"esp32p4": false,
|
||||||
"esp32s2": false
|
"esp32s2": false,
|
||||||
|
"esp32s3": false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,10 @@
|
||||||
{
|
{
|
||||||
"targets": {
|
"targets": {
|
||||||
|
"esp32": false,
|
||||||
|
"esp32c2": false,
|
||||||
"esp32c3": false,
|
"esp32c3": false,
|
||||||
"esp32p4": false,
|
"esp32p4": false,
|
||||||
"esp32s2": false
|
"esp32s2": false,
|
||||||
|
"esp32s3": false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,10 @@
|
||||||
{
|
{
|
||||||
"targets": {
|
"targets": {
|
||||||
"esp32h2": false,
|
"esp32": false,
|
||||||
|
"esp32c2": false,
|
||||||
|
"esp32c3": false,
|
||||||
"esp32p4": false,
|
"esp32p4": false,
|
||||||
"esp32s2": false
|
"esp32s2": false,
|
||||||
|
"esp32s3": false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -39,7 +39,7 @@
|
||||||
#define HSPI_SS 15
|
#define HSPI_SS 15
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if CONFIG_IDF_TARGET_ESP32S2 || CONFIG_IDF_TARGET_ESP32S3
|
#if CONFIG_IDF_TARGET_ESP32S2 || CONFIG_IDF_TARGET_ESP32S3 || CONFIG_IDF_TARGET_ESP32P4
|
||||||
#define VSPI FSPI
|
#define VSPI FSPI
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,5 +2,8 @@
|
||||||
"platforms": {
|
"platforms": {
|
||||||
"qemu": false,
|
"qemu": false,
|
||||||
"wokwi": false
|
"wokwi": false
|
||||||
|
},
|
||||||
|
"targets": {
|
||||||
|
"esp32p4": false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,7 @@
|
||||||
"targets": {
|
"targets": {
|
||||||
"esp32c3": false,
|
"esp32c3": false,
|
||||||
"esp32c6": false,
|
"esp32c6": false,
|
||||||
"esp32h2": false
|
"esp32h2": false,
|
||||||
|
"esp32p4": false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -100,7 +100,7 @@ void transmit_and_check_msg(const String msg_append, bool perform_assert = true)
|
||||||
if (perform_assert) {
|
if (perform_assert) {
|
||||||
TEST_ASSERT_EQUAL_STRING(("Hello from Serial1 (UART1) >>> via loopback >>> Serial1 (UART1) " + msg_append).c_str(), recv_msg.c_str());
|
TEST_ASSERT_EQUAL_STRING(("Hello from Serial1 (UART1) >>> via loopback >>> Serial1 (UART1) " + msg_append).c_str(), recv_msg.c_str());
|
||||||
}
|
}
|
||||||
#elif SOC_UART_HP_NUM == 3
|
#elif SOC_UART_HP_NUM >= 3
|
||||||
Serial1.print("Hello from Serial1 (UART1) >>> to >>> Serial2 (UART2) " + msg_append);
|
Serial1.print("Hello from Serial1 (UART1) >>> to >>> Serial2 (UART2) " + msg_append);
|
||||||
Serial1.flush();
|
Serial1.flush();
|
||||||
delay(100);
|
delay(100);
|
||||||
|
|
@ -128,7 +128,7 @@ void task_delayed_msg(void *pvParameters) {
|
||||||
|
|
||||||
#if SOC_UART_HP_NUM == 2
|
#if SOC_UART_HP_NUM == 2
|
||||||
selected_serial = &Serial;
|
selected_serial = &Serial;
|
||||||
#elif SOC_UART_HP_NUM == 3
|
#elif SOC_UART_HP_NUM >= 3
|
||||||
selected_serial = &Serial1;
|
selected_serial = &Serial1;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
@ -150,7 +150,7 @@ void setUp(void) {
|
||||||
onReceive_cb(Serial1);
|
onReceive_cb(Serial1);
|
||||||
});
|
});
|
||||||
uart_internal_loopback(1, RX1);
|
uart_internal_loopback(1, RX1);
|
||||||
#elif SOC_UART_HP_NUM == 3
|
#elif SOC_UART_HP_NUM >= 3
|
||||||
log_d("Setup internal loop-back between Serial1 (UART1) <<--->> Serial2 (UART2)");
|
log_d("Setup internal loop-back between Serial1 (UART1) <<--->> Serial2 (UART2)");
|
||||||
|
|
||||||
Serial1.onReceive([]() {
|
Serial1.onReceive([]() {
|
||||||
|
|
@ -225,7 +225,7 @@ void change_baudrate_test(void) {
|
||||||
Serial1.updateBaudRate(9600);
|
Serial1.updateBaudRate(9600);
|
||||||
TEST_ASSERT_UINT_WITHIN(192, 9600, Serial1.baudRate());
|
TEST_ASSERT_UINT_WITHIN(192, 9600, Serial1.baudRate());
|
||||||
|
|
||||||
#if SOC_UART_HP_NUM == 3
|
#if SOC_UART_HP_NUM >= 3
|
||||||
Serial2.updateBaudRate(9600);
|
Serial2.updateBaudRate(9600);
|
||||||
TEST_ASSERT_UINT_WITHIN(192, 9600, Serial2.baudRate());
|
TEST_ASSERT_UINT_WITHIN(192, 9600, Serial2.baudRate());
|
||||||
#endif
|
#endif
|
||||||
|
|
@ -239,7 +239,7 @@ void change_baudrate_test(void) {
|
||||||
//Baudrate error should be within 2% of the target baudrate
|
//Baudrate error should be within 2% of the target baudrate
|
||||||
TEST_ASSERT_UINT_WITHIN(2304, 115200, Serial1.baudRate());
|
TEST_ASSERT_UINT_WITHIN(2304, 115200, Serial1.baudRate());
|
||||||
|
|
||||||
#if SOC_UART_HP_NUM == 3
|
#if SOC_UART_HP_NUM >= 3
|
||||||
TEST_ASSERT_UINT_WITHIN(2304, 115200, Serial2.baudRate());
|
TEST_ASSERT_UINT_WITHIN(2304, 115200, Serial2.baudRate());
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
@ -421,7 +421,7 @@ void change_pins_test(void) {
|
||||||
|
|
||||||
#if SOC_UART_HP_NUM == 2
|
#if SOC_UART_HP_NUM == 2
|
||||||
esp_rom_gpio_connect_out_signal(SOC_RX0, SIG_GPIO_OUT_IDX, false, false);
|
esp_rom_gpio_connect_out_signal(SOC_RX0, SIG_GPIO_OUT_IDX, false, false);
|
||||||
#elif SOC_UART_HP_NUM == 3
|
#elif SOC_UART_HP_NUM >= 3
|
||||||
esp_rom_gpio_connect_out_signal(RX1, SIG_GPIO_OUT_IDX, false, false);
|
esp_rom_gpio_connect_out_signal(RX1, SIG_GPIO_OUT_IDX, false, false);
|
||||||
esp_rom_gpio_connect_out_signal(RX2, SIG_GPIO_OUT_IDX, false, false);
|
esp_rom_gpio_connect_out_signal(RX2, SIG_GPIO_OUT_IDX, false, false);
|
||||||
#endif
|
#endif
|
||||||
|
|
@ -432,7 +432,7 @@ void change_pins_test(void) {
|
||||||
Serial1.setPins(NEW_RX1, NEW_TX1);
|
Serial1.setPins(NEW_RX1, NEW_TX1);
|
||||||
TEST_ASSERT_EQUAL(NEW_RX1, uart_get_RxPin(1));
|
TEST_ASSERT_EQUAL(NEW_RX1, uart_get_RxPin(1));
|
||||||
TEST_ASSERT_EQUAL(NEW_TX1, uart_get_TxPin(1));
|
TEST_ASSERT_EQUAL(NEW_TX1, uart_get_TxPin(1));
|
||||||
#elif SOC_UART_HP_NUM == 3
|
#elif SOC_UART_HP_NUM >= 3
|
||||||
Serial1.setPins(RX2, TX2);
|
Serial1.setPins(RX2, TX2);
|
||||||
Serial2.setPins(RX1, TX1);
|
Serial2.setPins(RX1, TX1);
|
||||||
TEST_ASSERT_EQUAL(RX2, uart_get_RxPin(1));
|
TEST_ASSERT_EQUAL(RX2, uart_get_RxPin(1));
|
||||||
|
|
@ -447,7 +447,7 @@ void change_pins_test(void) {
|
||||||
|
|
||||||
#if SOC_UART_HP_NUM == 2
|
#if SOC_UART_HP_NUM == 2
|
||||||
uart_internal_loopback(1, NEW_RX1);
|
uart_internal_loopback(1, NEW_RX1);
|
||||||
#elif SOC_UART_HP_NUM == 3
|
#elif SOC_UART_HP_NUM >= 3
|
||||||
uart_internal_loopback(1, RX1);
|
uart_internal_loopback(1, RX1);
|
||||||
uart_internal_loopback(2, RX2);
|
uart_internal_loopback(2, RX2);
|
||||||
#endif
|
#endif
|
||||||
|
|
@ -470,7 +470,7 @@ void auto_baudrate_test(void) {
|
||||||
#if SOC_UART_HP_NUM == 2
|
#if SOC_UART_HP_NUM == 2
|
||||||
selected_serial = &Serial1;
|
selected_serial = &Serial1;
|
||||||
uart_internal_loopback(0, RX1);
|
uart_internal_loopback(0, RX1);
|
||||||
#elif SOC_UART_HP_NUM == 3
|
#elif SOC_UART_HP_NUM >= 3
|
||||||
selected_serial = &Serial2;
|
selected_serial = &Serial2;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
@ -504,7 +504,7 @@ void periman_test(void) {
|
||||||
|
|
||||||
Wire.begin(RX1, TX1);
|
Wire.begin(RX1, TX1);
|
||||||
|
|
||||||
#if SOC_UART_HP_NUM == 3
|
#if SOC_UART_HP_NUM >= 3
|
||||||
Wire1.begin(RX2, TX2);
|
Wire1.begin(RX2, TX2);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
@ -518,7 +518,7 @@ void periman_test(void) {
|
||||||
|
|
||||||
Serial1.setPins(RX1, TX1);
|
Serial1.setPins(RX1, TX1);
|
||||||
|
|
||||||
#if SOC_UART_HP_NUM == 3
|
#if SOC_UART_HP_NUM >= 3
|
||||||
Serial2.setPins(RX2, TX2);
|
Serial2.setPins(RX2, TX2);
|
||||||
uart_internal_loopback(1, RX2);
|
uart_internal_loopback(1, RX2);
|
||||||
uart_internal_loopback(2, RX1);
|
uart_internal_loopback(2, RX1);
|
||||||
|
|
@ -577,7 +577,7 @@ void setup() {
|
||||||
onReceive_cb(Serial1);
|
onReceive_cb(Serial1);
|
||||||
});
|
});
|
||||||
uart_internal_loopback(1, RX1);
|
uart_internal_loopback(1, RX1);
|
||||||
#elif SOC_UART_HP_NUM == 3
|
#elif SOC_UART_HP_NUM >= 3
|
||||||
log_d("Setup internal loop-back between Serial1 (UART1) <<--->> Serial2 (UART2)");
|
log_d("Setup internal loop-back between Serial1 (UART1) <<--->> Serial2 (UART2)");
|
||||||
|
|
||||||
Serial1.onReceive([]() {
|
Serial1.onReceive([]() {
|
||||||
|
|
|
||||||
|
|
@ -22,6 +22,7 @@
|
||||||
"qemu": false
|
"qemu": false
|
||||||
},
|
},
|
||||||
"targets": {
|
"targets": {
|
||||||
"esp32h2": false
|
"esp32h2": false,
|
||||||
|
"esp32p4": false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -27,4 +27,34 @@ static const uint8_t MOSI = 11;
|
||||||
static const uint8_t MISO = 12;
|
static const uint8_t MISO = 12;
|
||||||
static const uint8_t SCK = 13;
|
static const uint8_t SCK = 13;
|
||||||
|
|
||||||
|
static const uint8_t A0 = 16;
|
||||||
|
static const uint8_t A1 = 17;
|
||||||
|
static const uint8_t A2 = 18;
|
||||||
|
static const uint8_t A3 = 19;
|
||||||
|
static const uint8_t A4 = 20;
|
||||||
|
static const uint8_t A5 = 21;
|
||||||
|
static const uint8_t A6 = 22;
|
||||||
|
static const uint8_t A7 = 23;
|
||||||
|
static const uint8_t A8 = 49;
|
||||||
|
static const uint8_t A9 = 50;
|
||||||
|
static const uint8_t A10 = 51;
|
||||||
|
static const uint8_t A11 = 52;
|
||||||
|
static const uint8_t A12 = 53;
|
||||||
|
static const uint8_t A13 = 54;
|
||||||
|
|
||||||
|
static const uint8_t T0 = 2;
|
||||||
|
static const uint8_t T1 = 3;
|
||||||
|
static const uint8_t T2 = 4;
|
||||||
|
static const uint8_t T3 = 5;
|
||||||
|
static const uint8_t T4 = 6;
|
||||||
|
static const uint8_t T5 = 7;
|
||||||
|
static const uint8_t T6 = 8;
|
||||||
|
static const uint8_t T7 = 9;
|
||||||
|
static const uint8_t T8 = 10;
|
||||||
|
static const uint8_t T9 = 11;
|
||||||
|
static const uint8_t T10 = 12;
|
||||||
|
static const uint8_t T11 = 13;
|
||||||
|
static const uint8_t T12 = 14;
|
||||||
|
static const uint8_t T13 = 15;
|
||||||
|
|
||||||
#endif /* Pins_Arduino_h */
|
#endif /* Pins_Arduino_h */
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue