From fc59bd2fdb1b3526093ea8772957a345e52739fe Mon Sep 17 00:00:00 2001 From: kangping Date: Wed, 3 Mar 2021 00:07:19 +0800 Subject: [PATCH] [3rd-party] update openthread and ot-br-posix (#5062) * [3rd-party] update openthread and ot-br-posix * add platform API implementations for qorvo devcies * update otbr to include fixes * add documentation * EFR32 Fix * Restyled by whitespace * Restyled by clang-format * Restyled by gn Co-authored-by: jepenven-silabs Co-authored-by: Restyled.io --- examples/lock-app/k32w/main/main.cpp | 4 - .../efr32/efr32mg12/BRD4161A/hal-config.h | 405 +++++++++++++++- .../efr32/efr32mg12/BRD4161A/init_board.c | 2 +- .../efr32/efr32mg12/BRD4163A/hal-config.h | 404 +++++++++++++++- .../efr32/efr32mg12/BRD4163A/init_board.c | 2 +- .../efr32/efr32mg12/BRD4164A/hal-config.h | 404 +++++++++++++++- .../efr32/efr32mg12/BRD4164A/init_board.c | 2 +- .../efr32/efr32mg12/BRD4166A/hal-config.h | 445 +++++++++++++++++- .../efr32/efr32mg12/BRD4166A/init_board.c | 2 +- .../efr32/efr32mg12/BRD4170A/hal-config.h | 374 ++++++++++++++- .../efr32/efr32mg12/BRD4170A/init_board.c | 2 +- .../efr32/efr32mg12/BRD4304A/hal-config.h | 380 ++++++++++++++- .../efr32/efr32mg12/BRD4304A/init_board.c | 2 +- .../efr32/efr32mg21/BRD4180A/hal-config.h | 235 ++++++++- .../efr32/efr32mg21/BRD4180A/init_board.c | 2 +- examples/platform/efr32/init_otSystem.c | 2 - examples/platform/efr32/uart.c | 1 - src/platform/EFR32/ThreadStackManagerImpl.cpp | 12 + .../cc13x2_26x2/ThreadStackManagerImpl.cpp | 1 - src/platform/qpg6100/Logging.cpp | 19 + .../qpg6100/ThreadStackManagerImpl.cpp | 2 - third_party/efr32_sdk/efr32_sdk.gni | 24 +- third_party/openthread/repo | 2 +- third_party/ot-br-posix/repo | 2 +- 24 files changed, 2693 insertions(+), 37 deletions(-) diff --git a/examples/lock-app/k32w/main/main.cpp b/examples/lock-app/k32w/main/main.cpp index 8b00c165adf771..c3445cc4e1ade8 100644 --- a/examples/lock-app/k32w/main/main.cpp +++ b/examples/lock-app/k32w/main/main.cpp @@ -75,10 +75,6 @@ extern "C" void main_task(void const * argument) K32W_LOG("Welcome to NXP ELock Demo App"); - /* Using OT Heap is deprecated so use instead the FreeRTOS - * allocation system - which is also thread-safe */ - otHeapSetCAllocFree(pvPortCallocRtos, vPortFree); - /* Mbedtls Threading support is needed because both * Thread and Weave tasks are using it */ freertos_mbedtls_mutex_init(); diff --git a/examples/platform/efr32/efr32mg12/BRD4161A/hal-config.h b/examples/platform/efr32/efr32mg12/BRD4161A/hal-config.h index 0ae229e7fd8df0..b2cd2938508850 100644 --- a/examples/platform/efr32/efr32mg12/BRD4161A/hal-config.h +++ b/examples/platform/efr32/efr32mg12/BRD4161A/hal-config.h @@ -32,12 +32,12 @@ * ******************************************************************************/ -#ifndef HAL_CONFIG_H -#define HAL_CONFIG_H +#pragma once #include "board_features.h" +#include "em_device.h" #include "hal-config-app-common.h" -#include "hal-config-board.h" +#include "hal-config-types.h" #ifndef HAL_VCOM_ENABLE #define HAL_VCOM_ENABLE (0) @@ -97,4 +97,403 @@ #define HAL_USART0_TX_QUEUE_SIZE (128) #define HAL_USART0_FLOW_CONTROL (HAL_USART_FLOW_CONTROL_NONE) +// $[BTL_BUTTON] + +#define BSP_BTL_BUTTON_PIN (6U) +#define BSP_BTL_BUTTON_PORT (gpioPortF) + +// [BTL_BUTTON]$ + +// $[BUTTON] +#define BSP_BUTTON_PRESENT (1) + +#define BSP_BUTTON0_PIN (6U) +#define BSP_BUTTON0_PORT (gpioPortF) + +#define BSP_BUTTON1_PIN (7U) +#define BSP_BUTTON1_PORT (gpioPortF) + +#define BSP_BUTTON_COUNT (2U) +#define BSP_BUTTON_INIT \ + { \ + { BSP_BUTTON0_PORT, BSP_BUTTON0_PIN }, { BSP_BUTTON1_PORT, BSP_BUTTON1_PIN } \ + } +#define BSP_BUTTON_GPIO_DOUT (HAL_GPIO_DOUT_LOW) +#define BSP_BUTTON_GPIO_MODE (HAL_GPIO_MODE_INPUT) +// [BUTTON]$ + +// $[CMU] +#define BSP_CLK_HFXO_PRESENT (1) +#define BSP_CLK_HFXO_FREQ (38400000UL) +#define BSP_CLK_HFXO_INIT CMU_HFXOINIT_DEFAULT +#define BSP_CLK_HFXO_CTUNE (327) +#define BSP_CLK_LFXO_PRESENT (1) +#define BSP_CLK_LFXO_INIT CMU_LFXOINIT_DEFAULT +#define BSP_CLK_LFXO_FREQ (32768U) +#define BSP_CLK_LFXO_CTUNE (32U) +// [CMU]$ + +// $[DCDC] +#define BSP_DCDC_PRESENT (1) + +#define BSP_DCDC_INIT EMU_DCDCINIT_DEFAULT +// [DCDC]$ + +// $[EXTFLASH] +#define BSP_EXTFLASH_CS_PIN (4U) +#define BSP_EXTFLASH_CS_PORT (gpioPortA) + +#define BSP_EXTFLASH_INTERNAL (0) +#define BSP_EXTFLASH_USART (HAL_SPI_PORT_USART1) +#define BSP_EXTFLASH_MOSI_PIN (6U) +#define BSP_EXTFLASH_MOSI_PORT (gpioPortC) +#define BSP_EXTFLASH_MOSI_LOC (11U) + +#define BSP_EXTFLASH_MISO_PIN (7U) +#define BSP_EXTFLASH_MISO_PORT (gpioPortC) +#define BSP_EXTFLASH_MISO_LOC (11U) + +#define BSP_EXTFLASH_CLK_PIN (8U) +#define BSP_EXTFLASH_CLK_PORT (gpioPortC) +#define BSP_EXTFLASH_CLK_LOC (11U) + +// [EXTFLASH]$ + +// $[GPIO] +#define PORTIO_GPIO_SWV_PIN (2U) +#define PORTIO_GPIO_SWV_PORT (gpioPortF) +#define PORTIO_GPIO_SWV_LOC (0U) + +#define BSP_TRACE_SWO_PIN (2U) +#define BSP_TRACE_SWO_PORT (gpioPortF) +#define BSP_TRACE_SWO_LOC (0U) + +// [GPIO]$ + +// $[I2C0] +#define PORTIO_I2C0_SCL_PIN (10U) +#define PORTIO_I2C0_SCL_PORT (gpioPortC) +#define PORTIO_I2C0_SCL_LOC (14U) + +#define PORTIO_I2C0_SDA_PIN (11U) +#define PORTIO_I2C0_SDA_PORT (gpioPortC) +#define PORTIO_I2C0_SDA_LOC (16U) + +#define BSP_I2C0_SCL_PIN (10U) +#define BSP_I2C0_SCL_PORT (gpioPortC) +#define BSP_I2C0_SCL_LOC (14U) + +#define BSP_I2C0_SDA_PIN (11U) +#define BSP_I2C0_SDA_PORT (gpioPortC) +#define BSP_I2C0_SDA_LOC (16U) + +// [I2C0]$ + +// $[I2CSENSOR] + +#define BSP_I2CSENSOR_ENABLE_PIN (10U) +#define BSP_I2CSENSOR_ENABLE_PORT (gpioPortB) + +#define BSP_I2CSENSOR_PERIPHERAL (HAL_I2C_PORT_I2C0) +#define BSP_I2CSENSOR_SCL_PIN (10U) +#define BSP_I2CSENSOR_SCL_PORT (gpioPortC) +#define BSP_I2CSENSOR_SCL_LOC (14U) + +#define BSP_I2CSENSOR_SDA_PIN (11U) +#define BSP_I2CSENSOR_SDA_PORT (gpioPortC) +#define BSP_I2CSENSOR_SDA_LOC (16U) + +// [I2CSENSOR]$ + +// $[LED] +#define BSP_LED_PRESENT (1) + +#define BSP_LED0_PIN (4U) +#define BSP_LED0_PORT (gpioPortF) + +#define BSP_LED1_PIN (5U) +#define BSP_LED1_PORT (gpioPortF) + +#define BSP_LED_COUNT (2U) +#define BSP_LED_INIT \ + { \ + { BSP_LED0_PORT, BSP_LED0_PIN }, { BSP_LED1_PORT, BSP_LED1_PIN } \ + } +#define BSP_LED_POLARITY (1) +// [LED]$ + +// $[PA] + +#define BSP_PA_VOLTAGE (3300U) +// [PA]$ + +// $[PRS] +#define PORTIO_PRS_CH4_PIN (13U) +#define PORTIO_PRS_CH4_PORT (gpioPortD) +#define PORTIO_PRS_CH4_LOC (4U) + +// [PRS]$ + +// $[PTI] +#define PORTIO_PTI_DFRAME_PIN (13U) +#define PORTIO_PTI_DFRAME_PORT (gpioPortB) +#define PORTIO_PTI_DFRAME_LOC (6U) + +#define PORTIO_PTI_DOUT_PIN (12U) +#define PORTIO_PTI_DOUT_PORT (gpioPortB) +#define PORTIO_PTI_DOUT_LOC (6U) + +#define BSP_PTI_DFRAME_PIN (13U) +#define BSP_PTI_DFRAME_PORT (gpioPortB) +#define BSP_PTI_DFRAME_LOC (6U) + +#define BSP_PTI_DOUT_PIN (12U) +#define BSP_PTI_DOUT_PORT (gpioPortB) +#define BSP_PTI_DOUT_LOC (6U) + +// [PTI]$ + +// $[SERIAL] +#define BSP_SERIAL_APP_TX_PIN (0U) +#define BSP_SERIAL_APP_TX_PORT (gpioPortA) +#define BSP_SERIAL_APP_TX_LOC (0U) + +#define BSP_SERIAL_APP_RX_PIN (1U) +#define BSP_SERIAL_APP_RX_PORT (gpioPortA) +#define BSP_SERIAL_APP_RX_LOC (0U) + +#define BSP_SERIAL_APP_CTS_PIN (2U) +#define BSP_SERIAL_APP_CTS_PORT (gpioPortA) +#define BSP_SERIAL_APP_CTS_LOC (30U) + +#define BSP_SERIAL_APP_RTS_PIN (3U) +#define BSP_SERIAL_APP_RTS_PORT (gpioPortA) +#define BSP_SERIAL_APP_RTS_LOC (30U) + +// [SERIAL]$ + +// $[SPIDISPLAY] + +#define BSP_SPIDISPLAY_CS_PIN (14U) +#define BSP_SPIDISPLAY_CS_PORT (gpioPortD) + +#define BSP_SPIDISPLAY_ENABLE_PIN (15U) +#define BSP_SPIDISPLAY_ENABLE_PORT (gpioPortD) + +#define BSP_SPIDISPLAY_EXTCOMIN_PIN (13U) +#define BSP_SPIDISPLAY_EXTCOMIN_PORT (gpioPortD) +#define BSP_SPIDISPLAY_EXTCOMIN_LOC (4U) + +#define BSP_SPIDISPLAY_DISPLAY (HAL_DISPLAY_SHARP_LS013B7DH03) +#define BSP_SPIDISPLAY_USART (HAL_SPI_PORT_USART1) +#define BSP_SPIDISPLAY_EXTCOMIN_CHANNEL (4) +#define BSP_SPIDISPLAY_MOSI_PIN (6U) +#define BSP_SPIDISPLAY_MOSI_PORT (gpioPortC) +#define BSP_SPIDISPLAY_MOSI_LOC (11U) + +#define BSP_SPIDISPLAY_MISO_PIN (7U) +#define BSP_SPIDISPLAY_MISO_PORT (gpioPortC) +#define BSP_SPIDISPLAY_MISO_LOC (11U) + +#define BSP_SPIDISPLAY_CLK_PIN (8U) +#define BSP_SPIDISPLAY_CLK_PORT (gpioPortC) +#define BSP_SPIDISPLAY_CLK_LOC (11U) + +// [SPIDISPLAY]$ + +// $[SPINCP] +#define BSP_SPINCP_NHOSTINT_PIN (10U) +#define BSP_SPINCP_NHOSTINT_PORT (gpioPortD) + +#define BSP_SPINCP_NWAKE_PIN (11U) +#define BSP_SPINCP_NWAKE_PORT (gpioPortD) + +#define BSP_SPINCP_USART_PORT (HAL_SPI_PORT_USART2) +#define BSP_SPINCP_MOSI_PIN (6U) +#define BSP_SPINCP_MOSI_PORT (gpioPortA) +#define BSP_SPINCP_MOSI_LOC (1U) + +#define BSP_SPINCP_MISO_PIN (7U) +#define BSP_SPINCP_MISO_PORT (gpioPortA) +#define BSP_SPINCP_MISO_LOC (1U) + +#define BSP_SPINCP_CLK_PIN (8U) +#define BSP_SPINCP_CLK_PORT (gpioPortA) +#define BSP_SPINCP_CLK_LOC (1U) + +#define BSP_SPINCP_CS_PIN (9U) +#define BSP_SPINCP_CS_PORT (gpioPortA) +#define BSP_SPINCP_CS_LOC (1U) + +// [SPINCP]$ + +// $[UARTNCP] +#define BSP_UARTNCP_USART_PORT (HAL_SERIAL_PORT_USART0) +#define BSP_UARTNCP_TX_PIN (0U) +#define BSP_UARTNCP_TX_PORT (gpioPortA) +#define BSP_UARTNCP_TX_LOC (0U) + +#define BSP_UARTNCP_RX_PIN (1U) +#define BSP_UARTNCP_RX_PORT (gpioPortA) +#define BSP_UARTNCP_RX_LOC (0U) + +#define BSP_UARTNCP_CTS_PIN (2U) +#define BSP_UARTNCP_CTS_PORT (gpioPortA) +#define BSP_UARTNCP_CTS_LOC (30U) + +#define BSP_UARTNCP_RTS_PIN (3U) +#define BSP_UARTNCP_RTS_PORT (gpioPortA) +#define BSP_UARTNCP_RTS_LOC (30U) + +// [UARTNCP]$ + +// $[USART0] +#define PORTIO_USART0_CTS_PIN (2U) +#define PORTIO_USART0_CTS_PORT (gpioPortA) +#define PORTIO_USART0_CTS_LOC (30U) + +#define PORTIO_USART0_RTS_PIN (3U) +#define PORTIO_USART0_RTS_PORT (gpioPortA) +#define PORTIO_USART0_RTS_LOC (30U) + +#define PORTIO_USART0_RX_PIN (1U) +#define PORTIO_USART0_RX_PORT (gpioPortA) +#define PORTIO_USART0_RX_LOC (0U) + +#define PORTIO_USART0_TX_PIN (0U) +#define PORTIO_USART0_TX_PORT (gpioPortA) +#define PORTIO_USART0_TX_LOC (0U) + +#define BSP_USART0_TX_PIN (0U) +#define BSP_USART0_TX_PORT (gpioPortA) +#define BSP_USART0_TX_LOC (0U) + +#define BSP_USART0_RX_PIN (1U) +#define BSP_USART0_RX_PORT (gpioPortA) +#define BSP_USART0_RX_LOC (0U) + +#define BSP_USART0_CTS_PIN (2U) +#define BSP_USART0_CTS_PORT (gpioPortA) +#define BSP_USART0_CTS_LOC (30U) + +#define BSP_USART0_RTS_PIN (3U) +#define BSP_USART0_RTS_PORT (gpioPortA) +#define BSP_USART0_RTS_LOC (30U) + +// [USART0]$ + +// $[USART1] +#define PORTIO_USART1_CLK_PIN (8U) +#define PORTIO_USART1_CLK_PORT (gpioPortC) +#define PORTIO_USART1_CLK_LOC (11U) + +#define PORTIO_USART1_CS_PIN (9U) +#define PORTIO_USART1_CS_PORT (gpioPortC) +#define PORTIO_USART1_CS_LOC (11U) + +#define PORTIO_USART1_RX_PIN (7U) +#define PORTIO_USART1_RX_PORT (gpioPortC) +#define PORTIO_USART1_RX_LOC (11U) + +#define PORTIO_USART1_TX_PIN (6U) +#define PORTIO_USART1_TX_PORT (gpioPortC) +#define PORTIO_USART1_TX_LOC (11U) + +#define BSP_USART1_MOSI_PIN (6U) +#define BSP_USART1_MOSI_PORT (gpioPortC) +#define BSP_USART1_MOSI_LOC (11U) + +#define BSP_USART1_MISO_PIN (7U) +#define BSP_USART1_MISO_PORT (gpioPortC) +#define BSP_USART1_MISO_LOC (11U) + +#define BSP_USART1_CLK_PIN (8U) +#define BSP_USART1_CLK_PORT (gpioPortC) +#define BSP_USART1_CLK_LOC (11U) + +#define BSP_USART1_CS_PIN (9U) +#define BSP_USART1_CS_PORT (gpioPortC) +#define BSP_USART1_CS_LOC (11U) + +// [USART1]$ + +// $[USART2] +#define PORTIO_USART2_CLK_PIN (8U) +#define PORTIO_USART2_CLK_PORT (gpioPortA) +#define PORTIO_USART2_CLK_LOC (1U) + +#define PORTIO_USART2_CS_PIN (9U) +#define PORTIO_USART2_CS_PORT (gpioPortA) +#define PORTIO_USART2_CS_LOC (1U) + +#define PORTIO_USART2_RX_PIN (7U) +#define PORTIO_USART2_RX_PORT (gpioPortA) +#define PORTIO_USART2_RX_LOC (1U) + +#define PORTIO_USART2_TX_PIN (6U) +#define PORTIO_USART2_TX_PORT (gpioPortA) +#define PORTIO_USART2_TX_LOC (1U) + +#define BSP_USART2_MOSI_PIN (6U) +#define BSP_USART2_MOSI_PORT (gpioPortA) +#define BSP_USART2_MOSI_LOC (1U) + +#define BSP_USART2_MISO_PIN (7U) +#define BSP_USART2_MISO_PORT (gpioPortA) +#define BSP_USART2_MISO_LOC (1U) + +#define BSP_USART2_CLK_PIN (8U) +#define BSP_USART2_CLK_PORT (gpioPortA) +#define BSP_USART2_CLK_LOC (1U) + +#define BSP_USART2_CS_PIN (9U) +#define BSP_USART2_CS_PORT (gpioPortA) +#define BSP_USART2_CS_LOC (1U) + +// [USART2]$ + +// $[USART3] +#define PORTIO_USART3_CTS_PIN (8U) +#define PORTIO_USART3_CTS_PORT (gpioPortD) +#define PORTIO_USART3_CTS_LOC (28U) + +#define PORTIO_USART3_RTS_PIN (9U) +#define PORTIO_USART3_RTS_PORT (gpioPortD) +#define PORTIO_USART3_RTS_LOC (28U) + +#define PORTIO_USART3_RX_PIN (7U) +#define PORTIO_USART3_RX_PORT (gpioPortB) +#define PORTIO_USART3_RX_LOC (10U) + +#define PORTIO_USART3_TX_PIN (6U) +#define PORTIO_USART3_TX_PORT (gpioPortB) +#define PORTIO_USART3_TX_LOC (10U) + +#define BSP_USART3_TX_PIN (6U) +#define BSP_USART3_TX_PORT (gpioPortB) +#define BSP_USART3_TX_LOC (10U) + +#define BSP_USART3_RX_PIN (7U) +#define BSP_USART3_RX_PORT (gpioPortB) +#define BSP_USART3_RX_LOC (10U) + +#define BSP_USART3_CTS_PIN (8U) +#define BSP_USART3_CTS_PORT (gpioPortD) +#define BSP_USART3_CTS_LOC (28U) + +#define BSP_USART3_RTS_PIN (9U) +#define BSP_USART3_RTS_PORT (gpioPortD) +#define BSP_USART3_RTS_LOC (28U) + +// [USART3]$ + +// $[VCOM] + +#define BSP_VCOM_ENABLE_PIN (5U) +#define BSP_VCOM_ENABLE_PORT (gpioPortA) + +// [VCOM]$ + +#if defined(_SILICON_LABS_MODULE) +#include "sl_module.h" #endif diff --git a/examples/platform/efr32/efr32mg12/BRD4161A/init_board.c b/examples/platform/efr32/efr32mg12/BRD4161A/init_board.c index 517408d5ccd795..5d9e956849fd2e 100644 --- a/examples/platform/efr32/efr32mg12/BRD4161A/init_board.c +++ b/examples/platform/efr32/efr32mg12/BRD4161A/init_board.c @@ -41,7 +41,7 @@ #include "board_features.h" #include "em_cmu.h" -#include "hal-config-board.h" +#include "hal-config.h" #include "em_cmu.h" diff --git a/examples/platform/efr32/efr32mg12/BRD4163A/hal-config.h b/examples/platform/efr32/efr32mg12/BRD4163A/hal-config.h index ec9090550ca02d..97b7062567cee3 100644 --- a/examples/platform/efr32/efr32mg12/BRD4163A/hal-config.h +++ b/examples/platform/efr32/efr32mg12/BRD4163A/hal-config.h @@ -35,8 +35,9 @@ #pragma once #include "board_features.h" +#include "em_device.h" #include "hal-config-app-common.h" -#include "hal-config-board.h" +#include "hal-config-types.h" #define HAL_BUTTON_COUNT (2U) #define HAL_BUTTON_ENABLE \ @@ -101,3 +102,404 @@ #define HAL_USART1_FREQUENCY (1000000UL) #define HAL_VCOM_ENABLE (1) + +// $[BTL_BUTTON] + +#define BSP_BTL_BUTTON_PIN (6U) +#define BSP_BTL_BUTTON_PORT (gpioPortF) + +// [BTL_BUTTON]$ + +// $[BUTTON] +#define BSP_BUTTON_PRESENT (1) + +#define BSP_BUTTON0_PIN (6U) +#define BSP_BUTTON0_PORT (gpioPortF) + +#define BSP_BUTTON1_PIN (7U) +#define BSP_BUTTON1_PORT (gpioPortF) + +#define BSP_BUTTON_COUNT (2U) +#define BSP_BUTTON_INIT \ + { \ + { BSP_BUTTON0_PORT, BSP_BUTTON0_PIN }, { BSP_BUTTON1_PORT, BSP_BUTTON1_PIN } \ + } +#define BSP_BUTTON_GPIO_DOUT (HAL_GPIO_DOUT_LOW) +#define BSP_BUTTON_GPIO_MODE (HAL_GPIO_MODE_INPUT) +// [BUTTON]$ + +// $[CMU] +#define BSP_CLK_HFXO_PRESENT (1) +#define BSP_CLK_HFXO_FREQ (38400000UL) +#define BSP_CLK_HFXO_INIT CMU_HFXOINIT_DEFAULT +#define BSP_CLK_HFXO_CTUNE (331) +#define BSP_CLK_LFXO_PRESENT (1) +#define BSP_CLK_LFXO_INIT CMU_LFXOINIT_DEFAULT +#define BSP_CLK_LFXO_FREQ (32768U) +#define BSP_CLK_LFXO_CTUNE (32U) +// [CMU]$ + +// $[DCDC] +#define BSP_DCDC_PRESENT (1) + +#define BSP_DCDC_INIT EMU_DCDCINIT_DEFAULT +// [DCDC]$ + +// $[EXTFLASH] +#define BSP_EXTFLASH_CS_PIN (4U) +#define BSP_EXTFLASH_CS_PORT (gpioPortA) + +#define BSP_EXTFLASH_INTERNAL (0) +#define BSP_EXTFLASH_USART (HAL_SPI_PORT_USART1) +#define BSP_EXTFLASH_MOSI_PIN (6U) +#define BSP_EXTFLASH_MOSI_PORT (gpioPortC) +#define BSP_EXTFLASH_MOSI_LOC (11U) + +#define BSP_EXTFLASH_MISO_PIN (7U) +#define BSP_EXTFLASH_MISO_PORT (gpioPortC) +#define BSP_EXTFLASH_MISO_LOC (11U) + +#define BSP_EXTFLASH_CLK_PIN (8U) +#define BSP_EXTFLASH_CLK_PORT (gpioPortC) +#define BSP_EXTFLASH_CLK_LOC (11U) + +// [EXTFLASH]$ + +// $[GPIO] +#define PORTIO_GPIO_SWV_PIN (2U) +#define PORTIO_GPIO_SWV_PORT (gpioPortF) +#define PORTIO_GPIO_SWV_LOC (0U) + +#define BSP_TRACE_SWO_PIN (2U) +#define BSP_TRACE_SWO_PORT (gpioPortF) +#define BSP_TRACE_SWO_LOC (0U) + +// [GPIO]$ + +// $[I2C0] +#define PORTIO_I2C0_SCL_PIN (10U) +#define PORTIO_I2C0_SCL_PORT (gpioPortC) +#define PORTIO_I2C0_SCL_LOC (14U) + +#define PORTIO_I2C0_SDA_PIN (11U) +#define PORTIO_I2C0_SDA_PORT (gpioPortC) +#define PORTIO_I2C0_SDA_LOC (16U) + +#define BSP_I2C0_SCL_PIN (10U) +#define BSP_I2C0_SCL_PORT (gpioPortC) +#define BSP_I2C0_SCL_LOC (14U) + +#define BSP_I2C0_SDA_PIN (11U) +#define BSP_I2C0_SDA_PORT (gpioPortC) +#define BSP_I2C0_SDA_LOC (16U) + +// [I2C0]$ + +// $[I2CSENSOR] + +#define BSP_I2CSENSOR_ENABLE_PIN (10U) +#define BSP_I2CSENSOR_ENABLE_PORT (gpioPortB) + +#define BSP_I2CSENSOR_PERIPHERAL (HAL_I2C_PORT_I2C0) +#define BSP_I2CSENSOR_SCL_PIN (10U) +#define BSP_I2CSENSOR_SCL_PORT (gpioPortC) +#define BSP_I2CSENSOR_SCL_LOC (14U) + +#define BSP_I2CSENSOR_SDA_PIN (11U) +#define BSP_I2CSENSOR_SDA_PORT (gpioPortC) +#define BSP_I2CSENSOR_SDA_LOC (16U) + +// [I2CSENSOR]$ + +// $[LED] +#define BSP_LED_PRESENT (1) + +#define BSP_LED0_PIN (4U) +#define BSP_LED0_PORT (gpioPortF) + +#define BSP_LED1_PIN (5U) +#define BSP_LED1_PORT (gpioPortF) + +#define BSP_LED_COUNT (2U) +#define BSP_LED_INIT \ + { \ + { BSP_LED0_PORT, BSP_LED0_PIN }, { BSP_LED1_PORT, BSP_LED1_PIN } \ + } +#define BSP_LED_POLARITY (1) +// [LED]$ + +// $[PA] + +#define BSP_PA_VOLTAGE (1800U) +// [PA]$ + +// $[PRS] +#define PORTIO_PRS_CH4_PIN (13U) +#define PORTIO_PRS_CH4_PORT (gpioPortD) +#define PORTIO_PRS_CH4_LOC (4U) + +// [PRS]$ + +// $[PTI] +#define PORTIO_PTI_DFRAME_PIN (13U) +#define PORTIO_PTI_DFRAME_PORT (gpioPortB) +#define PORTIO_PTI_DFRAME_LOC (6U) + +#define PORTIO_PTI_DOUT_PIN (12U) +#define PORTIO_PTI_DOUT_PORT (gpioPortB) +#define PORTIO_PTI_DOUT_LOC (6U) + +#define BSP_PTI_DFRAME_PIN (13U) +#define BSP_PTI_DFRAME_PORT (gpioPortB) +#define BSP_PTI_DFRAME_LOC (6U) + +#define BSP_PTI_DOUT_PIN (12U) +#define BSP_PTI_DOUT_PORT (gpioPortB) +#define BSP_PTI_DOUT_LOC (6U) + +// [PTI]$ + +// $[SERIAL] +#define BSP_SERIAL_APP_TX_PIN (0U) +#define BSP_SERIAL_APP_TX_PORT (gpioPortA) +#define BSP_SERIAL_APP_TX_LOC (0U) + +#define BSP_SERIAL_APP_RX_PIN (1U) +#define BSP_SERIAL_APP_RX_PORT (gpioPortA) +#define BSP_SERIAL_APP_RX_LOC (0U) + +#define BSP_SERIAL_APP_CTS_PIN (2U) +#define BSP_SERIAL_APP_CTS_PORT (gpioPortA) +#define BSP_SERIAL_APP_CTS_LOC (30U) + +#define BSP_SERIAL_APP_RTS_PIN (3U) +#define BSP_SERIAL_APP_RTS_PORT (gpioPortA) +#define BSP_SERIAL_APP_RTS_LOC (30U) + +// [SERIAL]$ + +// $[SPIDISPLAY] + +#define BSP_SPIDISPLAY_CS_PIN (14U) +#define BSP_SPIDISPLAY_CS_PORT (gpioPortD) + +#define BSP_SPIDISPLAY_ENABLE_PIN (15U) +#define BSP_SPIDISPLAY_ENABLE_PORT (gpioPortD) + +#define BSP_SPIDISPLAY_EXTCOMIN_PIN (13U) +#define BSP_SPIDISPLAY_EXTCOMIN_PORT (gpioPortD) +#define BSP_SPIDISPLAY_EXTCOMIN_LOC (4U) + +#define BSP_SPIDISPLAY_DISPLAY (HAL_DISPLAY_SHARP_LS013B7DH03) +#define BSP_SPIDISPLAY_USART (HAL_SPI_PORT_USART1) +#define BSP_SPIDISPLAY_EXTCOMIN_CHANNEL (4) +#define BSP_SPIDISPLAY_MOSI_PIN (6U) +#define BSP_SPIDISPLAY_MOSI_PORT (gpioPortC) +#define BSP_SPIDISPLAY_MOSI_LOC (11U) + +#define BSP_SPIDISPLAY_MISO_PIN (7U) +#define BSP_SPIDISPLAY_MISO_PORT (gpioPortC) +#define BSP_SPIDISPLAY_MISO_LOC (11U) + +#define BSP_SPIDISPLAY_CLK_PIN (8U) +#define BSP_SPIDISPLAY_CLK_PORT (gpioPortC) +#define BSP_SPIDISPLAY_CLK_LOC (11U) + +// [SPIDISPLAY]$ + +// $[SPINCP] +#define BSP_SPINCP_NHOSTINT_PIN (10U) +#define BSP_SPINCP_NHOSTINT_PORT (gpioPortD) + +#define BSP_SPINCP_NWAKE_PIN (11U) +#define BSP_SPINCP_NWAKE_PORT (gpioPortD) + +#define BSP_SPINCP_USART_PORT (HAL_SPI_PORT_USART2) +#define BSP_SPINCP_MOSI_PIN (6U) +#define BSP_SPINCP_MOSI_PORT (gpioPortA) +#define BSP_SPINCP_MOSI_LOC (1U) + +#define BSP_SPINCP_MISO_PIN (7U) +#define BSP_SPINCP_MISO_PORT (gpioPortA) +#define BSP_SPINCP_MISO_LOC (1U) + +#define BSP_SPINCP_CLK_PIN (8U) +#define BSP_SPINCP_CLK_PORT (gpioPortA) +#define BSP_SPINCP_CLK_LOC (1U) + +#define BSP_SPINCP_CS_PIN (9U) +#define BSP_SPINCP_CS_PORT (gpioPortA) +#define BSP_SPINCP_CS_LOC (1U) + +// [SPINCP]$ + +// $[UARTNCP] +#define BSP_UARTNCP_USART_PORT (HAL_SERIAL_PORT_USART0) +#define BSP_UARTNCP_TX_PIN (0U) +#define BSP_UARTNCP_TX_PORT (gpioPortA) +#define BSP_UARTNCP_TX_LOC (0U) + +#define BSP_UARTNCP_RX_PIN (1U) +#define BSP_UARTNCP_RX_PORT (gpioPortA) +#define BSP_UARTNCP_RX_LOC (0U) + +#define BSP_UARTNCP_CTS_PIN (2U) +#define BSP_UARTNCP_CTS_PORT (gpioPortA) +#define BSP_UARTNCP_CTS_LOC (30U) + +#define BSP_UARTNCP_RTS_PIN (3U) +#define BSP_UARTNCP_RTS_PORT (gpioPortA) +#define BSP_UARTNCP_RTS_LOC (30U) + +// [UARTNCP]$ + +// $[USART0] +#define PORTIO_USART0_CTS_PIN (2U) +#define PORTIO_USART0_CTS_PORT (gpioPortA) +#define PORTIO_USART0_CTS_LOC (30U) + +#define PORTIO_USART0_RTS_PIN (3U) +#define PORTIO_USART0_RTS_PORT (gpioPortA) +#define PORTIO_USART0_RTS_LOC (30U) + +#define PORTIO_USART0_RX_PIN (1U) +#define PORTIO_USART0_RX_PORT (gpioPortA) +#define PORTIO_USART0_RX_LOC (0U) + +#define PORTIO_USART0_TX_PIN (0U) +#define PORTIO_USART0_TX_PORT (gpioPortA) +#define PORTIO_USART0_TX_LOC (0U) + +#define BSP_USART0_TX_PIN (0U) +#define BSP_USART0_TX_PORT (gpioPortA) +#define BSP_USART0_TX_LOC (0U) + +#define BSP_USART0_RX_PIN (1U) +#define BSP_USART0_RX_PORT (gpioPortA) +#define BSP_USART0_RX_LOC (0U) + +#define BSP_USART0_CTS_PIN (2U) +#define BSP_USART0_CTS_PORT (gpioPortA) +#define BSP_USART0_CTS_LOC (30U) + +#define BSP_USART0_RTS_PIN (3U) +#define BSP_USART0_RTS_PORT (gpioPortA) +#define BSP_USART0_RTS_LOC (30U) + +// [USART0]$ + +// $[USART1] +#define PORTIO_USART1_CLK_PIN (8U) +#define PORTIO_USART1_CLK_PORT (gpioPortC) +#define PORTIO_USART1_CLK_LOC (11U) + +#define PORTIO_USART1_CS_PIN (9U) +#define PORTIO_USART1_CS_PORT (gpioPortC) +#define PORTIO_USART1_CS_LOC (11U) + +#define PORTIO_USART1_RX_PIN (7U) +#define PORTIO_USART1_RX_PORT (gpioPortC) +#define PORTIO_USART1_RX_LOC (11U) + +#define PORTIO_USART1_TX_PIN (6U) +#define PORTIO_USART1_TX_PORT (gpioPortC) +#define PORTIO_USART1_TX_LOC (11U) + +#define BSP_USART1_MOSI_PIN (6U) +#define BSP_USART1_MOSI_PORT (gpioPortC) +#define BSP_USART1_MOSI_LOC (11U) + +#define BSP_USART1_MISO_PIN (7U) +#define BSP_USART1_MISO_PORT (gpioPortC) +#define BSP_USART1_MISO_LOC (11U) + +#define BSP_USART1_CLK_PIN (8U) +#define BSP_USART1_CLK_PORT (gpioPortC) +#define BSP_USART1_CLK_LOC (11U) + +#define BSP_USART1_CS_PIN (9U) +#define BSP_USART1_CS_PORT (gpioPortC) +#define BSP_USART1_CS_LOC (11U) + +// [USART1]$ + +// $[USART2] +#define PORTIO_USART2_CLK_PIN (8U) +#define PORTIO_USART2_CLK_PORT (gpioPortA) +#define PORTIO_USART2_CLK_LOC (1U) + +#define PORTIO_USART2_CS_PIN (9U) +#define PORTIO_USART2_CS_PORT (gpioPortA) +#define PORTIO_USART2_CS_LOC (1U) + +#define PORTIO_USART2_RX_PIN (7U) +#define PORTIO_USART2_RX_PORT (gpioPortA) +#define PORTIO_USART2_RX_LOC (1U) + +#define PORTIO_USART2_TX_PIN (6U) +#define PORTIO_USART2_TX_PORT (gpioPortA) +#define PORTIO_USART2_TX_LOC (1U) + +#define BSP_USART2_MOSI_PIN (6U) +#define BSP_USART2_MOSI_PORT (gpioPortA) +#define BSP_USART2_MOSI_LOC (1U) + +#define BSP_USART2_MISO_PIN (7U) +#define BSP_USART2_MISO_PORT (gpioPortA) +#define BSP_USART2_MISO_LOC (1U) + +#define BSP_USART2_CLK_PIN (8U) +#define BSP_USART2_CLK_PORT (gpioPortA) +#define BSP_USART2_CLK_LOC (1U) + +#define BSP_USART2_CS_PIN (9U) +#define BSP_USART2_CS_PORT (gpioPortA) +#define BSP_USART2_CS_LOC (1U) + +// [USART2]$ + +// $[USART3] +#define PORTIO_USART3_CTS_PIN (8U) +#define PORTIO_USART3_CTS_PORT (gpioPortD) +#define PORTIO_USART3_CTS_LOC (28U) + +#define PORTIO_USART3_RTS_PIN (9U) +#define PORTIO_USART3_RTS_PORT (gpioPortD) +#define PORTIO_USART3_RTS_LOC (28U) + +#define PORTIO_USART3_RX_PIN (7U) +#define PORTIO_USART3_RX_PORT (gpioPortB) +#define PORTIO_USART3_RX_LOC (10U) + +#define PORTIO_USART3_TX_PIN (6U) +#define PORTIO_USART3_TX_PORT (gpioPortB) +#define PORTIO_USART3_TX_LOC (10U) + +#define BSP_USART3_TX_PIN (6U) +#define BSP_USART3_TX_PORT (gpioPortB) +#define BSP_USART3_TX_LOC (10U) + +#define BSP_USART3_RX_PIN (7U) +#define BSP_USART3_RX_PORT (gpioPortB) +#define BSP_USART3_RX_LOC (10U) + +#define BSP_USART3_CTS_PIN (8U) +#define BSP_USART3_CTS_PORT (gpioPortD) +#define BSP_USART3_CTS_LOC (28U) + +#define BSP_USART3_RTS_PIN (9U) +#define BSP_USART3_RTS_PORT (gpioPortD) +#define BSP_USART3_RTS_LOC (28U) + +// [USART3]$ + +// $[VCOM] + +#define BSP_VCOM_ENABLE_PIN (5U) +#define BSP_VCOM_ENABLE_PORT (gpioPortA) + +// [VCOM]$ + +#if defined(_SILICON_LABS_MODULE) +#include "sl_module.h" +#endif diff --git a/examples/platform/efr32/efr32mg12/BRD4163A/init_board.c b/examples/platform/efr32/efr32mg12/BRD4163A/init_board.c index 517408d5ccd795..5d9e956849fd2e 100644 --- a/examples/platform/efr32/efr32mg12/BRD4163A/init_board.c +++ b/examples/platform/efr32/efr32mg12/BRD4163A/init_board.c @@ -41,7 +41,7 @@ #include "board_features.h" #include "em_cmu.h" -#include "hal-config-board.h" +#include "hal-config.h" #include "em_cmu.h" diff --git a/examples/platform/efr32/efr32mg12/BRD4164A/hal-config.h b/examples/platform/efr32/efr32mg12/BRD4164A/hal-config.h index d31f1e5c098728..6b2ca9df77409b 100644 --- a/examples/platform/efr32/efr32mg12/BRD4164A/hal-config.h +++ b/examples/platform/efr32/efr32mg12/BRD4164A/hal-config.h @@ -36,8 +36,9 @@ #define HAL_CONFIG_H #include "board_features.h" +#include "em_device.h" #include "hal-config-app-common.h" -#include "hal-config-board.h" +#include "hal-config-types.h" #define HAL_CLK_HFCLK_SOURCE (HAL_CLK_HFCLK_SOURCE_HFXO) #define HAL_CLK_LFECLK_SOURCE (HAL_CLK_LFCLK_SOURCE_LFRCO) @@ -102,4 +103,405 @@ #define HAL_SPIDISPLAY_EXTCOMIN_USE_CALLBACK (0) #define HAL_SPIDISPLAY_FREQUENCY (1000000) +// $[BTL_BUTTON] + +#define BSP_BTL_BUTTON_PIN (6U) +#define BSP_BTL_BUTTON_PORT (gpioPortF) + +// [BTL_BUTTON]$ + +// $[BUTTON] +#define BSP_BUTTON_PRESENT (1) + +#define BSP_BUTTON0_PIN (6U) +#define BSP_BUTTON0_PORT (gpioPortF) + +#define BSP_BUTTON1_PIN (7U) +#define BSP_BUTTON1_PORT (gpioPortF) + +#define BSP_BUTTON_COUNT (2U) +#define BSP_BUTTON_INIT \ + { \ + { BSP_BUTTON0_PORT, BSP_BUTTON0_PIN }, { BSP_BUTTON1_PORT, BSP_BUTTON1_PIN } \ + } +#define BSP_BUTTON_GPIO_DOUT (HAL_GPIO_DOUT_LOW) +#define BSP_BUTTON_GPIO_MODE (HAL_GPIO_MODE_INPUT) +// [BUTTON]$ + +// $[CMU] +#define BSP_CLK_HFXO_PRESENT (1) +#define BSP_CLK_HFXO_FREQ (38400000UL) +#define BSP_CLK_HFXO_INIT CMU_HFXOINIT_DEFAULT +#define BSP_CLK_HFXO_CTUNE (327) +#define BSP_CLK_LFXO_PRESENT (1) +#define BSP_CLK_LFXO_INIT CMU_LFXOINIT_DEFAULT +#define BSP_CLK_LFXO_FREQ (32768U) +#define BSP_CLK_LFXO_CTUNE (32U) +// [CMU]$ + +// $[DCDC] +#define BSP_DCDC_PRESENT (1) + +#define BSP_DCDC_INIT EMU_DCDCINIT_DEFAULT +// [DCDC]$ + +// $[EXTFLASH] +#define BSP_EXTFLASH_CS_PIN (4U) +#define BSP_EXTFLASH_CS_PORT (gpioPortA) + +#define BSP_EXTFLASH_INTERNAL (0) +#define BSP_EXTFLASH_USART (HAL_SPI_PORT_USART1) +#define BSP_EXTFLASH_MOSI_PIN (6U) +#define BSP_EXTFLASH_MOSI_PORT (gpioPortC) +#define BSP_EXTFLASH_MOSI_LOC (11U) + +#define BSP_EXTFLASH_MISO_PIN (7U) +#define BSP_EXTFLASH_MISO_PORT (gpioPortC) +#define BSP_EXTFLASH_MISO_LOC (11U) + +#define BSP_EXTFLASH_CLK_PIN (8U) +#define BSP_EXTFLASH_CLK_PORT (gpioPortC) +#define BSP_EXTFLASH_CLK_LOC (11U) + +// [EXTFLASH]$ + +// $[GPIO] +#define PORTIO_GPIO_SWV_PIN (2U) +#define PORTIO_GPIO_SWV_PORT (gpioPortF) +#define PORTIO_GPIO_SWV_LOC (0U) + +#define BSP_TRACE_SWO_PIN (2U) +#define BSP_TRACE_SWO_PORT (gpioPortF) +#define BSP_TRACE_SWO_LOC (0U) + +// [GPIO]$ + +// $[I2C0] +#define PORTIO_I2C0_SCL_PIN (10U) +#define PORTIO_I2C0_SCL_PORT (gpioPortC) +#define PORTIO_I2C0_SCL_LOC (14U) + +#define PORTIO_I2C0_SDA_PIN (11U) +#define PORTIO_I2C0_SDA_PORT (gpioPortC) +#define PORTIO_I2C0_SDA_LOC (16U) + +#define BSP_I2C0_SCL_PIN (10U) +#define BSP_I2C0_SCL_PORT (gpioPortC) +#define BSP_I2C0_SCL_LOC (14U) + +#define BSP_I2C0_SDA_PIN (11U) +#define BSP_I2C0_SDA_PORT (gpioPortC) +#define BSP_I2C0_SDA_LOC (16U) + +// [I2C0]$ + +// $[I2CSENSOR] + +#define BSP_I2CSENSOR_ENABLE_PIN (10U) +#define BSP_I2CSENSOR_ENABLE_PORT (gpioPortB) + +#define BSP_I2CSENSOR_PERIPHERAL (HAL_I2C_PORT_I2C0) +#define BSP_I2CSENSOR_SCL_PIN (10U) +#define BSP_I2CSENSOR_SCL_PORT (gpioPortC) +#define BSP_I2CSENSOR_SCL_LOC (14U) + +#define BSP_I2CSENSOR_SDA_PIN (11U) +#define BSP_I2CSENSOR_SDA_PORT (gpioPortC) +#define BSP_I2CSENSOR_SDA_LOC (16U) + +// [I2CSENSOR]$ + +// $[LED] +#define BSP_LED_PRESENT (1) + +#define BSP_LED0_PIN (4U) +#define BSP_LED0_PORT (gpioPortF) + +#define BSP_LED1_PIN (5U) +#define BSP_LED1_PORT (gpioPortF) + +#define BSP_LED_COUNT (2U) +#define BSP_LED_INIT \ + { \ + { BSP_LED0_PORT, BSP_LED0_PIN }, { BSP_LED1_PORT, BSP_LED1_PIN } \ + } +#define BSP_LED_POLARITY (1) +// [LED]$ + +// $[PA] + +#define BSP_PA_VOLTAGE (3300U) +// [PA]$ + +// $[PRS] +#define PORTIO_PRS_CH4_PIN (13U) +#define PORTIO_PRS_CH4_PORT (gpioPortD) +#define PORTIO_PRS_CH4_LOC (4U) + +// [PRS]$ + +// $[PTI] +#define PORTIO_PTI_DFRAME_PIN (13U) +#define PORTIO_PTI_DFRAME_PORT (gpioPortB) +#define PORTIO_PTI_DFRAME_LOC (6U) + +#define PORTIO_PTI_DOUT_PIN (12U) +#define PORTIO_PTI_DOUT_PORT (gpioPortB) +#define PORTIO_PTI_DOUT_LOC (6U) + +#define BSP_PTI_DFRAME_PIN (13U) +#define BSP_PTI_DFRAME_PORT (gpioPortB) +#define BSP_PTI_DFRAME_LOC (6U) + +#define BSP_PTI_DOUT_PIN (12U) +#define BSP_PTI_DOUT_PORT (gpioPortB) +#define BSP_PTI_DOUT_LOC (6U) + +// [PTI]$ + +// $[SERIAL] +#define BSP_SERIAL_APP_TX_PIN (0U) +#define BSP_SERIAL_APP_TX_PORT (gpioPortA) +#define BSP_SERIAL_APP_TX_LOC (0U) + +#define BSP_SERIAL_APP_RX_PIN (1U) +#define BSP_SERIAL_APP_RX_PORT (gpioPortA) +#define BSP_SERIAL_APP_RX_LOC (0U) + +#define BSP_SERIAL_APP_CTS_PIN (2U) +#define BSP_SERIAL_APP_CTS_PORT (gpioPortA) +#define BSP_SERIAL_APP_CTS_LOC (30U) + +#define BSP_SERIAL_APP_RTS_PIN (3U) +#define BSP_SERIAL_APP_RTS_PORT (gpioPortA) +#define BSP_SERIAL_APP_RTS_LOC (30U) + +// [SERIAL]$ + +// $[SPIDISPLAY] + +#define BSP_SPIDISPLAY_CS_PIN (14U) +#define BSP_SPIDISPLAY_CS_PORT (gpioPortD) + +#define BSP_SPIDISPLAY_ENABLE_PIN (15U) +#define BSP_SPIDISPLAY_ENABLE_PORT (gpioPortD) + +#define BSP_SPIDISPLAY_EXTCOMIN_PIN (13U) +#define BSP_SPIDISPLAY_EXTCOMIN_PORT (gpioPortD) +#define BSP_SPIDISPLAY_EXTCOMIN_LOC (4U) + +#define BSP_SPIDISPLAY_DISPLAY (HAL_DISPLAY_SHARP_LS013B7DH03) +#define BSP_SPIDISPLAY_USART (HAL_SPI_PORT_USART1) +#define BSP_SPIDISPLAY_EXTCOMIN_CHANNEL (4) +#define BSP_SPIDISPLAY_MOSI_PIN (6U) +#define BSP_SPIDISPLAY_MOSI_PORT (gpioPortC) +#define BSP_SPIDISPLAY_MOSI_LOC (11U) + +#define BSP_SPIDISPLAY_MISO_PIN (7U) +#define BSP_SPIDISPLAY_MISO_PORT (gpioPortC) +#define BSP_SPIDISPLAY_MISO_LOC (11U) + +#define BSP_SPIDISPLAY_CLK_PIN (8U) +#define BSP_SPIDISPLAY_CLK_PORT (gpioPortC) +#define BSP_SPIDISPLAY_CLK_LOC (11U) + +// [SPIDISPLAY]$ + +// $[SPINCP] +#define BSP_SPINCP_NHOSTINT_PIN (10U) +#define BSP_SPINCP_NHOSTINT_PORT (gpioPortD) + +#define BSP_SPINCP_NWAKE_PIN (11U) +#define BSP_SPINCP_NWAKE_PORT (gpioPortD) + +#define BSP_SPINCP_USART_PORT (HAL_SPI_PORT_USART2) +#define BSP_SPINCP_MOSI_PIN (6U) +#define BSP_SPINCP_MOSI_PORT (gpioPortA) +#define BSP_SPINCP_MOSI_LOC (1U) + +#define BSP_SPINCP_MISO_PIN (7U) +#define BSP_SPINCP_MISO_PORT (gpioPortA) +#define BSP_SPINCP_MISO_LOC (1U) + +#define BSP_SPINCP_CLK_PIN (8U) +#define BSP_SPINCP_CLK_PORT (gpioPortA) +#define BSP_SPINCP_CLK_LOC (1U) + +#define BSP_SPINCP_CS_PIN (9U) +#define BSP_SPINCP_CS_PORT (gpioPortA) +#define BSP_SPINCP_CS_LOC (1U) + +// [SPINCP]$ + +// $[UARTNCP] +#define BSP_UARTNCP_USART_PORT (HAL_SERIAL_PORT_USART0) +#define BSP_UARTNCP_TX_PIN (0U) +#define BSP_UARTNCP_TX_PORT (gpioPortA) +#define BSP_UARTNCP_TX_LOC (0U) + +#define BSP_UARTNCP_RX_PIN (1U) +#define BSP_UARTNCP_RX_PORT (gpioPortA) +#define BSP_UARTNCP_RX_LOC (0U) + +#define BSP_UARTNCP_CTS_PIN (2U) +#define BSP_UARTNCP_CTS_PORT (gpioPortA) +#define BSP_UARTNCP_CTS_LOC (30U) + +#define BSP_UARTNCP_RTS_PIN (3U) +#define BSP_UARTNCP_RTS_PORT (gpioPortA) +#define BSP_UARTNCP_RTS_LOC (30U) + +// [UARTNCP]$ + +// $[USART0] +#define PORTIO_USART0_CTS_PIN (2U) +#define PORTIO_USART0_CTS_PORT (gpioPortA) +#define PORTIO_USART0_CTS_LOC (30U) + +#define PORTIO_USART0_RTS_PIN (3U) +#define PORTIO_USART0_RTS_PORT (gpioPortA) +#define PORTIO_USART0_RTS_LOC (30U) + +#define PORTIO_USART0_RX_PIN (1U) +#define PORTIO_USART0_RX_PORT (gpioPortA) +#define PORTIO_USART0_RX_LOC (0U) + +#define PORTIO_USART0_TX_PIN (0U) +#define PORTIO_USART0_TX_PORT (gpioPortA) +#define PORTIO_USART0_TX_LOC (0U) + +#define BSP_USART0_TX_PIN (0U) +#define BSP_USART0_TX_PORT (gpioPortA) +#define BSP_USART0_TX_LOC (0U) + +#define BSP_USART0_RX_PIN (1U) +#define BSP_USART0_RX_PORT (gpioPortA) +#define BSP_USART0_RX_LOC (0U) + +#define BSP_USART0_CTS_PIN (2U) +#define BSP_USART0_CTS_PORT (gpioPortA) +#define BSP_USART0_CTS_LOC (30U) + +#define BSP_USART0_RTS_PIN (3U) +#define BSP_USART0_RTS_PORT (gpioPortA) +#define BSP_USART0_RTS_LOC (30U) + +// [USART0]$ + +// $[USART1] +#define PORTIO_USART1_CLK_PIN (8U) +#define PORTIO_USART1_CLK_PORT (gpioPortC) +#define PORTIO_USART1_CLK_LOC (11U) + +#define PORTIO_USART1_CS_PIN (9U) +#define PORTIO_USART1_CS_PORT (gpioPortC) +#define PORTIO_USART1_CS_LOC (11U) + +#define PORTIO_USART1_RX_PIN (7U) +#define PORTIO_USART1_RX_PORT (gpioPortC) +#define PORTIO_USART1_RX_LOC (11U) + +#define PORTIO_USART1_TX_PIN (6U) +#define PORTIO_USART1_TX_PORT (gpioPortC) +#define PORTIO_USART1_TX_LOC (11U) + +#define BSP_USART1_MOSI_PIN (6U) +#define BSP_USART1_MOSI_PORT (gpioPortC) +#define BSP_USART1_MOSI_LOC (11U) + +#define BSP_USART1_MISO_PIN (7U) +#define BSP_USART1_MISO_PORT (gpioPortC) +#define BSP_USART1_MISO_LOC (11U) + +#define BSP_USART1_CLK_PIN (8U) +#define BSP_USART1_CLK_PORT (gpioPortC) +#define BSP_USART1_CLK_LOC (11U) + +#define BSP_USART1_CS_PIN (9U) +#define BSP_USART1_CS_PORT (gpioPortC) +#define BSP_USART1_CS_LOC (11U) + +// [USART1]$ + +// $[USART2] +#define PORTIO_USART2_CLK_PIN (8U) +#define PORTIO_USART2_CLK_PORT (gpioPortA) +#define PORTIO_USART2_CLK_LOC (1U) + +#define PORTIO_USART2_CS_PIN (9U) +#define PORTIO_USART2_CS_PORT (gpioPortA) +#define PORTIO_USART2_CS_LOC (1U) + +#define PORTIO_USART2_RX_PIN (7U) +#define PORTIO_USART2_RX_PORT (gpioPortA) +#define PORTIO_USART2_RX_LOC (1U) + +#define PORTIO_USART2_TX_PIN (6U) +#define PORTIO_USART2_TX_PORT (gpioPortA) +#define PORTIO_USART2_TX_LOC (1U) + +#define BSP_USART2_MOSI_PIN (6U) +#define BSP_USART2_MOSI_PORT (gpioPortA) +#define BSP_USART2_MOSI_LOC (1U) + +#define BSP_USART2_MISO_PIN (7U) +#define BSP_USART2_MISO_PORT (gpioPortA) +#define BSP_USART2_MISO_LOC (1U) + +#define BSP_USART2_CLK_PIN (8U) +#define BSP_USART2_CLK_PORT (gpioPortA) +#define BSP_USART2_CLK_LOC (1U) + +#define BSP_USART2_CS_PIN (9U) +#define BSP_USART2_CS_PORT (gpioPortA) +#define BSP_USART2_CS_LOC (1U) + +// [USART2]$ + +// $[USART3] +#define PORTIO_USART3_CTS_PIN (8U) +#define PORTIO_USART3_CTS_PORT (gpioPortD) +#define PORTIO_USART3_CTS_LOC (28U) + +#define PORTIO_USART3_RTS_PIN (9U) +#define PORTIO_USART3_RTS_PORT (gpioPortD) +#define PORTIO_USART3_RTS_LOC (28U) + +#define PORTIO_USART3_RX_PIN (7U) +#define PORTIO_USART3_RX_PORT (gpioPortB) +#define PORTIO_USART3_RX_LOC (10U) + +#define PORTIO_USART3_TX_PIN (6U) +#define PORTIO_USART3_TX_PORT (gpioPortB) +#define PORTIO_USART3_TX_LOC (10U) + +#define BSP_USART3_TX_PIN (6U) +#define BSP_USART3_TX_PORT (gpioPortB) +#define BSP_USART3_TX_LOC (10U) + +#define BSP_USART3_RX_PIN (7U) +#define BSP_USART3_RX_PORT (gpioPortB) +#define BSP_USART3_RX_LOC (10U) + +#define BSP_USART3_CTS_PIN (8U) +#define BSP_USART3_CTS_PORT (gpioPortD) +#define BSP_USART3_CTS_LOC (28U) + +#define BSP_USART3_RTS_PIN (9U) +#define BSP_USART3_RTS_PORT (gpioPortD) +#define BSP_USART3_RTS_LOC (28U) + +// [USART3]$ + +// $[VCOM] + +#define BSP_VCOM_ENABLE_PIN (5U) +#define BSP_VCOM_ENABLE_PORT (gpioPortA) + +// [VCOM]$ + +#if defined(_SILICON_LABS_MODULE) +#include "sl_module.h" +#endif + #endif diff --git a/examples/platform/efr32/efr32mg12/BRD4164A/init_board.c b/examples/platform/efr32/efr32mg12/BRD4164A/init_board.c index 517408d5ccd795..5d9e956849fd2e 100644 --- a/examples/platform/efr32/efr32mg12/BRD4164A/init_board.c +++ b/examples/platform/efr32/efr32mg12/BRD4164A/init_board.c @@ -41,7 +41,7 @@ #include "board_features.h" #include "em_cmu.h" -#include "hal-config-board.h" +#include "hal-config.h" #include "em_cmu.h" diff --git a/examples/platform/efr32/efr32mg12/BRD4166A/hal-config.h b/examples/platform/efr32/efr32mg12/BRD4166A/hal-config.h index 8573b7039732bd..94b8cbfcf6ca01 100644 --- a/examples/platform/efr32/efr32mg12/BRD4166A/hal-config.h +++ b/examples/platform/efr32/efr32mg12/BRD4166A/hal-config.h @@ -32,12 +32,12 @@ * ******************************************************************************/ -#ifndef HAL_CONFIG_H -#define HAL_CONFIG_H +#pragma once #include "board_features.h" +#include "em_device.h" #include "hal-config-app-common.h" -#include "hal-config-board.h" +#include "hal-config-types.h" #ifndef HAL_VCOM_ENABLE #define HAL_VCOM_ENABLE (0) @@ -95,4 +95,443 @@ #define HAL_USART0_TX_QUEUE_SIZE (128) #define HAL_USART0_FLOW_CONTROL (HAL_USART_FLOW_CONTROL_NONE) +// $[BTL_BUTTON] + +#define BSP_BTL_BUTTON_PIN (14U) +#define BSP_BTL_BUTTON_PORT (gpioPortD) + +// [BTL_BUTTON]$ + +// $[BUTTON] +#define BSP_BUTTON_PRESENT (1) + +#define BSP_BUTTON0_PIN (14U) +#define BSP_BUTTON0_PORT (gpioPortD) + +#define BSP_BUTTON1_PIN (15U) +#define BSP_BUTTON1_PORT (gpioPortD) + +#define BSP_BUTTON_COUNT (2U) +#define BSP_BUTTON_INIT \ + { \ + { BSP_BUTTON0_PORT, BSP_BUTTON0_PIN }, { BSP_BUTTON1_PORT, BSP_BUTTON1_PIN } \ + } +#define BSP_BUTTON_GPIO_DOUT (HAL_GPIO_DOUT_LOW) +#define BSP_BUTTON_GPIO_MODE (HAL_GPIO_MODE_INPUT) +// [BUTTON]$ + +// $[CMU] +#define BSP_CLK_HFXO_PRESENT (1) +#define BSP_CLK_HFXO_FREQ (38400000UL) +#define BSP_CLK_HFXO_INIT CMU_HFXOINIT_DEFAULT +#define BSP_CLK_HFXO_CTUNE (332) +#define BSP_CLK_LFXO_PRESENT (1) +#define BSP_CLK_LFXO_INIT CMU_LFXOINIT_DEFAULT +#define BSP_CLK_LFXO_FREQ (32768U) +#define BSP_CLK_LFXO_CTUNE (32U) +// [CMU]$ + +// $[DCDC] +#define BSP_DCDC_PRESENT (1) + +#define BSP_DCDC_INIT EMU_DCDCINIT_DEFAULT +// [DCDC]$ + +// $[EXTFLASH] +#define BSP_EXTFLASH_CS_PIN (1U) +#define BSP_EXTFLASH_CS_PORT (gpioPortK) + +#define BSP_EXTFLASH_INTERNAL (0) +#define BSP_EXTFLASH_USART (HAL_SPI_PORT_USART2) +#define BSP_EXTFLASH_MOSI_PIN (0U) +#define BSP_EXTFLASH_MOSI_PORT (gpioPortK) +#define BSP_EXTFLASH_MOSI_LOC (29U) + +#define BSP_EXTFLASH_MISO_PIN (2U) +#define BSP_EXTFLASH_MISO_PORT (gpioPortK) +#define BSP_EXTFLASH_MISO_LOC (30U) + +#define BSP_EXTFLASH_CLK_PIN (7U) +#define BSP_EXTFLASH_CLK_PORT (gpioPortF) +#define BSP_EXTFLASH_CLK_LOC (18U) + +// [EXTFLASH]$ + +// $[GPIO] +#define PORTIO_GPIO_SWV_PIN (2U) +#define PORTIO_GPIO_SWV_PORT (gpioPortF) +#define PORTIO_GPIO_SWV_LOC (0U) + +#define BSP_TRACE_SWO_PIN (2U) +#define BSP_TRACE_SWO_PORT (gpioPortF) +#define BSP_TRACE_SWO_LOC (0U) + +// [GPIO]$ + +// $[I2C0] +#define PORTIO_I2C0_SCL_PIN (11U) +#define PORTIO_I2C0_SCL_PORT (gpioPortC) +#define PORTIO_I2C0_SCL_LOC (15U) + +#define PORTIO_I2C0_SDA_PIN (10U) +#define PORTIO_I2C0_SDA_PORT (gpioPortC) +#define PORTIO_I2C0_SDA_LOC (15U) + +#define BSP_I2C0_SCL_PIN (11U) +#define BSP_I2C0_SCL_PORT (gpioPortC) +#define BSP_I2C0_SCL_LOC (15U) + +#define BSP_I2C0_SDA_PIN (10U) +#define BSP_I2C0_SDA_PORT (gpioPortC) +#define BSP_I2C0_SDA_LOC (15U) + +// [I2C0]$ + +// $[I2C1] +#define PORTIO_I2C1_SCL_PIN (5U) +#define PORTIO_I2C1_SCL_PORT (gpioPortC) +#define PORTIO_I2C1_SCL_LOC (17U) + +#define PORTIO_I2C1_SDA_PIN (4U) +#define PORTIO_I2C1_SDA_PORT (gpioPortC) +#define PORTIO_I2C1_SDA_LOC (17U) + +#define BSP_I2C1_SCL_PIN (5U) +#define BSP_I2C1_SCL_PORT (gpioPortC) +#define BSP_I2C1_SCL_LOC (17U) + +#define BSP_I2C1_SDA_PIN (4U) +#define BSP_I2C1_SDA_PORT (gpioPortC) +#define BSP_I2C1_SDA_LOC (17U) + +// [I2C1]$ + +// $[I2CSENSOR] + +#define BSP_I2CSENSOR_PERIPHERAL (HAL_I2C_PORT_I2C0) +#define BSP_I2CSENSOR_SCL_PIN (11U) +#define BSP_I2CSENSOR_SCL_PORT (gpioPortC) +#define BSP_I2CSENSOR_SCL_LOC (15U) + +#define BSP_I2CSENSOR_SDA_PIN (10U) +#define BSP_I2CSENSOR_SDA_PORT (gpioPortC) +#define BSP_I2CSENSOR_SDA_LOC (15U) + +// [I2CSENSOR]$ + +// $[LED] +#define BSP_LED_PRESENT (1) + +#define BSP_LED0_PIN (8U) +#define BSP_LED0_PORT (gpioPortD) + +#define BSP_LED1_PIN (9U) +#define BSP_LED1_PORT (gpioPortD) + +#define BSP_LED_COUNT (2U) +#define BSP_LED_INIT \ + { \ + { BSP_LED0_PORT, BSP_LED0_PIN }, { BSP_LED1_PORT, BSP_LED1_PIN } \ + } +#define BSP_LED_POLARITY (1) +// [LED]$ + +// $[PA] + +#define BSP_PA_VOLTAGE (1800U) +// [PA]$ + +// $[PTI] +#define PORTIO_PTI_DCLK_PIN (11U) +#define PORTIO_PTI_DCLK_PORT (gpioPortB) +#define PORTIO_PTI_DCLK_LOC (6U) + +#define PORTIO_PTI_DFRAME_PIN (13U) +#define PORTIO_PTI_DFRAME_PORT (gpioPortB) +#define PORTIO_PTI_DFRAME_LOC (6U) + +#define PORTIO_PTI_DOUT_PIN (12U) +#define PORTIO_PTI_DOUT_PORT (gpioPortB) +#define PORTIO_PTI_DOUT_LOC (6U) + +#define BSP_PTI_DFRAME_PIN (13U) +#define BSP_PTI_DFRAME_PORT (gpioPortB) +#define BSP_PTI_DFRAME_LOC (6U) + +#define BSP_PTI_DOUT_PIN (12U) +#define BSP_PTI_DOUT_PORT (gpioPortB) +#define BSP_PTI_DOUT_LOC (6U) + +// [PTI]$ + +// $[SERIAL] +#define BSP_SERIAL_APP_TX_PIN (0U) +#define BSP_SERIAL_APP_TX_PORT (gpioPortA) +#define BSP_SERIAL_APP_TX_LOC (0U) + +#define BSP_SERIAL_APP_RX_PIN (1U) +#define BSP_SERIAL_APP_RX_PORT (gpioPortA) +#define BSP_SERIAL_APP_RX_LOC (0U) + +#define BSP_SERIAL_APP_CTS_PIN (2U) +#define BSP_SERIAL_APP_CTS_PORT (gpioPortA) +#define BSP_SERIAL_APP_CTS_LOC (30U) + +#define BSP_SERIAL_APP_RTS_PIN (3U) +#define BSP_SERIAL_APP_RTS_PORT (gpioPortA) +#define BSP_SERIAL_APP_RTS_LOC (30U) + +// [SERIAL]$ + +// $[SPINCP] +#define BSP_SPINCP_NHOSTINT_PIN (6U) +#define BSP_SPINCP_NHOSTINT_PORT (gpioPortA) + +#define BSP_SPINCP_NWAKE_PIN (7U) +#define BSP_SPINCP_NWAKE_PORT (gpioPortA) + +#define BSP_SPINCP_USART_PORT (HAL_SPI_PORT_USART2) +#define BSP_SPINCP_MOSI_PIN (0U) +#define BSP_SPINCP_MOSI_PORT (gpioPortK) +#define BSP_SPINCP_MOSI_LOC (29U) + +#define BSP_SPINCP_MISO_PIN (2U) +#define BSP_SPINCP_MISO_PORT (gpioPortK) +#define BSP_SPINCP_MISO_LOC (30U) + +#define BSP_SPINCP_CLK_PIN (7U) +#define BSP_SPINCP_CLK_PORT (gpioPortF) +#define BSP_SPINCP_CLK_LOC (18U) + +#define BSP_SPINCP_CS_PIN (5U) +#define BSP_SPINCP_CS_PORT (gpioPortA) +#define BSP_SPINCP_CS_LOC (29U) + +// [SPINCP]$ + +// $[TIMER0] +#define PORTIO_TIMER0_CC0_PIN (11U) +#define PORTIO_TIMER0_CC0_PORT (gpioPortD) +#define PORTIO_TIMER0_CC0_LOC (19U) + +#define PORTIO_TIMER0_CC1_PIN (12U) +#define PORTIO_TIMER0_CC1_PORT (gpioPortD) +#define PORTIO_TIMER0_CC1_LOC (19U) + +#define PORTIO_TIMER0_CC2_PIN (13U) +#define PORTIO_TIMER0_CC2_PORT (gpioPortD) +#define PORTIO_TIMER0_CC2_LOC (19U) + +#define BSP_TIMER0_CC0_PIN (11U) +#define BSP_TIMER0_CC0_PORT (gpioPortD) +#define BSP_TIMER0_CC0_LOC (19U) + +#define BSP_TIMER0_CC1_PIN (12U) +#define BSP_TIMER0_CC1_PORT (gpioPortD) +#define BSP_TIMER0_CC1_LOC (19U) + +#define BSP_TIMER0_CC2_PIN (13U) +#define BSP_TIMER0_CC2_PORT (gpioPortD) +#define BSP_TIMER0_CC2_LOC (19U) + +// [TIMER0]$ + +// $[UARTNCP] +#define BSP_UARTNCP_USART_PORT (HAL_SERIAL_PORT_USART0) +#define BSP_UARTNCP_TX_PIN (0U) +#define BSP_UARTNCP_TX_PORT (gpioPortA) +#define BSP_UARTNCP_TX_LOC (0U) + +#define BSP_UARTNCP_RX_PIN (1U) +#define BSP_UARTNCP_RX_PORT (gpioPortA) +#define BSP_UARTNCP_RX_LOC (0U) + +#define BSP_UARTNCP_CTS_PIN (2U) +#define BSP_UARTNCP_CTS_PORT (gpioPortA) +#define BSP_UARTNCP_CTS_LOC (30U) + +#define BSP_UARTNCP_RTS_PIN (3U) +#define BSP_UARTNCP_RTS_PORT (gpioPortA) +#define BSP_UARTNCP_RTS_LOC (30U) + +// [UARTNCP]$ + +// $[USART0] +#define PORTIO_USART0_CTS_PIN (2U) +#define PORTIO_USART0_CTS_PORT (gpioPortA) +#define PORTIO_USART0_CTS_LOC (30U) + +#define PORTIO_USART0_RTS_PIN (3U) +#define PORTIO_USART0_RTS_PORT (gpioPortA) +#define PORTIO_USART0_RTS_LOC (30U) + +#define PORTIO_USART0_RX_PIN (1U) +#define PORTIO_USART0_RX_PORT (gpioPortA) +#define PORTIO_USART0_RX_LOC (0U) + +#define PORTIO_USART0_TX_PIN (0U) +#define PORTIO_USART0_TX_PORT (gpioPortA) +#define PORTIO_USART0_TX_LOC (0U) + +#define BSP_USART0_TX_PIN (0U) +#define BSP_USART0_TX_PORT (gpioPortA) +#define BSP_USART0_TX_LOC (0U) + +#define BSP_USART0_RX_PIN (1U) +#define BSP_USART0_RX_PORT (gpioPortA) +#define BSP_USART0_RX_LOC (0U) + +#define BSP_USART0_CTS_PIN (2U) +#define BSP_USART0_CTS_PORT (gpioPortA) +#define BSP_USART0_CTS_LOC (30U) + +#define BSP_USART0_RTS_PIN (3U) +#define BSP_USART0_RTS_PORT (gpioPortA) +#define BSP_USART0_RTS_LOC (30U) + +// [USART0]$ + +// $[USART1] +#define PORTIO_USART1_CLK_PIN (8U) +#define PORTIO_USART1_CLK_PORT (gpioPortC) +#define PORTIO_USART1_CLK_LOC (11U) + +#define PORTIO_USART1_CS_PIN (9U) +#define PORTIO_USART1_CS_PORT (gpioPortC) +#define PORTIO_USART1_CS_LOC (11U) + +#define PORTIO_USART1_RX_PIN (7U) +#define PORTIO_USART1_RX_PORT (gpioPortC) +#define PORTIO_USART1_RX_LOC (11U) + +#define PORTIO_USART1_TX_PIN (6U) +#define PORTIO_USART1_TX_PORT (gpioPortC) +#define PORTIO_USART1_TX_LOC (11U) + +#define BSP_USART1_MOSI_PIN (6U) +#define BSP_USART1_MOSI_PORT (gpioPortC) +#define BSP_USART1_MOSI_LOC (11U) + +#define BSP_USART1_MISO_PIN (7U) +#define BSP_USART1_MISO_PORT (gpioPortC) +#define BSP_USART1_MISO_LOC (11U) + +#define BSP_USART1_CLK_PIN (8U) +#define BSP_USART1_CLK_PORT (gpioPortC) +#define BSP_USART1_CLK_LOC (11U) + +#define BSP_USART1_CS_PIN (9U) +#define BSP_USART1_CS_PORT (gpioPortC) +#define BSP_USART1_CS_LOC (11U) + +// [USART1]$ + +// $[USART2] +#define PORTIO_USART2_CLK_PIN (7U) +#define PORTIO_USART2_CLK_PORT (gpioPortF) +#define PORTIO_USART2_CLK_LOC (18U) + +#define PORTIO_USART2_CS_PIN (5U) +#define PORTIO_USART2_CS_PORT (gpioPortA) +#define PORTIO_USART2_CS_LOC (29U) + +#define PORTIO_USART2_RX_PIN (2U) +#define PORTIO_USART2_RX_PORT (gpioPortK) +#define PORTIO_USART2_RX_LOC (30U) + +#define PORTIO_USART2_TX_PIN (0U) +#define PORTIO_USART2_TX_PORT (gpioPortK) +#define PORTIO_USART2_TX_LOC (29U) + +#define BSP_USART2_MOSI_PIN (0U) +#define BSP_USART2_MOSI_PORT (gpioPortK) +#define BSP_USART2_MOSI_LOC (29U) + +#define BSP_USART2_MISO_PIN (2U) +#define BSP_USART2_MISO_PORT (gpioPortK) +#define BSP_USART2_MISO_LOC (30U) + +#define BSP_USART2_CLK_PIN (7U) +#define BSP_USART2_CLK_PORT (gpioPortF) +#define BSP_USART2_CLK_LOC (18U) + +#define BSP_USART2_CS_PIN (5U) +#define BSP_USART2_CS_PORT (gpioPortA) +#define BSP_USART2_CS_LOC (29U) + +// [USART2]$ + +// $[USART3] +#define PORTIO_USART3_CLK_PIN (2U) +#define PORTIO_USART3_CLK_PORT (gpioPortC) +#define PORTIO_USART3_CLK_LOC (18U) + +#define PORTIO_USART3_CS_PIN (3U) +#define PORTIO_USART3_CS_PORT (gpioPortC) +#define PORTIO_USART3_CS_LOC (18U) + +#define PORTIO_USART3_RX_PIN (1U) +#define PORTIO_USART3_RX_PORT (gpioPortC) +#define PORTIO_USART3_RX_LOC (18U) + +#define PORTIO_USART3_TX_PIN (0U) +#define PORTIO_USART3_TX_PORT (gpioPortC) +#define PORTIO_USART3_TX_LOC (18U) + +#define BSP_USART3_MOSI_PIN (0U) +#define BSP_USART3_MOSI_PORT (gpioPortC) +#define BSP_USART3_MOSI_LOC (18U) + +#define BSP_USART3_MISO_PIN (1U) +#define BSP_USART3_MISO_PORT (gpioPortC) +#define BSP_USART3_MISO_LOC (18U) + +#define BSP_USART3_CLK_PIN (2U) +#define BSP_USART3_CLK_PORT (gpioPortC) +#define BSP_USART3_CLK_LOC (18U) + +#define BSP_USART3_CS_PIN (3U) +#define BSP_USART3_CS_PORT (gpioPortC) +#define BSP_USART3_CS_LOC (18U) + +// [USART3]$ + +// $[Custom pin names] +#define HALL_ENABLE_PIN (10U) +#define HALL_ENABLE_PORT (gpioPortB) + +#define HALL_OUT1_PIN (11U) +#define HALL_OUT1_PORT (gpioPortB) + +#define IMU_ENABLE_PIN (8U) +#define IMU_ENABLE_PORT (gpioPortF) + +#define ENV_SENSE_ENABLE_PIN (9U) +#define ENV_SENSE_ENABLE_PORT (gpioPortF) + +#define MIC_ENABLE_PIN (10U) +#define MIC_ENABLE_PORT (gpioPortF) + +#define UV_ALS_INT_PIN (11U) +#define UV_ALS_INT_PORT (gpioPortF) + +#define IMU_INT_PIN (12U) +#define IMU_INT_PORT (gpioPortF) + +#define CCS811_INT_PIN (13U) +#define CCS811_INT_PORT (gpioPortF) + +#define CCS811_ENABLE_PIN (14U) +#define CCS811_ENABLE_PORT (gpioPortF) + +#define CCS811_WAKE_PIN (15U) +#define CCS811_WAKE_PORT (gpioPortF) + +#define RGB_LED_ENABLE_PIN (14U) +#define RGB_LED_ENABLE_PORT (gpioPortJ) + +// [Custom pin names]$ + +#if defined(_SILICON_LABS_MODULE) +#include "sl_module.h" #endif diff --git a/examples/platform/efr32/efr32mg12/BRD4166A/init_board.c b/examples/platform/efr32/efr32mg12/BRD4166A/init_board.c index bc7c3b99efe1bb..7f77f174717e5e 100644 --- a/examples/platform/efr32/efr32mg12/BRD4166A/init_board.c +++ b/examples/platform/efr32/efr32mg12/BRD4166A/init_board.c @@ -41,7 +41,7 @@ #include "board_features.h" #include "em_cmu.h" -#include "hal-config-board.h" +#include "hal-config.h" #include "em_cmu.h" diff --git a/examples/platform/efr32/efr32mg12/BRD4170A/hal-config.h b/examples/platform/efr32/efr32mg12/BRD4170A/hal-config.h index 23ff09ea861bf6..3d5761f3156ff1 100644 --- a/examples/platform/efr32/efr32mg12/BRD4170A/hal-config.h +++ b/examples/platform/efr32/efr32mg12/BRD4170A/hal-config.h @@ -32,12 +32,12 @@ * ******************************************************************************/ -#ifndef HAL_CONFIG_H -#define HAL_CONFIG_H +#pragma once #include "board_features.h" +#include "em_device.h" #include "hal-config-app-common.h" -#include "hal-config-board.h" +#include "hal-config-types.h" #ifndef HAL_VCOM_ENABLE #define HAL_VCOM_ENABLE (1) @@ -96,4 +96,372 @@ #define HAL_USART0_TX_QUEUE_SIZE (128UL) #define HAL_USART0_FLOW_CONTROL (HAL_USART_FLOW_CONTROL_NONE) +// $[BTL_BUTTON] + +#define BSP_BTL_BUTTON_PIN (6U) +#define BSP_BTL_BUTTON_PORT (gpioPortF) + +// [BTL_BUTTON]$ + +// $[BUTTON] +#define BSP_BUTTON_PRESENT (1) + +#define BSP_BUTTON0_PIN (6U) +#define BSP_BUTTON0_PORT (gpioPortF) + +#define BSP_BUTTON1_PIN (7U) +#define BSP_BUTTON1_PORT (gpioPortF) + +#define BSP_BUTTON_COUNT (2U) +#define BSP_BUTTON_INIT \ + { \ + { BSP_BUTTON0_PORT, BSP_BUTTON0_PIN }, { BSP_BUTTON1_PORT, BSP_BUTTON1_PIN } \ + } +#define BSP_BUTTON_GPIO_DOUT (HAL_GPIO_DOUT_LOW) +#define BSP_BUTTON_GPIO_MODE (HAL_GPIO_MODE_INPUT) +// [BUTTON]$ + +// $[CMU] +#define BSP_CLK_HFXO_PRESENT (1) +#define BSP_CLK_HFXO_FREQ (38400000UL) +#define BSP_CLK_HFXO_INIT CMU_HFXOINIT_DEFAULT +#define BSP_CLK_HFXO_CTUNE (340) +#define BSP_CLK_LFXO_PRESENT (1) +#define BSP_CLK_LFXO_INIT CMU_LFXOINIT_DEFAULT +#define BSP_CLK_LFXO_FREQ (32768U) +#define BSP_CLK_LFXO_CTUNE (32U) +// [CMU]$ + +// $[DCDC] +#define BSP_DCDC_PRESENT (1) + +#define BSP_DCDC_INIT EMU_DCDCINIT_DEFAULT +// [DCDC]$ + +// $[EXTFLASH] +#define BSP_EXTFLASH_CS_PIN (4U) +#define BSP_EXTFLASH_CS_PORT (gpioPortA) + +#define BSP_EXTFLASH_INTERNAL (0) +#define BSP_EXTFLASH_USART (HAL_SPI_PORT_USART1) +#define BSP_EXTFLASH_MOSI_PIN (6U) +#define BSP_EXTFLASH_MOSI_PORT (gpioPortC) +#define BSP_EXTFLASH_MOSI_LOC (11U) + +#define BSP_EXTFLASH_MISO_PIN (7U) +#define BSP_EXTFLASH_MISO_PORT (gpioPortC) +#define BSP_EXTFLASH_MISO_LOC (11U) + +#define BSP_EXTFLASH_CLK_PIN (8U) +#define BSP_EXTFLASH_CLK_PORT (gpioPortC) +#define BSP_EXTFLASH_CLK_LOC (11U) + +// [EXTFLASH]$ + +// $[GPIO] +#define PORTIO_GPIO_SWV_PIN (2U) +#define PORTIO_GPIO_SWV_PORT (gpioPortF) +#define PORTIO_GPIO_SWV_LOC (0U) + +#define BSP_TRACE_SWO_PIN (2U) +#define BSP_TRACE_SWO_PORT (gpioPortF) +#define BSP_TRACE_SWO_LOC (0U) + +// [GPIO]$ + +// $[I2C0] +#define PORTIO_I2C0_SCL_PIN (10U) +#define PORTIO_I2C0_SCL_PORT (gpioPortC) +#define PORTIO_I2C0_SCL_LOC (14U) + +#define PORTIO_I2C0_SDA_PIN (11U) +#define PORTIO_I2C0_SDA_PORT (gpioPortC) +#define PORTIO_I2C0_SDA_LOC (16U) + +#define BSP_I2C0_SCL_PIN (10U) +#define BSP_I2C0_SCL_PORT (gpioPortC) +#define BSP_I2C0_SCL_LOC (14U) + +#define BSP_I2C0_SDA_PIN (11U) +#define BSP_I2C0_SDA_PORT (gpioPortC) +#define BSP_I2C0_SDA_LOC (16U) + +// [I2C0]$ + +// $[I2CSENSOR] + +#define BSP_I2CSENSOR_ENABLE_PIN (10U) +#define BSP_I2CSENSOR_ENABLE_PORT (gpioPortB) + +#define BSP_I2CSENSOR_PERIPHERAL (HAL_I2C_PORT_I2C0) +#define BSP_I2CSENSOR_SCL_PIN (10U) +#define BSP_I2CSENSOR_SCL_PORT (gpioPortC) +#define BSP_I2CSENSOR_SCL_LOC (14U) + +#define BSP_I2CSENSOR_SDA_PIN (11U) +#define BSP_I2CSENSOR_SDA_PORT (gpioPortC) +#define BSP_I2CSENSOR_SDA_LOC (16U) + +// [I2CSENSOR]$ + +// $[LED] +#define BSP_LED_PRESENT (1) + +#define BSP_LED0_PIN (4U) +#define BSP_LED0_PORT (gpioPortF) + +#define BSP_LED1_PIN (5U) +#define BSP_LED1_PORT (gpioPortF) + +#define BSP_LED_COUNT (2U) +#define BSP_LED_INIT \ + { \ + { BSP_LED0_PORT, BSP_LED0_PIN }, { BSP_LED1_PORT, BSP_LED1_PIN } \ + } +#define BSP_LED_POLARITY (1) +// [LED]$ + +// $[PA] + +#define BSP_PA_VOLTAGE (3300U) +// [PA]$ + +// $[PRS] +#define PORTIO_PRS_CH4_PIN (13U) +#define PORTIO_PRS_CH4_PORT (gpioPortD) +#define PORTIO_PRS_CH4_LOC (4U) + +// [PRS]$ + +// $[PTI] +#define PORTIO_PTI_DCLK_PIN (11U) +#define PORTIO_PTI_DCLK_PORT (gpioPortB) +#define PORTIO_PTI_DCLK_LOC (6U) + +#define PORTIO_PTI_DFRAME_PIN (13U) +#define PORTIO_PTI_DFRAME_PORT (gpioPortB) +#define PORTIO_PTI_DFRAME_LOC (6U) + +#define PORTIO_PTI_DOUT_PIN (12U) +#define PORTIO_PTI_DOUT_PORT (gpioPortB) +#define PORTIO_PTI_DOUT_LOC (6U) + +#define BSP_PTI_DFRAME_PIN (13U) +#define BSP_PTI_DFRAME_PORT (gpioPortB) +#define BSP_PTI_DFRAME_LOC (6U) + +#define BSP_PTI_DOUT_PIN (12U) +#define BSP_PTI_DOUT_PORT (gpioPortB) +#define BSP_PTI_DOUT_LOC (6U) + +// [PTI]$ + +// $[SERIAL] +#define BSP_SERIAL_APP_TX_PIN (0U) +#define BSP_SERIAL_APP_TX_PORT (gpioPortA) +#define BSP_SERIAL_APP_TX_LOC (0U) + +#define BSP_SERIAL_APP_RX_PIN (1U) +#define BSP_SERIAL_APP_RX_PORT (gpioPortA) +#define BSP_SERIAL_APP_RX_LOC (0U) + +#define BSP_SERIAL_APP_CTS_PIN (2U) +#define BSP_SERIAL_APP_CTS_PORT (gpioPortA) +#define BSP_SERIAL_APP_CTS_LOC (30U) + +#define BSP_SERIAL_APP_RTS_PIN (3U) +#define BSP_SERIAL_APP_RTS_PORT (gpioPortA) +#define BSP_SERIAL_APP_RTS_LOC (30U) + +// [SERIAL]$ + +// $[SPIDISPLAY] + +#define BSP_SPIDISPLAY_CS_PIN (14U) +#define BSP_SPIDISPLAY_CS_PORT (gpioPortD) + +#define BSP_SPIDISPLAY_ENABLE_PIN (15U) +#define BSP_SPIDISPLAY_ENABLE_PORT (gpioPortD) + +#define BSP_SPIDISPLAY_EXTCOMIN_PIN (13U) +#define BSP_SPIDISPLAY_EXTCOMIN_PORT (gpioPortD) +#define BSP_SPIDISPLAY_EXTCOMIN_LOC (4U) + +#define BSP_SPIDISPLAY_DISPLAY (HAL_DISPLAY_SHARP_LS013B7DH03) +#define BSP_SPIDISPLAY_USART (HAL_SPI_PORT_USART1) +#define BSP_SPIDISPLAY_EXTCOMIN_CHANNEL (4) +#define BSP_SPIDISPLAY_MOSI_PIN (6U) +#define BSP_SPIDISPLAY_MOSI_PORT (gpioPortC) +#define BSP_SPIDISPLAY_MOSI_LOC (11U) + +#define BSP_SPIDISPLAY_MISO_PIN (7U) +#define BSP_SPIDISPLAY_MISO_PORT (gpioPortC) +#define BSP_SPIDISPLAY_MISO_LOC (11U) + +#define BSP_SPIDISPLAY_CLK_PIN (8U) +#define BSP_SPIDISPLAY_CLK_PORT (gpioPortC) +#define BSP_SPIDISPLAY_CLK_LOC (11U) + +// [SPIDISPLAY]$ + +// $[SPINCP] +#define BSP_SPINCP_NHOSTINT_PIN (10U) +#define BSP_SPINCP_NHOSTINT_PORT (gpioPortD) + +#define BSP_SPINCP_NWAKE_PIN (11U) +#define BSP_SPINCP_NWAKE_PORT (gpioPortD) + +#define BSP_SPINCP_USART_PORT (HAL_SPI_PORT_USART1) +#define BSP_SPINCP_MOSI_PIN (6U) +#define BSP_SPINCP_MOSI_PORT (gpioPortC) +#define BSP_SPINCP_MOSI_LOC (11U) + +#define BSP_SPINCP_MISO_PIN (7U) +#define BSP_SPINCP_MISO_PORT (gpioPortC) +#define BSP_SPINCP_MISO_LOC (11U) + +#define BSP_SPINCP_CLK_PIN (8U) +#define BSP_SPINCP_CLK_PORT (gpioPortC) +#define BSP_SPINCP_CLK_LOC (11U) + +#define BSP_SPINCP_CS_PIN (9U) +#define BSP_SPINCP_CS_PORT (gpioPortC) +#define BSP_SPINCP_CS_LOC (11U) + +// [SPINCP]$ + +// $[UARTNCP] +#define BSP_UARTNCP_USART_PORT (HAL_SERIAL_PORT_USART0) +#define BSP_UARTNCP_TX_PIN (0U) +#define BSP_UARTNCP_TX_PORT (gpioPortA) +#define BSP_UARTNCP_TX_LOC (0U) + +#define BSP_UARTNCP_RX_PIN (1U) +#define BSP_UARTNCP_RX_PORT (gpioPortA) +#define BSP_UARTNCP_RX_LOC (0U) + +#define BSP_UARTNCP_CTS_PIN (2U) +#define BSP_UARTNCP_CTS_PORT (gpioPortA) +#define BSP_UARTNCP_CTS_LOC (30U) + +#define BSP_UARTNCP_RTS_PIN (3U) +#define BSP_UARTNCP_RTS_PORT (gpioPortA) +#define BSP_UARTNCP_RTS_LOC (30U) + +// [UARTNCP]$ + +// $[USART0] +#define PORTIO_USART0_CTS_PIN (2U) +#define PORTIO_USART0_CTS_PORT (gpioPortA) +#define PORTIO_USART0_CTS_LOC (30U) + +#define PORTIO_USART0_RTS_PIN (3U) +#define PORTIO_USART0_RTS_PORT (gpioPortA) +#define PORTIO_USART0_RTS_LOC (30U) + +#define PORTIO_USART0_RX_PIN (1U) +#define PORTIO_USART0_RX_PORT (gpioPortA) +#define PORTIO_USART0_RX_LOC (0U) + +#define PORTIO_USART0_TX_PIN (0U) +#define PORTIO_USART0_TX_PORT (gpioPortA) +#define PORTIO_USART0_TX_LOC (0U) + +#define BSP_USART0_TX_PIN (0U) +#define BSP_USART0_TX_PORT (gpioPortA) +#define BSP_USART0_TX_LOC (0U) + +#define BSP_USART0_RX_PIN (1U) +#define BSP_USART0_RX_PORT (gpioPortA) +#define BSP_USART0_RX_LOC (0U) + +#define BSP_USART0_CTS_PIN (2U) +#define BSP_USART0_CTS_PORT (gpioPortA) +#define BSP_USART0_CTS_LOC (30U) + +#define BSP_USART0_RTS_PIN (3U) +#define BSP_USART0_RTS_PORT (gpioPortA) +#define BSP_USART0_RTS_LOC (30U) + +// [USART0]$ + +// $[USART1] +#define PORTIO_USART1_CLK_PIN (8U) +#define PORTIO_USART1_CLK_PORT (gpioPortC) +#define PORTIO_USART1_CLK_LOC (11U) + +#define PORTIO_USART1_CS_PIN (9U) +#define PORTIO_USART1_CS_PORT (gpioPortC) +#define PORTIO_USART1_CS_LOC (11U) + +#define PORTIO_USART1_RX_PIN (7U) +#define PORTIO_USART1_RX_PORT (gpioPortC) +#define PORTIO_USART1_RX_LOC (11U) + +#define PORTIO_USART1_TX_PIN (6U) +#define PORTIO_USART1_TX_PORT (gpioPortC) +#define PORTIO_USART1_TX_LOC (11U) + +#define BSP_USART1_MOSI_PIN (6U) +#define BSP_USART1_MOSI_PORT (gpioPortC) +#define BSP_USART1_MOSI_LOC (11U) + +#define BSP_USART1_MISO_PIN (7U) +#define BSP_USART1_MISO_PORT (gpioPortC) +#define BSP_USART1_MISO_LOC (11U) + +#define BSP_USART1_CLK_PIN (8U) +#define BSP_USART1_CLK_PORT (gpioPortC) +#define BSP_USART1_CLK_LOC (11U) + +#define BSP_USART1_CS_PIN (9U) +#define BSP_USART1_CS_PORT (gpioPortC) +#define BSP_USART1_CS_LOC (11U) + +// [USART1]$ + +// $[USART3] +#define PORTIO_USART3_CTS_PIN (8U) +#define PORTIO_USART3_CTS_PORT (gpioPortD) +#define PORTIO_USART3_CTS_LOC (28U) + +#define PORTIO_USART3_RTS_PIN (9U) +#define PORTIO_USART3_RTS_PORT (gpioPortD) +#define PORTIO_USART3_RTS_LOC (28U) + +#define PORTIO_USART3_RX_PIN (5U) +#define PORTIO_USART3_RX_PORT (gpioPortC) +#define PORTIO_USART3_RX_LOC (22U) + +#define PORTIO_USART3_TX_PIN (4U) +#define PORTIO_USART3_TX_PORT (gpioPortC) +#define PORTIO_USART3_TX_LOC (22U) + +#define BSP_USART3_TX_PIN (4U) +#define BSP_USART3_TX_PORT (gpioPortC) +#define BSP_USART3_TX_LOC (22U) + +#define BSP_USART3_RX_PIN (5U) +#define BSP_USART3_RX_PORT (gpioPortC) +#define BSP_USART3_RX_LOC (22U) + +#define BSP_USART3_CTS_PIN (8U) +#define BSP_USART3_CTS_PORT (gpioPortD) +#define BSP_USART3_CTS_LOC (28U) + +#define BSP_USART3_RTS_PIN (9U) +#define BSP_USART3_RTS_PORT (gpioPortD) +#define BSP_USART3_RTS_LOC (28U) + +// [USART3]$ + +// $[VCOM] + +#define BSP_VCOM_ENABLE_PIN (5U) +#define BSP_VCOM_ENABLE_PORT (gpioPortA) + +// [VCOM]$ + +#if defined(_SILICON_LABS_MODULE) +#include "sl_module.h" #endif diff --git a/examples/platform/efr32/efr32mg12/BRD4170A/init_board.c b/examples/platform/efr32/efr32mg12/BRD4170A/init_board.c index 517408d5ccd795..5d9e956849fd2e 100644 --- a/examples/platform/efr32/efr32mg12/BRD4170A/init_board.c +++ b/examples/platform/efr32/efr32mg12/BRD4170A/init_board.c @@ -41,7 +41,7 @@ #include "board_features.h" #include "em_cmu.h" -#include "hal-config-board.h" +#include "hal-config.h" #include "em_cmu.h" diff --git a/examples/platform/efr32/efr32mg12/BRD4304A/hal-config.h b/examples/platform/efr32/efr32mg12/BRD4304A/hal-config.h index 4df980fe0f7014..511d2bece21d28 100644 --- a/examples/platform/efr32/efr32mg12/BRD4304A/hal-config.h +++ b/examples/platform/efr32/efr32mg12/BRD4304A/hal-config.h @@ -32,12 +32,12 @@ * ******************************************************************************/ -#ifndef HAL_CONFIG_H -#define HAL_CONFIG_H +#pragma once #include "board_features.h" +#include "em_device.h" #include "hal-config-app-common.h" -#include "hal-config-board.h" +#include "hal-config-types.h" #ifndef HAL_VCOM_ENABLE #define HAL_VCOM_ENABLE (0) @@ -98,4 +98,378 @@ #define HAL_SERIAL_APP_TX_QUEUE_SIZE (128UL) #define HAL_SERIAL_APP_FLOW_CONTROL (HAL_USART_FLOW_CONTROL_HWUART) +// $[BTL_BUTTON] + +#define BSP_BTL_BUTTON_PIN (6U) +#define BSP_BTL_BUTTON_PORT (gpioPortF) + +// [BTL_BUTTON]$ + +// $[BUTTON] +#define BSP_BUTTON_PRESENT (1) + +#define BSP_BUTTON0_PIN (6U) +#define BSP_BUTTON0_PORT (gpioPortF) + +#define BSP_BUTTON1_PIN (7U) +#define BSP_BUTTON1_PORT (gpioPortF) + +#define BSP_BUTTON_COUNT (2U) +#define BSP_BUTTON_INIT \ + { \ + { BSP_BUTTON0_PORT, BSP_BUTTON0_PIN }, { BSP_BUTTON1_PORT, BSP_BUTTON1_PIN } \ + } +#define BSP_BUTTON_GPIO_DOUT (HAL_GPIO_DOUT_LOW) +#define BSP_BUTTON_GPIO_MODE (HAL_GPIO_MODE_INPUT) +// [BUTTON]$ + +// $[CMU] +#define BSP_CLK_HFXO_PRESENT (1) +#define BSP_CLK_HFXO_FREQ (38400000UL) +#define BSP_CLK_HFXO_INIT CMU_HFXOINIT_DEFAULT +#define BSP_CLK_HFXO_CTUNE (292) +#define BSP_CLK_LFXO_PRESENT (1) +#define BSP_CLK_LFXO_INIT CMU_LFXOINIT_DEFAULT +#define BSP_CLK_LFXO_FREQ (32768U) +#define BSP_CLK_LFXO_CTUNE (32U) +// [CMU]$ + +// $[DCDC] +#define BSP_DCDC_PRESENT (1) + +#define BSP_DCDC_INIT EMU_DCDCINIT_DEFAULT +// [DCDC]$ + +// $[EXTFLASH] +#define BSP_EXTFLASH_CS_PIN (4U) +#define BSP_EXTFLASH_CS_PORT (gpioPortA) + +#define BSP_EXTFLASH_INTERNAL (0) +#define BSP_EXTFLASH_USART (HAL_SPI_PORT_USART1) +#define BSP_EXTFLASH_MOSI_PIN (6U) +#define BSP_EXTFLASH_MOSI_PORT (gpioPortC) +#define BSP_EXTFLASH_MOSI_LOC (11U) + +#define BSP_EXTFLASH_MISO_PIN (7U) +#define BSP_EXTFLASH_MISO_PORT (gpioPortC) +#define BSP_EXTFLASH_MISO_LOC (11U) + +#define BSP_EXTFLASH_CLK_PIN (8U) +#define BSP_EXTFLASH_CLK_PORT (gpioPortC) +#define BSP_EXTFLASH_CLK_LOC (11U) + +// [EXTFLASH]$ + +// $[FEM] + +#define BSP_FEM_RX_PIN (10U) +#define BSP_FEM_RX_PORT (gpioPortD) +#define BSP_FEM_RX_LOC (0U) + +#define BSP_FEM_SLEEP_PIN (11U) +#define BSP_FEM_SLEEP_PORT (gpioPortD) +#define BSP_FEM_SLEEP_LOC (13U) + +#define BSP_FEM_RX_CHANNEL (5) +#define BSP_FEM_SLEEP_CHANNEL (6) +// [FEM]$ + +// $[GPIO] +#define PORTIO_GPIO_SWV_PIN (2U) +#define PORTIO_GPIO_SWV_PORT (gpioPortF) +#define PORTIO_GPIO_SWV_LOC (0U) + +#define BSP_TRACE_SWO_PIN (2U) +#define BSP_TRACE_SWO_PORT (gpioPortF) +#define BSP_TRACE_SWO_LOC (0U) + +// [GPIO]$ + +// $[I2C0] +#define PORTIO_I2C0_SCL_PIN (11U) +#define PORTIO_I2C0_SCL_PORT (gpioPortC) +#define PORTIO_I2C0_SCL_LOC (15U) + +#define PORTIO_I2C0_SDA_PIN (10U) +#define PORTIO_I2C0_SDA_PORT (gpioPortC) +#define PORTIO_I2C0_SDA_LOC (15U) + +#define BSP_I2C0_SCL_PIN (11U) +#define BSP_I2C0_SCL_PORT (gpioPortC) +#define BSP_I2C0_SCL_LOC (15U) + +#define BSP_I2C0_SDA_PIN (10U) +#define BSP_I2C0_SDA_PORT (gpioPortC) +#define BSP_I2C0_SDA_LOC (15U) + +// [I2C0]$ + +// $[I2CSENSOR] + +#define BSP_I2CSENSOR_ENABLE_PIN (15U) +#define BSP_I2CSENSOR_ENABLE_PORT (gpioPortD) + +#define BSP_I2CSENSOR_PERIPHERAL (HAL_I2C_PORT_I2C0) +#define BSP_I2CSENSOR_SCL_PIN (11U) +#define BSP_I2CSENSOR_SCL_PORT (gpioPortC) +#define BSP_I2CSENSOR_SCL_LOC (15U) + +#define BSP_I2CSENSOR_SDA_PIN (10U) +#define BSP_I2CSENSOR_SDA_PORT (gpioPortC) +#define BSP_I2CSENSOR_SDA_LOC (15U) + +// [I2CSENSOR]$ + +// $[LED] +#define BSP_LED_PRESENT (1) + +#define BSP_LED0_PIN (6U) +#define BSP_LED0_PORT (gpioPortF) + +#define BSP_LED1_PIN (7U) +#define BSP_LED1_PORT (gpioPortF) + +#define BSP_LED_COUNT (2U) +#define BSP_LED_INIT \ + { \ + { BSP_LED0_PORT, BSP_LED0_PIN }, { BSP_LED1_PORT, BSP_LED1_PIN } \ + } +// [LED]$ + +// $[PA] + +#define BSP_PA_VOLTAGE (3300U) +// [PA]$ + +// $[PRS] +#define PORTIO_PRS_CH4_PIN (13U) +#define PORTIO_PRS_CH4_PORT (gpioPortD) +#define PORTIO_PRS_CH4_LOC (4U) + +#define PORTIO_PRS_CH5_PIN (10U) +#define PORTIO_PRS_CH5_PORT (gpioPortD) +#define PORTIO_PRS_CH5_LOC (0U) + +#define PORTIO_PRS_CH6_PIN (11U) +#define PORTIO_PRS_CH6_PORT (gpioPortD) +#define PORTIO_PRS_CH6_LOC (13U) + +#define BSP_PRS_CH4_PIN (13U) +#define BSP_PRS_CH4_PORT (gpioPortD) +#define BSP_PRS_CH4_LOC (4U) + +#define BSP_PRS_SPIDISPLAY_EXTCOMIN_PIN (13U) +#define BSP_PRS_SPIDISPLAY_EXTCOMIN_PORT (gpioPortD) +#define BSP_PRS_SPIDISPLAY_EXTCOMIN_LOC (4U) + +#define BSP_PRS_CH5_PIN (10U) +#define BSP_PRS_CH5_PORT (gpioPortD) +#define BSP_PRS_CH5_LOC (0U) + +#define BSP_PRS_FEM_RX_PIN (10U) +#define BSP_PRS_FEM_RX_PORT (gpioPortD) +#define BSP_PRS_FEM_RX_LOC (0U) + +#define BSP_PRS_CH6_PIN (11U) +#define BSP_PRS_CH6_PORT (gpioPortD) +#define BSP_PRS_CH6_LOC (13U) + +#define BSP_PRS_FEM_SLEEP_PIN (11U) +#define BSP_PRS_FEM_SLEEP_PORT (gpioPortD) +#define BSP_PRS_FEM_SLEEP_LOC (13U) + +// [PRS]$ + +// $[PTI] +#define PORTIO_PTI_DFRAME_PIN (13U) +#define PORTIO_PTI_DFRAME_PORT (gpioPortB) +#define PORTIO_PTI_DFRAME_LOC (6U) + +#define PORTIO_PTI_DOUT_PIN (11U) +#define PORTIO_PTI_DOUT_PORT (gpioPortB) +#define PORTIO_PTI_DOUT_LOC (5U) + +#define BSP_PTI_DFRAME_PIN (13U) +#define BSP_PTI_DFRAME_PORT (gpioPortB) +#define BSP_PTI_DFRAME_LOC (6U) + +#define BSP_PTI_DOUT_PIN (11U) +#define BSP_PTI_DOUT_PORT (gpioPortB) +#define BSP_PTI_DOUT_LOC (5U) + +// [PTI]$ + +// $[SERIAL] +#define BSP_SERIAL_APP_TX_PIN (0U) +#define BSP_SERIAL_APP_TX_PORT (gpioPortA) +#define BSP_SERIAL_APP_TX_LOC (0U) + +#define BSP_SERIAL_APP_RX_PIN (1U) +#define BSP_SERIAL_APP_RX_PORT (gpioPortA) +#define BSP_SERIAL_APP_RX_LOC (0U) + +#define BSP_SERIAL_APP_CTS_PIN (2U) +#define BSP_SERIAL_APP_CTS_PORT (gpioPortA) +#define BSP_SERIAL_APP_CTS_LOC (30U) + +#define BSP_SERIAL_APP_RTS_PIN (3U) +#define BSP_SERIAL_APP_RTS_PORT (gpioPortA) +#define BSP_SERIAL_APP_RTS_LOC (30U) + +// [SERIAL]$ + +// $[SPIDISPLAY] + +#define BSP_SPIDISPLAY_CS_PIN (14U) +#define BSP_SPIDISPLAY_CS_PORT (gpioPortD) + +#define BSP_SPIDISPLAY_ENABLE_PIN (15U) +#define BSP_SPIDISPLAY_ENABLE_PORT (gpioPortD) + +#define BSP_SPIDISPLAY_EXTCOMIN_PIN (13U) +#define BSP_SPIDISPLAY_EXTCOMIN_PORT (gpioPortD) +#define BSP_SPIDISPLAY_EXTCOMIN_LOC (4U) + +#define BSP_SPIDISPLAY_DISPLAY (HAL_DISPLAY_SHARP_LS013B7DH03) +#define BSP_SPIDISPLAY_USART (HAL_SPI_PORT_USART1) +#define BSP_SPIDISPLAY_EXTCOMIN_CHANNEL (4) +#define BSP_SPIDISPLAY_MOSI_PIN (6U) +#define BSP_SPIDISPLAY_MOSI_PORT (gpioPortC) +#define BSP_SPIDISPLAY_MOSI_LOC (11U) + +#define BSP_SPIDISPLAY_MISO_PIN (7U) +#define BSP_SPIDISPLAY_MISO_PORT (gpioPortC) +#define BSP_SPIDISPLAY_MISO_LOC (11U) + +#define BSP_SPIDISPLAY_CLK_PIN (8U) +#define BSP_SPIDISPLAY_CLK_PORT (gpioPortC) +#define BSP_SPIDISPLAY_CLK_LOC (11U) + +// [SPIDISPLAY]$ + +// $[SPINCP] +#define BSP_SPINCP_NHOSTINT_PIN (4U) +#define BSP_SPINCP_NHOSTINT_PORT (gpioPortF) + +#define BSP_SPINCP_NWAKE_PIN (5U) +#define BSP_SPINCP_NWAKE_PORT (gpioPortF) + +#define BSP_SPINCP_USART_PORT (HAL_SPI_PORT_USART1) +#define BSP_SPINCP_MOSI_PIN (6U) +#define BSP_SPINCP_MOSI_PORT (gpioPortC) +#define BSP_SPINCP_MOSI_LOC (11U) + +#define BSP_SPINCP_MISO_PIN (7U) +#define BSP_SPINCP_MISO_PORT (gpioPortC) +#define BSP_SPINCP_MISO_LOC (11U) + +#define BSP_SPINCP_CLK_PIN (8U) +#define BSP_SPINCP_CLK_PORT (gpioPortC) +#define BSP_SPINCP_CLK_LOC (11U) + +#define BSP_SPINCP_CS_PIN (9U) +#define BSP_SPINCP_CS_PORT (gpioPortC) +#define BSP_SPINCP_CS_LOC (11U) + +// [SPINCP]$ + +// $[UARTNCP] +#define BSP_UARTNCP_USART_PORT (HAL_SERIAL_PORT_USART0) +#define BSP_UARTNCP_TX_PIN (0U) +#define BSP_UARTNCP_TX_PORT (gpioPortA) +#define BSP_UARTNCP_TX_LOC (0U) + +#define BSP_UARTNCP_RX_PIN (1U) +#define BSP_UARTNCP_RX_PORT (gpioPortA) +#define BSP_UARTNCP_RX_LOC (0U) + +#define BSP_UARTNCP_CTS_PIN (2U) +#define BSP_UARTNCP_CTS_PORT (gpioPortA) +#define BSP_UARTNCP_CTS_LOC (30U) + +#define BSP_UARTNCP_RTS_PIN (3U) +#define BSP_UARTNCP_RTS_PORT (gpioPortA) +#define BSP_UARTNCP_RTS_LOC (30U) + +// [UARTNCP]$ + +// $[USART0] +#define PORTIO_USART0_CTS_PIN (2U) +#define PORTIO_USART0_CTS_PORT (gpioPortA) +#define PORTIO_USART0_CTS_LOC (30U) + +#define PORTIO_USART0_RTS_PIN (3U) +#define PORTIO_USART0_RTS_PORT (gpioPortA) +#define PORTIO_USART0_RTS_LOC (30U) + +#define PORTIO_USART0_RX_PIN (1U) +#define PORTIO_USART0_RX_PORT (gpioPortA) +#define PORTIO_USART0_RX_LOC (0U) + +#define PORTIO_USART0_TX_PIN (0U) +#define PORTIO_USART0_TX_PORT (gpioPortA) +#define PORTIO_USART0_TX_LOC (0U) + +#define BSP_USART0_TX_PIN (0U) +#define BSP_USART0_TX_PORT (gpioPortA) +#define BSP_USART0_TX_LOC (0U) + +#define BSP_USART0_RX_PIN (1U) +#define BSP_USART0_RX_PORT (gpioPortA) +#define BSP_USART0_RX_LOC (0U) + +#define BSP_USART0_CTS_PIN (2U) +#define BSP_USART0_CTS_PORT (gpioPortA) +#define BSP_USART0_CTS_LOC (30U) + +#define BSP_USART0_RTS_PIN (3U) +#define BSP_USART0_RTS_PORT (gpioPortA) +#define BSP_USART0_RTS_LOC (30U) + +// [USART0]$ + +// $[USART1] +#define PORTIO_USART1_CLK_PIN (8U) +#define PORTIO_USART1_CLK_PORT (gpioPortC) +#define PORTIO_USART1_CLK_LOC (11U) + +#define PORTIO_USART1_CS_PIN (9U) +#define PORTIO_USART1_CS_PORT (gpioPortC) +#define PORTIO_USART1_CS_LOC (11U) + +#define PORTIO_USART1_RX_PIN (7U) +#define PORTIO_USART1_RX_PORT (gpioPortC) +#define PORTIO_USART1_RX_LOC (11U) + +#define PORTIO_USART1_TX_PIN (6U) +#define PORTIO_USART1_TX_PORT (gpioPortC) +#define PORTIO_USART1_TX_LOC (11U) + +#define BSP_USART1_MOSI_PIN (6U) +#define BSP_USART1_MOSI_PORT (gpioPortC) +#define BSP_USART1_MOSI_LOC (11U) + +#define BSP_USART1_MISO_PIN (7U) +#define BSP_USART1_MISO_PORT (gpioPortC) +#define BSP_USART1_MISO_LOC (11U) + +#define BSP_USART1_CLK_PIN (8U) +#define BSP_USART1_CLK_PORT (gpioPortC) +#define BSP_USART1_CLK_LOC (11U) + +#define BSP_USART1_CS_PIN (9U) +#define BSP_USART1_CS_PORT (gpioPortC) +#define BSP_USART1_CS_LOC (11U) + +// [USART1]$ + +// $[VCOM] + +#define BSP_VCOM_ENABLE_PIN (5U) +#define BSP_VCOM_ENABLE_PORT (gpioPortA) + +// [VCOM]$ + +#if defined(_SILICON_LABS_MODULE) +#include "sl_module.h" #endif diff --git a/examples/platform/efr32/efr32mg12/BRD4304A/init_board.c b/examples/platform/efr32/efr32mg12/BRD4304A/init_board.c index 609aad15e5dab5..ab6db6f5b68a4a 100644 --- a/examples/platform/efr32/efr32mg12/BRD4304A/init_board.c +++ b/examples/platform/efr32/efr32mg12/BRD4304A/init_board.c @@ -41,7 +41,7 @@ #include "board_features.h" #include "em_cmu.h" -#include "hal-config-board.h" +#include "hal-config.h" #include "em_cmu.h" diff --git a/examples/platform/efr32/efr32mg21/BRD4180A/hal-config.h b/examples/platform/efr32/efr32mg21/BRD4180A/hal-config.h index 4a3a7a87f16f87..520a2a2c7caf77 100644 --- a/examples/platform/efr32/efr32mg21/BRD4180A/hal-config.h +++ b/examples/platform/efr32/efr32mg21/BRD4180A/hal-config.h @@ -32,12 +32,12 @@ * ******************************************************************************/ -#ifndef HAL_CONFIG_H -#define HAL_CONFIG_H +#pragma once #include "board_features.h" +#include "em_device.h" #include "hal-config-app-common.h" -#include "hal-config-board.h" +#include "hal-config-types.h" #ifndef HAL_VCOM_ENABLE #define HAL_VCOM_ENABLE (1) @@ -89,4 +89,233 @@ #define HAL_USART0_TX_QUEUE_SIZE (128UL) #define HAL_USART0_FLOW_CONTROL (HAL_USART_FLOW_CONTROL_HWUART) +// $[BTL_BUTTON] + +#define BSP_BTL_BUTTON_PIN (2U) +#define BSP_BTL_BUTTON_PORT (gpioPortD) + +// [BTL_BUTTON]$ + +// $[BUTTON] +#define BSP_BUTTON_PRESENT (1) + +#define BSP_BUTTON0_PIN (2U) +#define BSP_BUTTON0_PORT (gpioPortD) + +#define BSP_BUTTON1_PIN (3U) +#define BSP_BUTTON1_PORT (gpioPortD) + +#define BSP_BUTTON_COUNT (2U) +#define BSP_BUTTON_INIT \ + { \ + { BSP_BUTTON0_PORT, BSP_BUTTON0_PIN }, { BSP_BUTTON1_PORT, BSP_BUTTON1_PIN } \ + } +#define BSP_BUTTON_GPIO_DOUT (HAL_GPIO_DOUT_LOW) +#define BSP_BUTTON_GPIO_MODE (HAL_GPIO_MODE_INPUT) +// [BUTTON]$ + +// $[CMU] +#define BSP_CLK_HFXO_PRESENT (1) +#define BSP_CLK_HFXO_FREQ (38400000UL) +#define BSP_CLK_HFXO_INIT CMU_HFXOINIT_DEFAULT +#define BSP_CLK_HFXO_CTUNE (129) +#define BSP_CLK_LFXO_PRESENT (1) +#define BSP_CLK_LFXO_INIT CMU_LFXOINIT_DEFAULT +#define BSP_CLK_LFXO_FREQ (32768U) +#define BSP_CLK_LFXO_CTUNE (79U) +// [CMU]$ + +// $[GPIO] +#define PORTIO_GPIO_SWV_PIN (3U) +#define PORTIO_GPIO_SWV_PORT (gpioPortA) + +#define BSP_TRACE_SWO_PIN (3U) +#define BSP_TRACE_SWO_PORT (gpioPortA) + +// [GPIO]$ + +// $[LED] +#define BSP_LED_PRESENT (1) + +#define BSP_LED0_PIN (0U) +#define BSP_LED0_PORT (gpioPortB) + +#define BSP_LED1_PIN (1U) +#define BSP_LED1_PORT (gpioPortB) + +#define BSP_LED_COUNT (2U) +#define BSP_LED_INIT \ + { \ + { BSP_LED0_PORT, BSP_LED0_PIN }, { BSP_LED1_PORT, BSP_LED1_PIN } \ + } +#define BSP_LED_POLARITY (1) +// [LED]$ + +// $[PA] + +#define BSP_PA_VOLTAGE (3300U) +// [PA]$ + +// $[PRS] +#define PORTIO_PRS_ASYNCH4_PIN (0U) +#define PORTIO_PRS_ASYNCH4_PORT (gpioPortA) + +// [PRS]$ + +// $[PTI] +#define PORTIO_PTI_DFRAME_PIN (5U) +#define PORTIO_PTI_DFRAME_PORT (gpioPortC) + +#define PORTIO_PTI_DOUT_PIN (4U) +#define PORTIO_PTI_DOUT_PORT (gpioPortC) + +#define BSP_PTI_DFRAME_PIN (5U) +#define BSP_PTI_DFRAME_PORT (gpioPortC) + +#define BSP_PTI_DOUT_PIN (4U) +#define BSP_PTI_DOUT_PORT (gpioPortC) + +// [PTI]$ + +// $[SERIAL] +#define BSP_SERIAL_APP_TX_PIN (5U) +#define BSP_SERIAL_APP_TX_PORT (gpioPortA) + +#define BSP_SERIAL_APP_RX_PIN (6U) +#define BSP_SERIAL_APP_RX_PORT (gpioPortA) + +#define BSP_SERIAL_APP_CTS_PIN (4U) +#define BSP_SERIAL_APP_CTS_PORT (gpioPortA) + +#define BSP_SERIAL_APP_RTS_PIN (1U) +#define BSP_SERIAL_APP_RTS_PORT (gpioPortC) + +// [SERIAL]$ + +// $[SPIDISPLAY] + +#define BSP_SPIDISPLAY_CS_PIN (3U) +#define BSP_SPIDISPLAY_CS_PORT (gpioPortC) + +#define BSP_SPIDISPLAY_ENABLE_PIN (4U) +#define BSP_SPIDISPLAY_ENABLE_PORT (gpioPortD) + +#define BSP_SPIDISPLAY_EXTCOMIN_PIN (0U) +#define BSP_SPIDISPLAY_EXTCOMIN_PORT (gpioPortA) + +#define BSP_SPIDISPLAY_DISPLAY (HAL_DISPLAY_SHARP_LS013B7DH03) +#define BSP_SPIDISPLAY_USART (HAL_SPI_PORT_USART2) +#define BSP_SPIDISPLAY_EXTCOMIN_CHANNEL (4) +#define BSP_SPIDISPLAY_MOSI_PIN (0U) +#define BSP_SPIDISPLAY_MOSI_PORT (gpioPortC) + +#define BSP_SPIDISPLAY_MISO_PIN (1U) +#define BSP_SPIDISPLAY_MISO_PORT (gpioPortC) + +#define BSP_SPIDISPLAY_CLK_PIN (2U) +#define BSP_SPIDISPLAY_CLK_PORT (gpioPortC) + +// [SPIDISPLAY]$ + +// $[SPINCP] +#define BSP_SPINCP_NHOSTINT_PIN (2U) +#define BSP_SPINCP_NHOSTINT_PORT (gpioPortD) + +#define BSP_SPINCP_NWAKE_PIN (3U) +#define BSP_SPINCP_NWAKE_PORT (gpioPortD) + +#define BSP_SPINCP_USART_PORT (HAL_SPI_PORT_USART2) +#define BSP_SPINCP_MOSI_PIN (0U) +#define BSP_SPINCP_MOSI_PORT (gpioPortC) + +#define BSP_SPINCP_MISO_PIN (1U) +#define BSP_SPINCP_MISO_PORT (gpioPortC) + +#define BSP_SPINCP_CLK_PIN (2U) +#define BSP_SPINCP_CLK_PORT (gpioPortC) + +#define BSP_SPINCP_CS_PIN (3U) +#define BSP_SPINCP_CS_PORT (gpioPortC) + +// [SPINCP]$ + +// $[UARTNCP] +#define BSP_UARTNCP_USART_PORT (HAL_SERIAL_PORT_USART0) +#define BSP_UARTNCP_TX_PIN (5U) +#define BSP_UARTNCP_TX_PORT (gpioPortA) + +#define BSP_UARTNCP_RX_PIN (6U) +#define BSP_UARTNCP_RX_PORT (gpioPortA) + +#define BSP_UARTNCP_CTS_PIN (4U) +#define BSP_UARTNCP_CTS_PORT (gpioPortA) + +#define BSP_UARTNCP_RTS_PIN (1U) +#define BSP_UARTNCP_RTS_PORT (gpioPortC) + +// [UARTNCP]$ + +// $[USART0] +#define PORTIO_USART0_CTS_PIN (4U) +#define PORTIO_USART0_CTS_PORT (gpioPortA) + +#define PORTIO_USART0_RTS_PIN (1U) +#define PORTIO_USART0_RTS_PORT (gpioPortC) + +#define PORTIO_USART0_RX_PIN (6U) +#define PORTIO_USART0_RX_PORT (gpioPortA) + +#define PORTIO_USART0_TX_PIN (5U) +#define PORTIO_USART0_TX_PORT (gpioPortA) + +#define BSP_USART0_TX_PIN (5U) +#define BSP_USART0_TX_PORT (gpioPortA) + +#define BSP_USART0_RX_PIN (6U) +#define BSP_USART0_RX_PORT (gpioPortA) + +#define BSP_USART0_CTS_PIN (4U) +#define BSP_USART0_CTS_PORT (gpioPortA) + +#define BSP_USART0_RTS_PIN (1U) +#define BSP_USART0_RTS_PORT (gpioPortC) + +// [USART0]$ + +// $[USART2] +#define PORTIO_USART2_CLK_PIN (2U) +#define PORTIO_USART2_CLK_PORT (gpioPortC) + +#define PORTIO_USART2_CS_PIN (3U) +#define PORTIO_USART2_CS_PORT (gpioPortC) + +#define PORTIO_USART2_RX_PIN (1U) +#define PORTIO_USART2_RX_PORT (gpioPortC) + +#define PORTIO_USART2_TX_PIN (0U) +#define PORTIO_USART2_TX_PORT (gpioPortC) + +#define BSP_USART2_MOSI_PIN (0U) +#define BSP_USART2_MOSI_PORT (gpioPortC) + +#define BSP_USART2_MISO_PIN (1U) +#define BSP_USART2_MISO_PORT (gpioPortC) + +#define BSP_USART2_CLK_PIN (2U) +#define BSP_USART2_CLK_PORT (gpioPortC) + +#define BSP_USART2_CS_PIN (3U) +#define BSP_USART2_CS_PORT (gpioPortC) + +// [USART2]$ + +// $[VCOM] + +#define BSP_VCOM_ENABLE_PIN (4U) +#define BSP_VCOM_ENABLE_PORT (gpioPortD) + +// [VCOM]$ + +#if defined(_SILICON_LABS_MODULE) +#include "sl_module.h" #endif diff --git a/examples/platform/efr32/efr32mg21/BRD4180A/init_board.c b/examples/platform/efr32/efr32mg21/BRD4180A/init_board.c index cdaead06790bee..e3957ec00b3bf9 100644 --- a/examples/platform/efr32/efr32mg21/BRD4180A/init_board.c +++ b/examples/platform/efr32/efr32mg21/BRD4180A/init_board.c @@ -41,7 +41,7 @@ #include "board_features.h" #include "em_cmu.h" -#include "hal-config-board.h" +#include "hal-config.h" #include "bsp.h" diff --git a/examples/platform/efr32/init_otSystem.c b/examples/platform/efr32/init_otSystem.c index ff9c8d2fdb3e6f..ce10533150394f 100644 --- a/examples/platform/efr32/init_otSystem.c +++ b/examples/platform/efr32/init_otSystem.c @@ -126,8 +126,6 @@ void initOtSysEFR(void) efr32RadioInit(); efr32AlarmInit(); efr32MiscInit(); - - otHeapSetCAllocFree(CHIPPlatformMemoryCalloc, CHIPPlatformMemoryFree); } void halInitChipSpecific(void) diff --git a/examples/platform/efr32/uart.c b/examples/platform/efr32/uart.c index 1099555319e70c..f33a2c10ef5ae1 100644 --- a/examples/platform/efr32/uart.c +++ b/examples/platform/efr32/uart.c @@ -18,7 +18,6 @@ #include "uart.h" #include "em_core.h" #include "em_usart.h" -#include "hal-config-board.h" #include "hal-config.h" #include "init_board.h" #include "uartdrv.h" diff --git a/src/platform/EFR32/ThreadStackManagerImpl.cpp b/src/platform/EFR32/ThreadStackManagerImpl.cpp index 14cb14df18bf26..66edcea07a5952 100644 --- a/src/platform/EFR32/ThreadStackManagerImpl.cpp +++ b/src/platform/EFR32/ThreadStackManagerImpl.cpp @@ -34,6 +34,8 @@ #include +#include + namespace chip { namespace DeviceLayer { @@ -123,3 +125,13 @@ extern "C" void otSysEventSignalPending(void) BaseType_t yieldRequired = ThreadStackMgrImpl().SignalThreadActivityPendingFromISR(); portYIELD_FROM_ISR(yieldRequired); } + +extern "C" void * otPlatCAlloc(size_t aNum, size_t aSize) +{ + return CHIPPlatformMemoryCalloc(aNum, aSize); +} + +extern "C" void otPlatFree(void * aPtr) +{ + CHIPPlatformMemoryFree(aPtr); +} diff --git a/src/platform/cc13x2_26x2/ThreadStackManagerImpl.cpp b/src/platform/cc13x2_26x2/ThreadStackManagerImpl.cpp index 67a6b992968502..dd56461b498e65 100644 --- a/src/platform/cc13x2_26x2/ThreadStackManagerImpl.cpp +++ b/src/platform/cc13x2_26x2/ThreadStackManagerImpl.cpp @@ -85,7 +85,6 @@ CHIP_ERROR ThreadStackManagerImpl::InitThreadStack(otInstance * otInst) #if OPENTHREAD_CONFIG_HEAP_EXTERNAL_ENABLE != 0 mbedtls_platform_set_calloc_free(ot_calloc, ot_free); - otHeapSetCAllocFree(ot_calloc, ot_free); #endif /* OPENTHREAD_CONFIG_HEAP_EXTERNAL_ENABLE != 0 */ // Initialize the OpenThread platform layer diff --git a/src/platform/qpg6100/Logging.cpp b/src/platform/qpg6100/Logging.cpp index a2fa6a49af4bb8..21bee43d1ad0bd 100644 --- a/src/platform/qpg6100/Logging.cpp +++ b/src/platform/qpg6100/Logging.cpp @@ -5,6 +5,7 @@ #include #include +#include #include #include @@ -12,6 +13,7 @@ #if CHIP_DEVICE_CONFIG_ENABLE_THREAD #include +#include #endif // CHIP_DEVICE_CONFIG_ENABLE_THREAD constexpr uint8_t kPrintfModuleLwip = 0x01; @@ -120,4 +122,21 @@ extern "C" void otPlatLog(otLogLevel aLogLevel, otLogRegion aLogRegion, const ch // Let the application know that a log message has been emitted. chip::DeviceLayer::OnLogOutput(); } + +// TODO: have qpg6100 openthread platform implementation defines the APIs. +// It is not perfect to have the openthread platform calloc/free +// APIs defined here. If a dedicated source file (e.g. Memory.cpp) +// that includes only the two functions is used, the target file +// Memory.o will be thrown away whening linking the libary because +// there is no one referring the symbols (We are not linking +// the 'platform' library against openthread). +extern "C" void * otPlatCAlloc(size_t aNum, size_t aSize) +{ + return CHIPPlatformMemoryCalloc(aNum, aSize); +} + +extern "C" void otPlatFree(void * aPtr) +{ + CHIPPlatformMemoryFree(aPtr); +} #endif // CHIP_DEVICE_CONFIG_ENABLE_THREAD diff --git a/src/platform/qpg6100/ThreadStackManagerImpl.cpp b/src/platform/qpg6100/ThreadStackManagerImpl.cpp index c126cb54148820..a68d56af129aed 100644 --- a/src/platform/qpg6100/ThreadStackManagerImpl.cpp +++ b/src/platform/qpg6100/ThreadStackManagerImpl.cpp @@ -58,8 +58,6 @@ CHIP_ERROR ThreadStackManagerImpl::InitThreadStack(otInstance * otInst) { CHIP_ERROR err = CHIP_NO_ERROR; - otHeapSetCAllocFree(CHIPPlatformMemoryCalloc, CHIPPlatformMemoryFree); - // Initialize Low level QPG OpenThread glue qorvoAlarmInit(); qorvoRandomInit(); diff --git a/third_party/efr32_sdk/efr32_sdk.gni b/third_party/efr32_sdk/efr32_sdk.gni index 211eedfcad74c7..28dd8a5d8595ee 100644 --- a/third_party/efr32_sdk/efr32_sdk.gni +++ b/third_party/efr32_sdk/efr32_sdk.gni @@ -62,6 +62,7 @@ template("efr32_sdk") { "${efr32_sdk_root}/platform/base/hal/micro/cortexm3/efm32/config", "${efr32_sdk_root}/platform/base/hal/micro/cortexm3", "${efr32_sdk_root}/platform/base/hal/plugin", + "${efr32_sdk_root}/platform/service/device_init/inc", "${efr32_sdk_root}/platform/CMSIS/Include", "${efr32_sdk_root}/platform/emdrv/common/inc", "${efr32_sdk_root}/platform/emdrv/gpiointerrupt/inc", @@ -112,6 +113,28 @@ template("efr32_sdk") { "${mbedtls_root}/repo/include", ] + if (efr32_board == "BRD4166A") { + _include_dirs += [ "${efr32_sdk_root}/hardware/board/config/brd4166a" ] + } else if (efr32_board == "BRD4161A") { + _include_dirs += + [ "${efr32_sdk_root}/hardware/board/config/brd4161a_brd4001a" ] + } else if (efr32_board == "BRD4163A") { + _include_dirs += + [ "${efr32_sdk_root}/hardware/board/config/brd4163a_brd4001a" ] + } else if (efr32_board == "BRD4164A") { + _include_dirs += + [ "${efr32_sdk_root}/hardware/board/config/brd4164a_brd4001a" ] + } else if (efr32_board == "BRD4170A") { + _include_dirs += + [ "${efr32_sdk_root}/hardware/board/config/brd4170a_brd4001a" ] + } else if (efr32_board == "BRD4304A") { + _include_dirs += + [ "${efr32_sdk_root}/hardware/board/config/brd4304a_brd4001a" ] + } else if (efr32_board == "BRD4180A") { + _include_dirs += + [ "${efr32_sdk_root}/hardware/board/config/brd4180a_brd4001a" ] + } + defines = [ "MBEDTLS_CONFIG_FILE=\"efr32-chip-mbedtls-config.h\"", "__STARTUP_CLEAR_BSS", @@ -195,7 +218,6 @@ template("efr32_sdk") { "${efr32_sdk_root}/hardware/kit/common/bsp/bsp_init.c", "${efr32_sdk_root}/hardware/kit/common/bsp/bsp_stk.c", "${efr32_sdk_root}/hardware/kit/common/bsp/bsp_stk_leds.c", - "${efr32_sdk_root}/hardware/kit/common/drivers/retargetserial.c", "${efr32_sdk_root}/hardware/kit/common/drivers/udelay.c", "${efr32_sdk_root}/platform/bootloader/plugin/security/sha/crypto_sha.c", "${efr32_sdk_root}/platform/common/src/sl_slist.c", diff --git a/third_party/openthread/repo b/third_party/openthread/repo index 98dea576fdc88a..d8a2cd9a70cfda 160000 --- a/third_party/openthread/repo +++ b/third_party/openthread/repo @@ -1 +1 @@ -Subproject commit 98dea576fdc88a5f7eaf16512e0b680291d57d39 +Subproject commit d8a2cd9a70cfda7c2657645b4a57411eadaa4e61 diff --git a/third_party/ot-br-posix/repo b/third_party/ot-br-posix/repo index 83babaf236cad8..81a4392f7f7574 160000 --- a/third_party/ot-br-posix/repo +++ b/third_party/ot-br-posix/repo @@ -1 +1 @@ -Subproject commit 83babaf236cad8471be28185d8d4351d37564919 +Subproject commit 81a4392f7f757482f37822c5e9d7fa4a899b8184