From a663ab7d01f904ea62526c5090891a09899d5e9d Mon Sep 17 00:00:00 2001 From: bhmanda-silabs <107180296+bhmanda-silabs@users.noreply.github.com> Date: Thu, 29 Aug 2024 17:59:46 +0530 Subject: [PATCH] [SiWx917] - Adding autogen and config files for brd2605a devkit board (#224) * Added autogen and config files for brd2605a wifi SoC board * Moved si91x support files to common folder and removed config files which are not required in CSA --------- Co-authored-by: bhmanda --- .../siwx917/BRD2605A/autogen/RTE_Components.h | 34 + .../BRD2605A/autogen/sl_component_catalog.h | 33 + .../BRD2605A/autogen/sl_event_handler.c | 70 + .../BRD2605A/autogen/sl_event_handler.h | 12 + .../BRD2605A/autogen/sl_iostream_handles.c | 27 + .../BRD2605A/autogen/sl_iostream_handles.h | 20 + .../autogen/sl_iostream_init_instances.h | 16 + .../autogen/sl_si91x_button_instances.c | 59 + .../autogen/sl_si91x_button_instances.h | 43 + .../BRD2605A/autogen/sl_si91x_led_instances.c | 43 + .../BRD2605A/autogen/sl_si91x_led_instances.h | 41 + .../autogen/sl_si91x_power_manager_handler.c | 96 + .../autogen/sl_si91x_power_manager_init.h | 51 + .../sl_si91x_power_manager_wakeup_handler.c | 37 + .../sl_si91x_power_manager_wakeup_handler.h | 44 + .../BRD2605A/autogen/sl_ulp_timer_init.c | 49 + .../BRD2605A/autogen/sl_ulp_timer_instances.h | 53 + .../autogen/sli_mbedtls_config_autogen.h | 49 + .../sli_mbedtls_config_transform_autogen.h | 51 + .../siwx917/BRD2605A/config/RTE_Device_917.h | 4909 +++++++++++++++++ .../siwx917/BRD2605A/config/SEGGER_RTT_Conf.h | 428 ++ .../BRD2605A/config/emlib_core_debug_config.h | 45 + .../BRD2605A/config/nvm3_default_config.h | 62 + .../siwx917/BRD2605A/config/pin_config.h | 140 + .../BRD2605A/config/sl_board_configuration.h | 23 + .../BRD2605A/config/sl_board_control.h | 22 + .../siwx917/BRD2605A/config/sl_core_config.h | 44 + .../BRD2605A/config/sl_mbedtls_config.h | 118 + .../config/sl_mbedtls_device_config.h | 70 + .../config/sl_memory_manager_config.h | 49 + .../config/sl_memory_manager_region_config.h | 49 + .../BRD2605A/config/sl_net_default_values.h | 149 + .../config/sl_si91x_button_btn0_config.h | 28 + .../config/sl_si91x_button_btn1_config.h | 28 + .../config/sl_si91x_button_pin_config.h | 25 + .../BRD2605A/config/sl_si91x_dma_config.h | 52 + .../BRD2605A/config/sl_si91x_led_config.h | 36 + .../config/sl_si91x_power_manager_config_3.h | 358 ++ ...si91x_power_manager_wakeup_source_config.h | 96 + .../config/sl_si91x_stack_size_config.h | 35 + .../config/sl_si91x_ulp_timer_common_config.h | 84 + .../sl_si91x_ulp_timer_init_timer0_config.h | 67 + .../config/sl_si91x_ulp_uart_common_config.h | 43 + .../config/sl_si91x_ulp_uart_config.h | 104 + .../BRD2605A/config/sl_sleeptimer_config.h | 82 + .../BRD2605A/support/hal/rsi_hal_mcu_m4.c | 82 + .../BRD2605A/support/inc/system_si917.h | 168 + .../support/src/startup_common_RS1xxxx.c | 514 ++ matter/si91x/support/hal/rsi_hal_mcu_m4.c | 82 + matter/si91x/support/inc/system_si917.h | 168 + .../support/src/startup_common_RS1xxxx.c | 514 ++ 51 files changed, 9502 insertions(+) create mode 100644 matter/si91x/siwx917/BRD2605A/autogen/RTE_Components.h create mode 100644 matter/si91x/siwx917/BRD2605A/autogen/sl_component_catalog.h create mode 100644 matter/si91x/siwx917/BRD2605A/autogen/sl_event_handler.c create mode 100644 matter/si91x/siwx917/BRD2605A/autogen/sl_event_handler.h create mode 100644 matter/si91x/siwx917/BRD2605A/autogen/sl_iostream_handles.c create mode 100644 matter/si91x/siwx917/BRD2605A/autogen/sl_iostream_handles.h create mode 100644 matter/si91x/siwx917/BRD2605A/autogen/sl_iostream_init_instances.h create mode 100644 matter/si91x/siwx917/BRD2605A/autogen/sl_si91x_button_instances.c create mode 100644 matter/si91x/siwx917/BRD2605A/autogen/sl_si91x_button_instances.h create mode 100644 matter/si91x/siwx917/BRD2605A/autogen/sl_si91x_led_instances.c create mode 100644 matter/si91x/siwx917/BRD2605A/autogen/sl_si91x_led_instances.h create mode 100644 matter/si91x/siwx917/BRD2605A/autogen/sl_si91x_power_manager_handler.c create mode 100644 matter/si91x/siwx917/BRD2605A/autogen/sl_si91x_power_manager_init.h create mode 100644 matter/si91x/siwx917/BRD2605A/autogen/sl_si91x_power_manager_wakeup_handler.c create mode 100644 matter/si91x/siwx917/BRD2605A/autogen/sl_si91x_power_manager_wakeup_handler.h create mode 100644 matter/si91x/siwx917/BRD2605A/autogen/sl_ulp_timer_init.c create mode 100644 matter/si91x/siwx917/BRD2605A/autogen/sl_ulp_timer_instances.h create mode 100644 matter/si91x/siwx917/BRD2605A/autogen/sli_mbedtls_config_autogen.h create mode 100644 matter/si91x/siwx917/BRD2605A/autogen/sli_mbedtls_config_transform_autogen.h create mode 100644 matter/si91x/siwx917/BRD2605A/config/RTE_Device_917.h create mode 100644 matter/si91x/siwx917/BRD2605A/config/SEGGER_RTT_Conf.h create mode 100644 matter/si91x/siwx917/BRD2605A/config/emlib_core_debug_config.h create mode 100644 matter/si91x/siwx917/BRD2605A/config/nvm3_default_config.h create mode 100644 matter/si91x/siwx917/BRD2605A/config/pin_config.h create mode 100644 matter/si91x/siwx917/BRD2605A/config/sl_board_configuration.h create mode 100644 matter/si91x/siwx917/BRD2605A/config/sl_board_control.h create mode 100644 matter/si91x/siwx917/BRD2605A/config/sl_core_config.h create mode 100644 matter/si91x/siwx917/BRD2605A/config/sl_mbedtls_config.h create mode 100644 matter/si91x/siwx917/BRD2605A/config/sl_mbedtls_device_config.h create mode 100644 matter/si91x/siwx917/BRD2605A/config/sl_memory_manager_config.h create mode 100644 matter/si91x/siwx917/BRD2605A/config/sl_memory_manager_region_config.h create mode 100644 matter/si91x/siwx917/BRD2605A/config/sl_net_default_values.h create mode 100644 matter/si91x/siwx917/BRD2605A/config/sl_si91x_button_btn0_config.h create mode 100644 matter/si91x/siwx917/BRD2605A/config/sl_si91x_button_btn1_config.h create mode 100644 matter/si91x/siwx917/BRD2605A/config/sl_si91x_button_pin_config.h create mode 100644 matter/si91x/siwx917/BRD2605A/config/sl_si91x_dma_config.h create mode 100644 matter/si91x/siwx917/BRD2605A/config/sl_si91x_led_config.h create mode 100644 matter/si91x/siwx917/BRD2605A/config/sl_si91x_power_manager_config_3.h create mode 100644 matter/si91x/siwx917/BRD2605A/config/sl_si91x_power_manager_wakeup_source_config.h create mode 100644 matter/si91x/siwx917/BRD2605A/config/sl_si91x_stack_size_config.h create mode 100644 matter/si91x/siwx917/BRD2605A/config/sl_si91x_ulp_timer_common_config.h create mode 100644 matter/si91x/siwx917/BRD2605A/config/sl_si91x_ulp_timer_init_timer0_config.h create mode 100644 matter/si91x/siwx917/BRD2605A/config/sl_si91x_ulp_uart_common_config.h create mode 100644 matter/si91x/siwx917/BRD2605A/config/sl_si91x_ulp_uart_config.h create mode 100644 matter/si91x/siwx917/BRD2605A/config/sl_sleeptimer_config.h create mode 100644 matter/si91x/siwx917/BRD2605A/support/hal/rsi_hal_mcu_m4.c create mode 100644 matter/si91x/siwx917/BRD2605A/support/inc/system_si917.h create mode 100644 matter/si91x/siwx917/BRD2605A/support/src/startup_common_RS1xxxx.c create mode 100644 matter/si91x/support/hal/rsi_hal_mcu_m4.c create mode 100644 matter/si91x/support/inc/system_si917.h create mode 100644 matter/si91x/support/src/startup_common_RS1xxxx.c diff --git a/matter/si91x/siwx917/BRD2605A/autogen/RTE_Components.h b/matter/si91x/siwx917/BRD2605A/autogen/RTE_Components.h new file mode 100644 index 0000000000..6531f566c5 --- /dev/null +++ b/matter/si91x/siwx917/BRD2605A/autogen/RTE_Components.h @@ -0,0 +1,34 @@ +// This file is autogenerated by Simplicity Configuration Tools. +// The contents of this file will be replaced in their entirety upon regeneration. +// +// Source template file: RTE_Components.h.jinja + + +#ifndef RTE_COMPONENTS_H +#define RTE_COMPONENTS_H + +/* standard device header from emlib */ +#define CMSIS_device_header "em_device.h" + +/* components are auto-generated here */ + +#define RTE_RTOS_FreeRTOS_CORE + +#define RTE_RTOS_FreeRTOS_CONFIG_RTOS2 + +#define RTE_RTOS_FreeRTOS_COROUTINE + +#define RTE_RTOS_FreeRTOS_EVENTGROUPS + +#define RTE_RTOS_FreeRTOS_TIMERS + +#define RTE_RTOS_FreeRTOS_HEAP_3 + + +#endif /* RTE_COMPONENTS_H */ + +/* This file is autogenerated by Simplicity Configuration Tools. */ +/* The contents of this file will be replaced in their entirety upon regeneration. */ +/* */ +/* Source template file: RTE_Components.h.jinja */ + diff --git a/matter/si91x/siwx917/BRD2605A/autogen/sl_component_catalog.h b/matter/si91x/siwx917/BRD2605A/autogen/sl_component_catalog.h new file mode 100644 index 0000000000..dda861e4b0 --- /dev/null +++ b/matter/si91x/siwx917/BRD2605A/autogen/sl_component_catalog.h @@ -0,0 +1,33 @@ +#ifndef SL_COMPONENT_CATALOG_H +#define SL_COMPONENT_CATALOG_H + +// APIs present in project +#define SL_CATALOG_BTN0_PRESENT +#define SL_CATALOG_SIMPLE_BUTTON_PRESENT +#define SL_CATALOG_SIMPLE_BUTTON_BTN0_PRESENT +#define SL_CATALOG_BTN1_PRESENT +#define SL_CATALOG_SIMPLE_BUTTON_BTN1_PRESENT +#define SL_CATALOG_LEDB_PRESENT +#define SL_CATALOG_SIMPLE_LED_PRESENT +#define SL_CATALOG_SIMPLE_LED_LEDB_PRESENT +#define SL_CATALOG_ULP_TIMER_PRESENT +#define SL_CATALOG_ULP_TIMER_TIMER0_PRESENT +#define SL_CATALOG_CMSIS_OS_COMMON_PRESENT +#define SL_CATALOG_DEVICE_INIT_NVIC_PRESENT +#define SL_CATALOG_EMLIB_CORE_PRESENT +#define SL_CATALOG_EMLIB_CORE_DEBUG_CONFIG_PRESENT +#define SL_CATALOG_FREERTOS_KERNEL_PRESENT +#define SL_CATALOG_KERNEL_PRESENT +#define SL_CATALOG_IOSTREAM_PRESENT +#define SL_CATALOG_MEMORY_MANAGER_PRESENT +#define SL_CATALOG_NVM3_PRESENT +#define SL_CATALOG_SEGGER_RTT_PRESENT +#if defined(DISPLAY_ENABLED) || defined(SL_ICD_ENABLED) +#define SL_CATALOG_SLEEPTIMER_PRESENT +#ifdef DISPLAY_ENABLED +#define SL_CATALOG_DMD_MEMLCD_PRESENT +#define SL_CATALOG_GLIB_PRESENT +#endif // DISPLAY_ENABLED +#endif // DISPLAY_ENABLED || SL_ICD_ENABLED + +#endif // SL_COMPONENT_CATALOG_H diff --git a/matter/si91x/siwx917/BRD2605A/autogen/sl_event_handler.c b/matter/si91x/siwx917/BRD2605A/autogen/sl_event_handler.c new file mode 100644 index 0000000000..9d46be388e --- /dev/null +++ b/matter/si91x/siwx917/BRD2605A/autogen/sl_event_handler.c @@ -0,0 +1,70 @@ +#include "sl_event_handler.h" + +#include "system_si91x.h" +#include "rsi_nvic_priorities_config.h" +#include "sli_siwx917_soc.h" +#include "rsi_board.h" +#include "rsi_debug.h" +#if SL_ICD_ENABLED +#include "sl_si91x_power_manager.h" +#include "rsi_wisemcu_hardware_setup.h" +#include "sl_si91x_power_manager_init.h" +#endif // SL_ICD_ENABLED +#include "SEGGER_RTT.h" +#include "sl_sleeptimer.h" +#include "sl_si91x_button_instances.h" +#include "sl_si91x_led_instances.h" +#include "sl_ulp_timer_instances.h" +#include "sl_iostream_rtt.h" +#include "cmsis_os2.h" +#include "sl_iostream_init_instances.h" + +void sl_platform_init(void) +{ + SystemCoreClockUpdate(); + sl_si91x_device_init_nvic(); + sli_si91x_platform_init(); + RSI_Board_Init(); + DEBUGINIT(); +#if SL_ICD_ENABLED + sl_si91x_hardware_setup(); +#endif // SL_ICD_ENABLED + osKernelInitialize(); +} + +void sl_kernel_start(void) +{ + osKernelStart(); +} + +void sl_driver_init(void) +{ + button_init_instances(); + led_init_instances(); +} + +void sl_service_init(void) +{ +#if SL_ICD_ENABLED + sl_si91x_power_manager_init(); + sli_si91x_power_manager_configure_ram_and_peripheral(); +#endif // SL_ICD_ENABLED +#if defined(DISPLAY_ENABLED) || defined(SL_ICD_ENABLED) + sl_sleeptimer_init(); +#endif // DISPLAY_ENABLED || SL_ICD_ENABLED + sl_iostream_init_instances(); +} + +void sl_stack_init(void) +{ +} + +void sl_internal_app_init(void) +{ +} + +void sl_iostream_init_instances(void) +{ + sl_iostream_rtt_init(); +} + diff --git a/matter/si91x/siwx917/BRD2605A/autogen/sl_event_handler.h b/matter/si91x/siwx917/BRD2605A/autogen/sl_event_handler.h new file mode 100644 index 0000000000..ef8751b80f --- /dev/null +++ b/matter/si91x/siwx917/BRD2605A/autogen/sl_event_handler.h @@ -0,0 +1,12 @@ +#ifndef SL_EVENT_HANDLER_H +#define SL_EVENT_HANDLER_H + +void sl_platform_init(void); +void sl_kernel_start(void); +void sl_driver_init(void); +void sl_service_init(void); +void sl_stack_init(void); +void sl_internal_app_init(void); +void sl_iostream_init_instances(void); + +#endif // SL_EVENT_HANDLER_H diff --git a/matter/si91x/siwx917/BRD2605A/autogen/sl_iostream_handles.c b/matter/si91x/siwx917/BRD2605A/autogen/sl_iostream_handles.c new file mode 100644 index 0000000000..064e882d0e --- /dev/null +++ b/matter/si91x/siwx917/BRD2605A/autogen/sl_iostream_handles.c @@ -0,0 +1,27 @@ +#include "sl_iostream.h" +#include "sl_iostream_handles.h" +#include "string.h" + +const sl_iostream_instance_info_t *sl_iostream_instances_info[] = { + + &sl_iostream_instance_rtt_info, + +}; + +const uint32_t sl_iostream_instances_count = sizeof(sl_iostream_instances_info) / sizeof(sl_iostream_instances_info[0]); + +/***************************************************************************//** + * Get iostream instance handle for a given name + * + * @return Instance handle if it exist, NULL otherwise. + ******************************************************************************/ +sl_iostream_t *sl_iostream_get_handle(char *name) +{ + for (uint32_t i = 0; i < sl_iostream_instances_count; i++) { + if (strcmp(sl_iostream_instances_info[i]->name, name) == 0) { + return sl_iostream_instances_info[i]->handle; + } + } + + return NULL; +} \ No newline at end of file diff --git a/matter/si91x/siwx917/BRD2605A/autogen/sl_iostream_handles.h b/matter/si91x/siwx917/BRD2605A/autogen/sl_iostream_handles.h new file mode 100644 index 0000000000..e7aab8e58b --- /dev/null +++ b/matter/si91x/siwx917/BRD2605A/autogen/sl_iostream_handles.h @@ -0,0 +1,20 @@ +#ifndef SL_IOSTREAM_HANDLES_H +#define SL_IOSTREAM_HANDLES_H +#include "sl_iostream.h" +#include "sl_iostream_rtt.h" + + +#ifdef __cplusplus +extern "C" { +#endif + +extern const sl_iostream_instance_info_t *sl_iostream_instances_info[]; +extern const uint32_t sl_iostream_instances_count; + +sl_iostream_t *sl_iostream_get_handle(char *name); + +#ifdef __cplusplus +} +#endif + +#endif // SL_IOSTREAM_HANDLES_H diff --git a/matter/si91x/siwx917/BRD2605A/autogen/sl_iostream_init_instances.h b/matter/si91x/siwx917/BRD2605A/autogen/sl_iostream_init_instances.h new file mode 100644 index 0000000000..c092c37eec --- /dev/null +++ b/matter/si91x/siwx917/BRD2605A/autogen/sl_iostream_init_instances.h @@ -0,0 +1,16 @@ +#ifndef SL_IOSTREAM_INIT_INSTANCES_H +#define SL_IOSTREAM_INIT_INSTANCES_H + +#include "sl_iostream.h" +#ifdef __cplusplus +extern "C" { +#endif + +// Initialize iostream component(s) / instance(s) +void sl_iostream_init_instances(void); + +#ifdef __cplusplus +} +#endif + +#endif // SL_IOSTREAM_INIT_INSTANCES_H \ No newline at end of file diff --git a/matter/si91x/siwx917/BRD2605A/autogen/sl_si91x_button_instances.c b/matter/si91x/siwx917/BRD2605A/autogen/sl_si91x_button_instances.c new file mode 100644 index 0000000000..846b7370f9 --- /dev/null +++ b/matter/si91x/siwx917/BRD2605A/autogen/sl_si91x_button_instances.c @@ -0,0 +1,59 @@ +/***************************************************************************/ /** + * @file sl_si91x_button_instances.c.jinja + * @brief Button Driver Instances + ******************************************************************************* + * # License + * Copyright 2023 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************/ + +#include "sl_si91x_button_pin_config.h" +#include "sl_si91x_button_instances.h" +#include "sl_si91x_button_btn0_config.h" +#include "sl_si91x_button_btn1_config.h" + +sl_button_t const button_btn0 = { + .port = SL_BUTTON_BTN0_PORT, + .pin = SL_BUTTON_BTN0_PIN, + .button_number = SL_BUTTON_BTN0_NUMBER, + #ifdef SL_BUTTON_BTN0_PAD + .pad = SL_BUTTON_BTN0_PAD, + #endif + .interrupt_config = SL_BUTTON_CONFIG_BTN0_INTR +}; +sl_button_t const button_btn1 = { + .port = SL_BUTTON_BTN1_PORT, + .pin = SL_BUTTON_BTN1_PIN, + .button_number = SL_BUTTON_BTN1_NUMBER, + #ifdef SL_BUTTON_BTN1_PAD + .pad = SL_BUTTON_BTN1_PAD, + #endif + .interrupt_config = SL_BUTTON_CONFIG_BTN1_INTR +}; + +void button_init_instances(void) +{ + sl_si91x_button_init(&button_btn0); + sl_si91x_button_init(&button_btn1); +} \ No newline at end of file diff --git a/matter/si91x/siwx917/BRD2605A/autogen/sl_si91x_button_instances.h b/matter/si91x/siwx917/BRD2605A/autogen/sl_si91x_button_instances.h new file mode 100644 index 0000000000..f612ed01bc --- /dev/null +++ b/matter/si91x/siwx917/BRD2605A/autogen/sl_si91x_button_instances.h @@ -0,0 +1,43 @@ +/***************************************************************************/ /** + * @file sl_si91x_button_instances.h.jinja + * @brief Button Driver Instances + ******************************************************************************* + * # License + * Copyright 2023 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************/ + +#ifndef SL_SI91X_BUTTON_INSTANCES_H +#define SL_SI91X_BUTTON_INSTANCES_H + +#include "sl_si91x_button.h" + +extern const sl_button_t button_btn0; +extern const sl_button_t button_btn1; + + +void button_init_instances(void); +void sl_simple_button_init_instances(void); + +#endif // BUTTON_INSTANCES_H diff --git a/matter/si91x/siwx917/BRD2605A/autogen/sl_si91x_led_instances.c b/matter/si91x/siwx917/BRD2605A/autogen/sl_si91x_led_instances.c new file mode 100644 index 0000000000..1cf0feba47 --- /dev/null +++ b/matter/si91x/siwx917/BRD2605A/autogen/sl_si91x_led_instances.c @@ -0,0 +1,43 @@ +/***************************************************************************/ /** + * @file sl_si91x_led_instances.c.jinja + * @brief Button Driver Instances + ******************************************************************************* + * # License + * Copyright 2023 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************/ + +#include "sl_si91x_led.h" +#include "sl_si91x_led_config.h" +#include "sl_si91x_led_instances.h" +sl_led_t const led_ledb = { + .port = SL_LED_LEDB_PORT, + .pin = SL_LED_LEDB_PIN, + .led_number = SL_LED_LEDB_NUMBER, +}; + +void led_init_instances(void) +{ + sl_si91x_led_init(&led_ledb); +} \ No newline at end of file diff --git a/matter/si91x/siwx917/BRD2605A/autogen/sl_si91x_led_instances.h b/matter/si91x/siwx917/BRD2605A/autogen/sl_si91x_led_instances.h new file mode 100644 index 0000000000..cae8a07523 --- /dev/null +++ b/matter/si91x/siwx917/BRD2605A/autogen/sl_si91x_led_instances.h @@ -0,0 +1,41 @@ +/***************************************************************************/ /** + * @file sl_si91x_led_instances.h.jinja + * @brief Button Driver Instances + ******************************************************************************* + * # License + * Copyright 2023 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************/ + +#ifndef SL_SI91x_LED_INSTANCES_H +#define SL_SI91x_LED_INSTANCES_H + +#include "sl_si91x_led.h" + +extern const sl_led_t led_ledb; + + +void led_init_instances(void); + +#endif // SL_SI91x_LED_INSTANCES_H \ No newline at end of file diff --git a/matter/si91x/siwx917/BRD2605A/autogen/sl_si91x_power_manager_handler.c b/matter/si91x/siwx917/BRD2605A/autogen/sl_si91x_power_manager_handler.c new file mode 100644 index 0000000000..6b5d512cb7 --- /dev/null +++ b/matter/si91x/siwx917/BRD2605A/autogen/sl_si91x_power_manager_handler.c @@ -0,0 +1,96 @@ +/***************************************************************************//** + * @file sl_si91x_power_manager_handler.c.jinja + * @brief Power Manager Service Handler + ******************************************************************************* + * # License + * Copyright 2023 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************/ + +#include "sl_si91x_power_manager.h" + +/***************************************************************************//** + * Check if the MCU can sleep at that time. This function is called when the system + * is about to go sleeping, with the interrupts disabled. It allows the software to + * cancel going to sleep in case of a last-minute event occurred (window between the + * function call and interrupt disable). + * + * @return True, if the system can go to sleep. + * False, otherwise. + * + * @note This function is called with the interrupt disabled and it MUST NOT be + * re-enabled. + ******************************************************************************/ +__WEAK boolean_t app_is_ok_to_sleep(void) +{ + return true; +} + +/***************************************************************************//** + * Check if the MCU can sleep after an interrupt. This function is called after an + * interrupt occured and was processed. It allows the power manger to know if it must + * go back to sleep or wakeup. + * + * @return SL_SI91X_POWER_MANAGER_IGNORE, if the module did not trigger an ISR and it + * won't to contribute to the decision. + * + * SL_SI91X_POWER_MANAGER_SLEEP, The module was the one that caused the system + * wakeup and the system SHOULD go back to sleep. + * + * SL_SI91X_POWER_MANAGER_WAKEUP, The module was the one that caused the system + * wakeup and the system MUST NOT go back to sleep. + * + * @note This function must not have any side effects. It is not guaranteed to be + * called for every ISR. If a prior hook function requires to wakeup, such + * as a wireless stack, the application hook function won't be called. + ******************************************************************************/ +__WEAK sl_si91x_power_manager_on_isr_exit_t app_sleep_on_isr_exit(void) +{ + return SL_SI91X_POWER_MANAGER_ISR_IGNORE; +} +/***************************************************************************//** + * Mandatory callback that must validate if the MCU can sleep after having + * processed an interrupt when the system was sleeping. + ******************************************************************************/ +boolean_t sl_si91x_power_manager_sleep_on_isr_exit(void) +{ + sl_si91x_power_manager_on_isr_exit_t answer; + boolean_t sleep = false; + boolean_t force_wakeup = false; + + + // Application hook + answer = app_sleep_on_isr_exit(); + if (answer == SL_SI91X_POWER_MANAGER_ISR_WAKEUP) { + force_wakeup = true; + } else if (answer == SL_SI91X_POWER_MANAGER_ISR_SLEEP) { + sleep = true; + } + + if (force_wakeup) { + sleep = false; + } + + return sleep; +} diff --git a/matter/si91x/siwx917/BRD2605A/autogen/sl_si91x_power_manager_init.h b/matter/si91x/siwx917/BRD2605A/autogen/sl_si91x_power_manager_init.h new file mode 100644 index 0000000000..46c4fd1bb5 --- /dev/null +++ b/matter/si91x/siwx917/BRD2605A/autogen/sl_si91x_power_manager_init.h @@ -0,0 +1,51 @@ +/***************************************************************************//** + * @file sl_si91x_power_manager_init.h.jinja + * @brief Power Manager Service Initialization + ******************************************************************************* + * # License + * Copyright 2023 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************/ + +#ifndef SL_SI91X_POWER_MANAGER_INIT_H +#define SL_SI91X_POWER_MANAGER_INIT_H + +#ifdef __cplusplus +extern "C" { +#endif + +#include "sl_si91x_power_manager_config_3.h" + + +__STATIC_INLINE void sli_si91x_power_manager_configure_ram_and_peripheral(void) +{ + sl_si91x_power_manager_remove_peripheral_requirement(&peripheral_config); + sl_si91x_power_manager_configure_ram_retention(&ram_configuration); +} + +#ifdef __cplusplus +} +#endif + +#endif // SL_SI91X_POWER_MANAGER_INIT_H \ No newline at end of file diff --git a/matter/si91x/siwx917/BRD2605A/autogen/sl_si91x_power_manager_wakeup_handler.c b/matter/si91x/siwx917/BRD2605A/autogen/sl_si91x_power_manager_wakeup_handler.c new file mode 100644 index 0000000000..fa91ca86a5 --- /dev/null +++ b/matter/si91x/siwx917/BRD2605A/autogen/sl_si91x_power_manager_wakeup_handler.c @@ -0,0 +1,37 @@ +/***************************************************************************//** + * @file sl_si91x_power_manager_wakeup_handler.c.jinja + * @brief Power Manager Service Wakeup Handler APIs + ******************************************************************************* + * # License + * Copyright 2023 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************/ +#include "sl_si91x_power_manager_wakeup_handler.h" + +sl_status_t sl_si91x_power_manager_wakeup_init(void) +{ + sl_status_t status=SL_STATUS_OK; + + return status; +} \ No newline at end of file diff --git a/matter/si91x/siwx917/BRD2605A/autogen/sl_si91x_power_manager_wakeup_handler.h b/matter/si91x/siwx917/BRD2605A/autogen/sl_si91x_power_manager_wakeup_handler.h new file mode 100644 index 0000000000..86b7c5d4dc --- /dev/null +++ b/matter/si91x/siwx917/BRD2605A/autogen/sl_si91x_power_manager_wakeup_handler.h @@ -0,0 +1,44 @@ +/***************************************************************************//** + * @file sl_si91x_power_manager_wakeup_handler.h.jinja + * @brief Power Manager Service Wakeup Handler APIs + ******************************************************************************* + * # License + * Copyright 2023 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************/ +#ifndef SL_SI91X_POWER_MANAGER_WAKEUP_HANDLER_H +#define SL_SI91X_POWER_MANAGER_WAKEUP_HANDLER_H + +#include "sl_status.h" + + + +#include "sl_si91x_power_manager_wakeup_source_config.h" + + +sl_status_t sl_si91x_power_manager_wakeup_init(void); + + + +#endif // SL_SI91X_POWER_MANAGER_WAKEUP_HANDLER_H \ No newline at end of file diff --git a/matter/si91x/siwx917/BRD2605A/autogen/sl_ulp_timer_init.c b/matter/si91x/siwx917/BRD2605A/autogen/sl_ulp_timer_init.c new file mode 100644 index 0000000000..91a8a01f21 --- /dev/null +++ b/matter/si91x/siwx917/BRD2605A/autogen/sl_ulp_timer_init.c @@ -0,0 +1,49 @@ +/***************************************************************************//** + * @file sl_ulp_timer_init.c.jinja + * @brief ULP timer Instance Initialization + ******************************************************************************* + * # License + * Copyright 2020 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************/ + +#include "sl_si91x_ulp_timer.h" + +#include "sl_si91x_ulp_timer_init_timer0_config.h" + + +#include "sl_ulp_timer_instances.h" + + + +ulp_timer_config_t sl_timer_handle_timer0 = { + .timer_num = SL_ULP_TIMER_TIMER0, + .timer_mode = SL_ULP_TIMER_TIMER0_MODE, + .timer_type = SL_ULP_TIMER_TIMER0_TYPE, + .timer_match_value = SL_TIMER_MATCH_VALUE_DEFAULT, + .timer_direction = SL_ULP_TIMER_TIMER0_DIRECTION, +}; + + + diff --git a/matter/si91x/siwx917/BRD2605A/autogen/sl_ulp_timer_instances.h b/matter/si91x/siwx917/BRD2605A/autogen/sl_ulp_timer_instances.h new file mode 100644 index 0000000000..1eb1e971e0 --- /dev/null +++ b/matter/si91x/siwx917/BRD2605A/autogen/sl_ulp_timer_instances.h @@ -0,0 +1,53 @@ +/***************************************************************************//** + * @file sl_ulp_timer_instances.h.jinja + * @brief ULP Timer Instance + ******************************************************************************* + * # License + * Copyright 2023 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************/ + +#ifndef SL_ULP_TIMER_INSTANCES_H +#define SL_ULP_TIMER_INSTANCES_H + +#ifdef __cplusplus +extern "C" { +#endif + +#include "sl_si91x_ulp_timer.h" +#define SL_ULP_TIMER_TIMER0 0 +#define SL_ULP_TIMER_TIMER1 1 +#define SL_ULP_TIMER_TIMER2 2 +#define SL_ULP_TIMER_TIMER3 3 + + +extern ulp_timer_config_t sl_timer_handle_timer0 ; + + + +#ifdef __cplusplus +} +#endif + +#endif // SL_ULP_TIMER_INSTANCES_H diff --git a/matter/si91x/siwx917/BRD2605A/autogen/sli_mbedtls_config_autogen.h b/matter/si91x/siwx917/BRD2605A/autogen/sli_mbedtls_config_autogen.h new file mode 100644 index 0000000000..a900af14a9 --- /dev/null +++ b/matter/si91x/siwx917/BRD2605A/autogen/sli_mbedtls_config_autogen.h @@ -0,0 +1,49 @@ +// This is an autogenerated config file, any changes to this file will be +// overwritten + +#ifndef SLI_MBEDTLS_CONFIG_AUTOGEN_H +#define SLI_MBEDTLS_CONFIG_AUTOGEN_H + +#define MBEDTLS_MPI_MAX_SIZE 32 + +#define MBEDTLS_NO_PLATFORM_ENTROPY +#define MBEDTLS_AES_C +#define MBEDTLS_ASN1_PARSE_C +#define MBEDTLS_ASN1_WRITE_C +#define MBEDTLS_BASE64_C +#define MBEDTLS_CIPHER_C +#define MBEDTLS_CMAC_C +#define MBEDTLS_ECDSA_C +#define MBEDTLS_ECP_C +#define MBEDTLS_ECP_DP_SECP256R1_ENABLED +#define MBEDTLS_MD_C +#define MBEDTLS_BIGNUM_C +#define MBEDTLS_OID_C +#define MBEDTLS_PEM_PARSE_C +#define MBEDTLS_PEM_WRITE_C +#define MBEDTLS_PK_C +#define MBEDTLS_PK_PARSE_C +#define MBEDTLS_PK_WRITE_C +#define MBEDTLS_PLATFORM_C +#define MBEDTLS_PLATFORM_MEMORY +#define MBEDTLS_ENTROPY_C +#define MBEDTLS_ENTROPY_FORCE_SHA256 +#define MBEDTLS_ENTROPY_MAX_SOURCES 2 +#define MBEDTLS_CTR_DRBG_C +#define MBEDTLS_SHA256_C +#define MBEDTLS_SHA224_C +#define MBEDTLS_X509_USE_C +#define MBEDTLS_X509_CREATE_C +#define MBEDTLS_X509_CRT_PARSE_C +#define MBEDTLS_X509_CRT_WRITE_C +#define MBEDTLS_X509_CRL_PARSE_C +#define MBEDTLS_X509_CSR_PARSE_C +#define MBEDTLS_X509_CSR_WRITE_C +#ifndef SL_MBEDTLS_USE_TINYCRYPT +#define MBEDTLS_PSA_CRYPTO_C +#define MBEDTLS_USE_PSA_CRYPTO +#define MBEDTLS_PSA_CRYPTO_CONFIG +#define MBEDTLS_PSA_CRYPTO_STORAGE_C +#define MBEDTLS_CIPHER_PADDING_PKCS7 +#endif // SL_MBEDTLS_USE_TINYCRYPT +#endif // SLI_MBEDTLS_CONFIG_AUTOGEN_H diff --git a/matter/si91x/siwx917/BRD2605A/autogen/sli_mbedtls_config_transform_autogen.h b/matter/si91x/siwx917/BRD2605A/autogen/sli_mbedtls_config_transform_autogen.h new file mode 100644 index 0000000000..0ea1e1ea11 --- /dev/null +++ b/matter/si91x/siwx917/BRD2605A/autogen/sli_mbedtls_config_transform_autogen.h @@ -0,0 +1,51 @@ +// This is an autogenerated config file, any changes to this file will be +// overwritten + +#ifndef SLI_MBEDTLS_CONFIG_TRANSFORM_AUTOGEN_H +#define SLI_MBEDTLS_CONFIG_TRANSFORM_AUTOGEN_H + +// Convert CMSIS Markup config defines to mbedTLS specific config defines + +#if SL_MBEDTLS_RSA_NO_CRT +#define MBEDTLS_RSA_NO_CRT +#endif + +// Allow undefining the specified cipher suites +#if defined(SLI_MBEDTLS_AUTODETECT_CIPHERSUITES) +#undef MBEDTLS_SSL_CIPHERSUITES +#endif + +#if SL_MBEDTLS_SSL_MAX_FRAGMENT_LENGTH +#define MBEDTLS_SSL_MAX_FRAGMENT_LENGTH +#endif +#if SL_MBEDTLS_SSL_EXPORT_KEYS +#define MBEDTLS_SSL_EXPORT_KEYS +#endif +#if SL_MBEDTLS_KEY_EXCHANGE_PSK_ENABLED +#define MBEDTLS_KEY_EXCHANGE_PSK_ENABLED +#endif +#if SL_MBEDTLS_KEY_EXCHANGE_ECDHE_PSK_ENABLED +#define MBEDTLS_KEY_EXCHANGE_ECDHE_PSK_ENABLED +#endif +#if SL_MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED +#define MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED +#endif +#if SL_MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED +#define MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED +#endif +#if SL_MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA_ENABLED +#define MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA_ENABLED +#endif +#if SL_MBEDTLS_ECP_ENABLE_COMPRESSED_CURVE_PARSING +#define MBEDTLS_ECP_ENABLE_COMPRESSED_CURVE_PARSING +#endif + +#if !defined(MBEDTLS_SSL_IN_CONTENT_LEN) +#define MBEDTLS_SSL_IN_CONTENT_LEN SL_MBEDTLS_SSL_IN_CONTENT_LEN +#endif + +#if !defined(MBEDTLS_SSL_OUT_CONTENT_LEN) +#define MBEDTLS_SSL_OUT_CONTENT_LEN SL_MBEDTLS_SSL_OUT_CONTENT_LEN +#endif + +#endif // SLI_MBEDTLS_CONFIG_TRANSFORM_AUTOGEN_H diff --git a/matter/si91x/siwx917/BRD2605A/config/RTE_Device_917.h b/matter/si91x/siwx917/BRD2605A/config/RTE_Device_917.h new file mode 100644 index 0000000000..61ade5b1dc --- /dev/null +++ b/matter/si91x/siwx917/BRD2605A/config/RTE_Device_917.h @@ -0,0 +1,4909 @@ +/* ----------------------------------------------------------------------------- + * Copyright (c) 2013-2016 ARM Ltd. + * + * This software is provided 'as-is', without any express or implied warranty. + * In no event will the authors be held liable for any damages arising from + * the use of this software. Permission is granted to anyone to use this + * software for any purpose, including commercial applications, and to alter + * it and redistribute it freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software in + * a product, an acknowledgement in the product documentation would be + * appreciated but is not required. + * + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * + * 3. This notice may not be removed or altered from any source distribution. + * + * $Date: 1. June 2024 + * $Revision: V2.4.4 + * + * Project: RTE Device Configuration for Si91x 2.0 B0 BRD2605A + * -------------------------------------------------------------------------- */ + +//-------- <<< Use Configuration Wizard in Context Menu >>> -------------------- + +#ifndef __RTE_DEVICE_H +#define __RTE_DEVICE_H +#include "rsi_ccp_user_config.h" +#include "pin_config.h" + +#define GPIO_PORT_0 0 // GPIO port 0 +#define ULP_GPIO_MODE_6 6 // ULP GPIO mode 6 +#define HOST_PAD_GPIO_MIN 25 // GPIO host pad minimum pin number +#define HOST_PAD_GPIO_MAX 30 // GPIO host pad maximum pin number +#define GPIO_MAX_PIN 64 // GPIO maximum pin number + +#define BUTTON_0_GPIO_PIN 2 + +#define SI917_DEVKIT + +#define RTE_BUTTON0_PORT 0 +#define RTE_BUTTON0_NUMBER 0 +#define RTE_BUTTON0_PIN (2U) + +#define RTE_BUTTON1_PORT 3 +#define RTE_BUTTON1_NUMBER 1 +#define RTE_BUTTON1_PIN (1U) +#define RTE_BUTTON1_PAD 13 + +// RED LED +#define RTE_LEDR_PORT 3 +#define RTE_LEDR_NUMBER 0 +#define RTE_LEDR_PIN 2 +#define RTE_LEDR_PAD 14 + +// GREEN LED +#define RTE_LEDG_PORT 3 +#define RTE_LEDG_NUMBER 1 +#define RTE_LEDG_PIN 3 +#define RTE_LEDG_PAD 15 + +//BLUE LED +#define RTE_LEDB_PORT 0 +#define RTE_LEDB_NUMBER 2 +#define RTE_LEDB_PIN 15 +#define RTE_LEDB_PAD 8 + +// USART0 [Driver_USART0] +// Configuration settings for Driver_USART0 in component ::CMSIS Driver:USART +#define RTE_ENABLE_FIFO 1 + +#define RTE_USART0 1 + +#define RTE_USART0_CLK_SRC USART_ULPREFCLK +#define RTE_USART0_CLK_DIV_FACT 1 +#define RTE_USART0_FRAC_DIV_SEL USART_FRACTIONAL_DIVIDER + +#define RTE_USART_MODE 0 //!Usart mode macros +#define RTE_CONTINUOUS_CLOCK_MODE 0 + +#define RTE_USART0_LOOPBACK 0 +#define RTE_USART0_DTR_EANBLE 0 + +#define RTE_USART0_DMA_MODE1_EN 0 //!dma mode + +#define RTE_USART0_TX_FIFO_THRESHOLD USART_TRIGGER_TX_EMPTY +#define RTE_USART0_RX_FIFO_THRESHOLD USART_TRIGGER_RX_AEMPTY + +#define RTE_USART0_DMA_TX_LEN_PER_DES 1024 +#define RTE_USART0_DMA_RX_LEN_PER_DES 1024 + +#define RTE_USART0_CHNL_UDMA_TX_CH 25 + +#define RTE_USART0_CHNL_UDMA_RX_CH 24 + +// USART0_CLK <0=>P0_8 <1=>P0_25 <2=>P0_52 <3=>P0_64 +// CLK of USART0 +#ifndef USART0_CLK_LOC +#define RTE_USART0_CLK_PORT_ID 0 + +#if (RTE_USART0_CLK_PORT_ID == 0) +#define RTE_USART0_CLK_PORT 0 +#define RTE_USART0_CLK_PIN 8 +#define RTE_USART0_CLK_MUX 2 +#define RTE_USART0_CLK_PAD 3 +#elif (RTE_USART0_CLK_PORT_ID == 1) +#define RTE_USART0_CLK_PORT 0 +#define RTE_USART0_CLK_PIN 25 +#define RTE_USART0_CLK_MUX 2 +#define RTE_USART0_CLK_PAD 0 //NO PAD +#elif (RTE_USART0_CLK_PORT_ID == 2) +#define RTE_USART0_CLK_PORT 0 +#define RTE_USART0_CLK_PIN 52 +#define RTE_USART0_CLK_MUX 2 +#define RTE_USART0_CLK_PAD 16 +#else +#error "Invalid USART0 RTE_USART0_CLK_PIN Pin Configuration!" +#endif +#else +//Pintool data +#define RTE_USART0_CLK_PORT USART0_CLK_PORT +#if (USART0_CLK_LOC == 0) +#define RTE_USART0_CLK_PIN USART0_CLK_PIN +#define RTE_USART0_CLK_MUX 2 +#define RTE_USART0_CLK_PAD 3 +#endif +#if (USART0_CLK_LOC == 1) +#define RTE_USART0_CLK_PIN USART0_CLK_PIN +#define RTE_USART0_CLK_MUX 2 +#define RTE_USART0_CLK_PAD 0 //NO PAD +#endif +#if (USART0_CLK_LOC == 2) +#define RTE_USART0_CLK_PIN USART0_CLK_PIN +#define RTE_USART0_CLK_MUX 2 +#define RTE_USART0_CLK_PAD 16 +#endif +#if (USART0_CLK_LOC == 3) +#define RTE_USART0_CLK_PIN (USART0_CLK_PIN + GPIO_MAX_PIN) +#define RTE_USART0_CLK_MUX 2 +#define RTE_USART0_CLK_PAD 22 +#endif +//Pintool data +#endif + +// USART0_TX <0=>P0_15 <1=>P0_30 <2=>P0_54 <3=>P0_68 <4=>P0_71 +// TX for USART0 +#ifndef USART0_TX_LOC +#ifdef SLI_SI91X_MCU_CONFIG_RADIO_BOARD_BASE_VER +#define RTE_USART0_TX_PORT_ID 1 +#else +#define RTE_USART0_TX_PORT_ID 0 +#endif + +#if (RTE_USART0_TX_PORT_ID == 0) +#define RTE_USART0_TX_PORT 0 +#define RTE_USART0_TX_PIN 15 +#define RTE_USART0_TX_MUX 2 +#define RTE_USART0_TX_PAD 8 +#elif (RTE_USART0_TX_PORT_ID == 1) +#define RTE_USART0_TX_PORT 0 +#define RTE_USART0_TX_PIN 30 +#define RTE_USART0_TX_MUX 2 +#define RTE_USART0_TX_PAD 0 //NO PAD +#elif (RTE_USART0_TX_PORT_ID == 2) +#define RTE_USART0_TX_PORT 0 +#define RTE_USART0_TX_PIN 54 +#define RTE_USART0_TX_MUX 2 +#define RTE_USART0_TX_PAD 18 +#elif (RTE_USART0_TX_PORT_ID == 3) +#define RTE_USART0_TX_PORT 0 +#define RTE_USART0_TX_PIN 71 +#define RTE_USART0_TX_MUX 4 +#define RTE_USART0_TX_PAD 29 +#else +#error "Invalid USART0 RTE_USART0_TX_PIN Pin Configuration!" +#endif +#else +//Pintool data +#define RTE_USART0_TX_PORT USART0_TX_PORT +#if (USART0_TX_LOC == 4) +#define RTE_USART0_TX_PIN USART0_TX_PIN +#define RTE_USART0_TX_MUX 2 +#define RTE_USART0_TX_PAD 8 +#endif +#if (USART0_TX_LOC == 5) +#define RTE_USART0_TX_PIN USART0_TX_PIN +#define RTE_USART0_TX_MUX 2 +#define RTE_USART0_TX_PAD 0 //NO PAD +#endif +#if (USART0_TX_LOC == 6) +#define RTE_USART0_TX_PIN USART0_TX_PIN +#define RTE_USART0_TX_MUX 2 +#define RTE_USART0_TX_PAD 18 +#endif +#if (USART0_TX_LOC == 7) +#define RTE_USART0_TX_PIN (USART0_TX_PIN + GPIO_MAX_PIN) +#define RTE_USART0_TX_MUX 2 +#define RTE_USART0_TX_PAD 26 +#endif +#if (USART0_TX_LOC == 8) +#define RTE_USART0_TX_PIN (USART0_TX_PIN + GPIO_MAX_PIN) +#define RTE_USART0_TX_MUX 4 +#define RTE_USART0_TX_PAD 29 +#endif +//Pintool data +#endif + +// USART0_RX <0=>P0_10 <1=>P0_29 <2=>P0_55 <3=>P0_65 <4=>P0_70 +// RX for USART0 +#ifndef USART0_RX_LOC +#ifdef SLI_SI91X_MCU_CONFIG_RADIO_BOARD_BASE_VER +#define RTE_USART0_RX_PORT_ID 1 +#else +#define RTE_USART0_RX_PORT_ID 0 +#endif + +#if (RTE_USART0_RX_PORT_ID == 0) +#define RTE_USART0_RX_PORT 0 +#define RTE_USART0_RX_PIN 10 +#define RTE_USART0_RX_MUX 2 +#define RTE_USART0_RX_PAD 5 +#elif (RTE_USART0_RX_PORT_ID == 1) +#define RTE_USART0_RX_PORT 0 +#define RTE_USART0_RX_PIN 29 +#define RTE_USART0_RX_MUX 2 +#define RTE_USART0_RX_PAD 0 //no pad +#elif (RTE_USART0_RX_PORT_ID == 2) +#define RTE_USART0_RX_PORT 0 +#define RTE_USART0_RX_PIN 55 +#define RTE_USART0_RX_MUX 2 +#define RTE_USART0_RX_PAD 19 +#elif (RTE_USART0_RX_PORT_ID == 3) +#define RTE_USART0_RX_PORT 0 +#define RTE_USART0_RX_PIN 65 +#define RTE_USART0_RX_MUX 2 +#define RTE_USART0_RX_PAD 23 +#elif (RTE_USART0_RX_PORT_ID == 4) +#define RTE_USART0_RX_PORT 0 +#define RTE_USART0_RX_PIN 70 +#define RTE_USART0_RX_MUX 4 +#define RTE_USART0_RX_PAD 28 +#else +#error "Invalid USART0 RTE_USART0_RX_PIN Pin Configuration!" +#endif +#else +//Pintool data +#define RTE_USART0_RX_PORT USART0_RX_PORT +#if (USART0_RX_LOC == 9) +#define RTE_USART0_RX_PIN USART0_RX_PIN +#define RTE_USART0_RX_MUX 2 +#define RTE_USART0_RX_PAD 5 +#endif +#if (USART0_RX_LOC == 10) +#define RTE_USART0_RX_PIN USART0_RX_PIN +#define RTE_USART0_RX_MUX 2 +#define RTE_USART0_RX_PAD 0 //no pad +#endif +#if (USART0_RX_LOC == 11) +#define RTE_USART0_RX_PIN USART0_RX_PIN +#define RTE_USART0_RX_MUX 2 +#define RTE_USART0_RX_PAD 19 +#endif +#if (USART0_RX_LOC == 12) +#define RTE_USART0_RX_PIN (USART0_RX_PIN + GPIO_MAX_PIN) +#define RTE_USART0_RX_MUX 2 +#define RTE_USART0_RX_PAD 23 +#endif +#if (USART0_RX_LOC == 13) +#define RTE_USART0_RX_PIN (USART0_RX_PIN + GPIO_MAX_PIN) +#define RTE_USART0_RX_MUX 4 +#define RTE_USART0_RX_PAD 28 +#endif +//Pintool data +#endif + +// USART0_CTS <0=>P0_6 <1=>P0_26 <2=>P0_56 <3=>P0_70 +// CTS for USART0 +#ifndef USART0_CTS_LOC +#define RTE_USART0_CTS_PORT_ID 0 + +#if (RTE_USART0_CTS_PORT_ID == 0) +#define RTE_USART0_CTS_PORT 0 +#define RTE_USART0_CTS_PIN 6 +#define RTE_USART0_CTS_MUX 2 +#define RTE_USART0_CTS_PAD 1 +#elif (RTE_USART0_CTS_PORT_ID == 1) +#define RTE_USART0_CTS_PORT 0 +#define RTE_USART0_CTS_PIN 26 +#define RTE_USART0_CTS_MUX 2 +#define RTE_USART0_CTS_PAD 0 //NO PAD +#elif (RTE_USART0_CTS_PORT_ID == 2) +#define RTE_USART0_CTS_PORT 0 +#define RTE_USART0_CTS_PIN 56 +#define RTE_USART0_CTS_MUX 2 +#define RTE_USART0_CTS_PAD 20 +#elif (RTE_USART0_CTS_PORT_ID == 3) +#define RTE_USART0_CTS_PORT 0 +#define RTE_USART0_CTS_PIN 70 +#define RTE_USART0_CTS_MUX 2 +#define RTE_USART0_CTS_PAD 28 +#else +#error "Invalid USART0 RTE_USART0_CTS_PIN Pin Configuration!" +#endif +#else +//Pintool data +#define RTE_USART0_CTS_PORT USART0_CTS_PORT +#if (USART0_CTS_LOC == 14) +#define RTE_USART0_CTS_PIN USART0_CTS_PIN +#define RTE_USART0_CTS_MUX 2 +#define RTE_USART0_CTS_PAD 1 +#endif +#if (USART0_CTS_LOC == 15) +#define RTE_USART0_CTS_PIN USART0_CTS_PIN +#define RTE_USART0_CTS_MUX 2 +#define RTE_USART0_CTS_PAD 0 //NO PAD +#endif +#if (USART0_CTS_LOC == 16) +#define RTE_USART0_CTS_PIN USART0_CTS_PIN +#define RTE_USART0_CTS_MUX 2 +#define RTE_USART0_CTS_PAD 20 +#endif +#if (USART0_CTS_LOC == 17) +#define RTE_USART0_CTS_PIN (USART0_CTS_PIN + GPIO_MAX_PIN) +#define RTE_USART0_CTS_MUX 2 +#define RTE_USART0_CTS_PAD 28 +#endif +//Pintool data +#endif + +// USART0_RTS <0=>P0_9 <1=>P0_28 <2=>P0_53 <3=>P0_69 +// RTS for USART0 +#ifndef USART0_RTS_LOC +#define RTE_USART0_RTS_PORT_ID 0 + +#if (RTE_USART0_RTS_PORT_ID == 0) +#define RTE_USART0_RTS_PORT 0 +#define RTE_USART0_RTS_PIN 9 +#define RTE_USART0_RTS_MUX 2 +#define RTE_USART0_RTS_PAD 4 +#elif (RTE_USART0_RTS_PORT_ID == 1) +#define RTE_USART0_RTS_PORT 0 +#define RTE_USART0_RTS_PIN 28 +#define RTE_USART0_RTS_MUX 2 +#define RTE_USART0_RTS_PAD 0 //NO PAD +#elif (RTE_USART0_RTS_PORT_ID == 2) +#define RTE_USART0_RTS_PORT 0 +#define RTE_USART0_RTS_PIN 53 +#define RTE_USART0_RTS_MUX 2 +#define RTE_USART0_RTS_PAD 17 +#else +#error "Invalid USART0 RTE_USART0_RTS_PIN Pin Configuration!" +#endif +#else +//Pintool data +#define RTE_USART0_RTS_PORT USART0_RTS_PORT +#if (USART0_RTS_LOC == 18) +#define RTE_USART0_RTS_PIN USART0_RTS_PIN +#define RTE_USART0_RTS_MUX 2 +#define RTE_USART0_RTS_PAD 4 +#endif +#if (USART0_RTS_LOC == 19) +#define RTE_USART0_RTS_PIN USART0_RTS_PIN +#define RTE_USART0_RTS_MUX 2 +#define RTE_USART0_RTS_PAD 0 //NO PAD +#endif +#if (USART0_RTS_LOC == 20) +#define RTE_USART0_RTS_PIN USART0_RTS_PIN +#define RTE_USART0_RTS_MUX 2 +#define RTE_USART0_RTS_PAD 17 +#endif +#if (USART0_RTS_LOC == 21) +#define RTE_USART0_RTS_PIN (USART0_RTS_PIN + GPIO_MAX_PIN) +#define RTE_USART0_RTS_MUX 2 +#define RTE_USART0_RTS_PAD 27 +#endif +//Pintool data +#endif + +// USART0_IR_TX <0=>P0_48 <1=>P0_72 +// IR TX for USART0 +#ifndef USART0_IRTX_LOC +#define RTE_IR_TX_PORT_ID 0 +#if ((RTE_IR_TX_PORT_ID == 2)) +#error "Invalid USART0 RTE_USART0_IR_TX_PIN Pin Configuration!" +#endif + +#if (RTE_IR_TX_PORT_ID == 0) +#define RTE_USART0_IR_TX_PORT 0 +#define RTE_USART0_IR_TX_PIN 48 +#define RTE_USART0_IR_TX_MUX 2 +#define RTE_USART0_IR_TX_PAD 12 +#elif (RTE_IR_TX_PORT_ID == 1) +#define RTE_USART0_IR_TX_PORT 0 +#define RTE_USART0_IR_TX_PIN 72 +#define RTE_USART0_IR_TX_MUX 2 +#define RTE_USART0_IR_TX_PAD 30 +#elif (RTE_IR_TX_PORT_ID == 2) +#define RTE_USART0_IR_TX_PORT 0 +#define RTE_USART0_IR_TX_PIN 26 +#define RTE_USART0_IR_TX_MUX 13 +#define RTE_USART0_IR_TX_PAD 0 //No pad +#else +#error "Invalid USART0 RTE_USART0_IR_TX_PIN Pin Configuration!" +#endif +#else +//Pintool data +#define RTE_USART0_IR_TX_PORT USART0_IRTX_PORT +#if (USART0_IRTX_LOC == 22) +#define RTE_USART0_IR_TX_PIN USART0_IRTX_PIN +#define RTE_USART0_IR_TX_MUX 13 +#define RTE_USART0_IR_TX_PAD 0 //No pad +#endif +#if (USART0_IRTX_LOC == 23) +#define RTE_USART0_IR_TX_PIN USART0_IRTX_PIN +#define RTE_USART0_IR_TX_MUX 2 +#define RTE_USART0_IR_TX_PAD 12 +#endif +#if (USART0_IRTX_LOC == 24) +#define RTE_USART0_IR_TX_PIN (USART0_IRTX_PIN + GPIO_MAX_PIN) +#define RTE_USART0_IR_TX_MUX 11 +#define RTE_USART0_IR_TX_PAD 23 +#endif +#if (USART0_IRTX_LOC == 25) +#define RTE_USART0_IR_TX_PIN (USART0_IRTX_PIN + GPIO_MAX_PIN) +#define RTE_USART0_IR_TX_MUX 2 +#define RTE_USART0_IR_TX_PAD 30 +#endif +//Pintool data +#endif + +// USART0_IR_RX <0=>P0_47 <1=>P0_71 <2=>P0_64 <3=>P0_25 +// IR RX for USART0 +#ifndef USART0_IRRX_LOC +#define RTE_IR_RX_PORT_ID 0 +#if ((RTE_IR_RX_PORT_ID == 2)) +#error "Invalid USART0 RTE_USART0_IR_RX_PIN Pin Configuration!" +#endif + +#if (RTE_IR_RX_PORT_ID == 0) +#define RTE_USART0_IR_RX_PORT 0 +#define RTE_USART0_IR_RX_PIN 47 +#define RTE_USART0_IR_RX_MUX 2 +#define RTE_USART0_IR_RX_PAD 11 +#elif (RTE_IR_RX_PORT_ID == 1) +#define RTE_USART0_IR_RX_PORT 0 +#define RTE_USART0_IR_RX_PIN 71 +#define RTE_USART0_IR_RX_MUX 2 +#define RTE_USART0_IR_RX_PAD 29 +#elif (RTE_IR_RX_PORT_ID == 2) +#define RTE_USART0_IR_RX_PORT 0 +#define RTE_USART0_IR_RX_PIN 25 +#define RTE_USART0_IR_RX_MUX 13 +#define RTE_USART0_IR_RX_PAD 0 //no pad +#else +#error "Invalid USART0 RTE_USART0_IR_RX_PIN Pin Configuration!" +#endif +#else +//Pintool data +#define RTE_USART0_IR_RX_PORT USART0_IRRX_PORT +#if (USART0_IRRX_LOC == 26) +#define RTE_USART0_IR_RX_PIN USART0_IRRX_PIN +#define RTE_USART0_IR_RX_MUX 13 +#define RTE_USART0_IR_RX_PAD 0 //no pad +#endif +#if (USART0_IRRX_LOC == 27) +#define RTE_USART0_IR_RX_PIN USART0_IRRX_PIN +#define RTE_USART0_IR_RX_MUX 2 +#define RTE_USART0_IR_RX_PAD 11 +#endif +#if (USART0_IRRX_LOC == 28) +#define RTE_USART0_IR_RX_PIN (USART0_IRRX_PIN + GPIO_MAX_PIN) +#define RTE_USART0_IR_RX_MUX 11 +#define RTE_USART0_IR_RX_PAD 22 +#endif +#if (USART0_IRRX_LOC == 29) +#define RTE_USART0_IR_RX_PIN (USART0_IRRX_PIN + GPIO_MAX_PIN) +#define RTE_USART0_IR_RX_MUX 2 +#define RTE_USART0_IR_RX_PAD 29 +#endif +//Pintool data +#endif + +// USART0_RI <0=>P0_27 <1=>P0_46 <2=>P0_68 +// RI for USART0 +#ifndef USART0_RI_LOC +#define RTE_RI_PORT_ID 0 + +#if (RTE_RI_PORT_ID == 0) +#define RTE_USART0_RI_PORT 0 +#define RTE_USART0_RI_PIN 27 +#define RTE_USART0_RI_MUX 2 +#define RTE_USART0_RI_PAD 0 //no pad +#elif (RTE_RI_PORT_ID == 1) +#define RTE_USART0_RI_PORT 0 +#define RTE_USART0_RI_PIN 46 +#define RTE_USART0_RI_MUX 2 +#define RTE_USART0_RI_PAD 10 +#else +#error "Invalid USART0 RTE_USART0_RI_PIN Pin Configuration!" +#endif +#else +//Pintool data +#define RTE_USART0_RI_PORT USART0_RI_PORT +#if (USART0_RI_LOC == 30) +#define RTE_USART0_RI_PIN USART0_RI_PIN +#define RTE_USART0_RI_MUX 2 +#define RTE_USART0_RI_PAD 0 //no pad +#endif +#if (USART0_RI_LOC == 31) +#define RTE_USART0_RI_PIN USART0_RI_PIN +#define RTE_USART0_RI_MUX 2 +#define RTE_USART0_RI_PAD 10 +#endif +#if (USART0_RI_LOC == 32) +#define RTE_USART0_RI_PIN (USART0_RI_PIN + GPIO_MAX_PIN) +#define RTE_USART0_RI_MUX 11 +#define RTE_USART0_RI_PAD 26 +#endif +//Pintool data +#endif + +// USART0_DSR <0=>P0_11 <1=>P0_57 +// DSR for USART0 +#ifndef USART0_DSR_LOC +#define RTE_DSR_PORT_ID 0 + +#if (RTE_DSR_PORT_ID == 0) +#define RTE_USART0_DSR_PORT 0 +#define RTE_USART0_DSR_PIN 11 +#define RTE_USART0_DSR_MUX 2 +#define RTE_USART0_DSR_PAD 6 +#elif (RTE_DSR_PORT_ID == 1) +#define RTE_USART0_DSR_PORT 0 +#define RTE_USART0_DSR_PIN 57 +#define RTE_USART0_DSR_MUX 2 +#define RTE_USART0_DSR_PAD 21 +#else +#error "Invalid USART0 RTE_USART0_RI_PIN Pin Configuration!" +#endif +#else +//Pintool data +#define RTE_USART0_DSR_PORT USART0_DSR_PORT +#define RTE_USART0_DSR_PIN USART0_DSR_PIN +#if (USART0_DSR_LOC == 33) +#define RTE_USART0_DSR_MUX 2 +#define RTE_USART0_DSR_PAD 6 +#endif +#if (USART0_DSR_LOC == 34) +#define RTE_USART0_DSR_MUX 2 +#define RTE_USART0_DSR_PAD 21 +#endif +//Pintool data +#endif + +// USART0_DCD <0=>P0_12 <1=>P0_29 +// DCD for USART0 +#ifndef USART0_DCD_LOC +#define RTE_USART0_DCD_PORT 0 +#define RTE_USART0_DCD_PIN 12 +#else +#define RTE_USART0_DCD_PORT USART0_DCD_PORT +#define RTE_USART0_DCD_PIN USART0_DCD_PIN +#if (USART0_DCD_LOC == 35) +#define RTE_USART0_DCD_MUX 2 +#define RTE_USART0_DCD_PAD 7 +#elif (USART0_DCD_LOC == 36) +#define RTE_USART0_DCD_MUX 12 +#define RTE_USART0_DCD_PAD 0 +#endif +#endif + +// USART0_DTR <0=>P0_7 +// DTR for USART0 +#ifndef USART0_DTR_LOC +#define RTE_USART0_DTR_PORT 0 +#define RTE_USART0_DTR_PIN 7 +#else +#define RTE_USART0_DTR_PORT USART0_DTR_PORT +#define RTE_USART0_DTR_PIN USART0_DTR_PIN +#endif +#define RTE_USART0_DTR_MUX 2 +#define RTE_USART0_DTR_PAD 2 +// + +// UART1 [Driver_UART1] +// Configuration settings for Driver_UART1 in component ::CMSIS Driver:USART +#define RTE_UART1 1 + +#define RTE_UART1_CLK_SRC USART_ULPREFCLK +#define RTE_UART1_CLK_DIV_FACT 1 +#define RTE_UART1_FRAC_DIV_SEL USART_FRACTIONAL_DIVIDER + +#define RTE_UART1_LOOPBACK 0 +#define RTE_UART1_DMA_MODE1_EN 0 + +#define RTE_UART1_TX_FIFO_THRESHOLD USART_TRIGGER_TX_EMPTY +#define RTE_UART1_RX_FIFO_THRESHOLD USART_TRIGGER_RX_AEMPTY + +#define RTE_UART1_DMA_TX_LEN_PER_DES 1024 +#define RTE_UART1_DMA_RX_LEN_PER_DES 1024 + +#define RTE_UART1_CHNL_UDMA_TX_CH 27 + +#define RTE_UART1_CHNL_UDMA_RX_CH 26 + +/*UART1 PINS*/ +// UART1_TX <0=>P0_7 <1=>P0_30 <2=>P0_67 <3=>P0_69 <4=>P0_73 <5=>P0_75 <6=>P0_34 +// TX of UART1 +#ifndef UART1_TX_LOC +#ifdef SLI_SI91X_MCU_CONFIG_RADIO_BOARD_BASE_VER +#define RTE_UART1_TX_PORT_ID 0 +#else +#define RTE_UART1_TX_PORT_ID 0 + +#if ((RTE_UART1_TX_PORT_ID == 6)) +#error "Invalid UART1 RTE_UART1_TX_PIN Configuration!" +#endif +#endif + +#if (RTE_UART1_TX_PORT_ID == 0) +#define RTE_UART1_TX_PORT 0 +#define RTE_UART1_TX_PIN 7 +#define RTE_UART1_TX_MUX 6 +#define RTE_UART1_TX_PAD 2 +#elif (RTE_UART1_TX_PORT_ID == 1) +#define RTE_UART1_TX_PORT 0 +#define RTE_UART1_TX_PIN 30 +#define RTE_UART1_TX_MUX 6 +#define RTE_UART1_TX_PAD 0 //no pad +#elif (RTE_UART1_TX_PORT_ID == 2) +#define RTE_UART1_TX_PORT 0 +#define RTE_UART1_TX_PIN 67 +#define RTE_UART1_TX_MUX 9 +#define RTE_UART1_TX_PAD 25 +#elif (RTE_UART1_TX_PORT_ID == 3) +#define RTE_UART1_TX_PORT 0 +#define RTE_UART1_TX_PIN 73 +#define RTE_UART1_TX_MUX 6 +#define RTE_UART1_TX_PAD 31 +#elif (RTE_UART1_TX_PORT_ID == 4) +#define RTE_UART1_TX_PORT 0 +#define RTE_UART1_TX_PIN 75 +#define RTE_UART1_TX_MUX 9 +#define RTE_UART1_TX_PAD 33 +#else +#error "Invalid UART1 RTE_UART1_TX_PIN Pin Configuration!" +#endif +#else +//Pintool data +#define RTE_UART1_TX_PORT UART1_TX_PORT +#if (UART1_TX_LOC == 0) +#define RTE_UART1_TX_PIN UART1_TX_PIN +#define RTE_UART1_TX_MUX 6 +#define RTE_UART1_TX_PAD 2 +#endif +#if (UART1_TX_LOC == 1) +#define RTE_UART1_TX_PIN UART1_TX_PIN +#define RTE_UART1_TX_MUX 6 +#define RTE_UART1_TX_PAD 0 //no pad +#endif +#if (UART1_TX_LOC == 2) +#define RTE_UART1_TX_PIN (UART1_TX_PIN + GPIO_MAX_PIN) +#define RTE_UART1_TX_MUX 6 +#define RTE_UART1_TX_PAD 27 +#endif +#if (UART1_TX_LOC == 3) +#define RTE_UART1_TX_PIN (UART1_TX_PIN + GPIO_MAX_PIN) +#define RTE_UART1_TX_MUX 6 +#define RTE_UART1_TX_PAD 31 +#endif +#if (UART1_TX_LOC == 4) +#define RTE_UART1_TX_PIN (UART1_TX_PIN + GPIO_MAX_PIN) +#define RTE_UART1_TX_MUX 9 +#define RTE_UART1_TX_PAD 33 +#endif +//Pintool data +#endif + +// UART1_RX <0=>P0_6 <1=>P0_29 <2=>P0_66 <3=>P0_68 <4=>P0_72 <5=>P0_74 <6=>P0_33 +// RX of UART1 +#ifndef UART1_RX_LOC +#define RTE_UART1_RX_PORT_ID 0 + +#if (RTE_UART1_RX_PORT_ID == 0) +#define RTE_UART1_RX_PORT 0 +#define RTE_UART1_RX_PIN 6 +#define RTE_UART1_RX_MUX 6 +#define RTE_UART1_RX_PAD 1 +#elif (RTE_UART1_RX_PORT_ID == 1) +#define RTE_UART1_RX_PORT 0 +#define RTE_UART1_RX_PIN 29 +#define RTE_UART1_RX_MUX 6 +#define RTE_UART1_RX_PAD 0 //no pad +#elif (RTE_UART1_RX_PORT_ID == 2) +#define RTE_UART1_RX_PORT 0 +#define RTE_UART1_RX_PIN 66 +#define RTE_UART1_RX_MUX 9 +#define RTE_UART1_RX_PAD 24 +#elif (RTE_UART1_RX_PORT_ID == 3) +#define RTE_UART1_RX_PORT 0 +#define RTE_UART1_RX_PIN 72 +#define RTE_UART1_RX_MUX 6 +#define RTE_UART1_RX_PAD 30 +#elif (RTE_UART1_RX_PORT_ID == 4) +#define RTE_UART1_RX_PORT 0 +#define RTE_UART1_RX_PIN 74 +#define RTE_UART1_RX_MUX 9 +#define RTE_UART1_RX_PAD 32 +#else +#error "Invalid UART1 RTE_UART1_RX_PIN Pin Configuration!" +#endif +#else +//Pintool data +#define RTE_UART1_RX_PORT UART1_RX_PORT +#if (UART1_RX_LOC == 5) +#define RTE_UART1_RX_PIN UART1_RX_PIN +#define RTE_UART1_RX_MUX 6 +#define RTE_UART1_RX_PAD 1 +#endif +#if (UART1_RX_LOC == 6) +#define RTE_UART1_RX_PIN UART1_RX_PIN +#define RTE_UART1_RX_MUX 6 +#define RTE_UART1_RX_PAD 0 //no pad +#endif +#if (UART1_RX_LOC == 7) +#define RTE_UART1_RX_PIN (UART1_RX_PIN + GPIO_MAX_PIN) +#define RTE_UART1_RX_MUX 6 +#define RTE_UART1_RX_PAD 26 +#endif +#if (UART1_RX_LOC == 8) +#define RTE_UART1_RX_PIN (UART1_RX_PIN + GPIO_MAX_PIN) +#define RTE_UART1_RX_MUX 6 +#define RTE_UART1_RX_PAD 30 +#endif +#if (UART1_RX_LOC == 9) +#define RTE_UART1_RX_PIN (UART1_RX_PIN + GPIO_MAX_PIN) +#define RTE_UART1_RX_MUX 9 +#define RTE_UART1_RX_PAD 32 +#endif +//Pintool data +#endif + +// UART1_CTS <0=>P0_11 <1=>P0_28 <2=>P0_51 <3=>P0_65 <4=>P0_71 <5=>P0_73 <6=>P0_32 +// CTS of UART1 +#ifndef UART1_CTS_LOC +#define RTE_UART1_CTS_PORT_ID 0 + +#if (RTE_UART1_CTS_PORT_ID == 0) +#define RTE_UART1_CTS_PORT 0 +#define RTE_UART1_CTS_PIN 11 +#define RTE_UART1_CTS_MUX 6 +#define RTE_UART1_CTS_PAD 6 +#elif (RTE_UART1_CTS_PORT_ID == 1) +#define RTE_UART1_CTS_PORT 0 +#define RTE_UART1_CTS_PIN 28 +#define RTE_UART1_CTS_MUX 6 +#define RTE_UART1_CTS_PAD 0 //no pad +#elif (RTE_UART1_CTS_PORT_ID == 2) +#define RTE_UART1_CTS_PORT 0 +#define RTE_UART1_CTS_PIN 51 +#define RTE_UART1_CTS_MUX 9 +#define RTE_UART1_CTS_PAD 15 +#elif (RTE_UART1_CTS_PORT_ID == 3) +#define RTE_UART1_CTS_PORT 0 +#define RTE_UART1_CTS_PIN 65 +#define RTE_UART1_CTS_MUX 9 +#define RTE_UART1_CTS_PAD 23 +#elif (RTE_UART1_CTS_PORT_ID == 4) +#define RTE_UART1_CTS_PORT 0 +#define RTE_UART1_CTS_PIN 71 +#define RTE_UART1_CTS_MUX 6 +#define RTE_UART1_CTS_PAD 29 +#else +#error "Invalid UART1 RTE_UART1_CTS_PIN Pin Configuration!" +#endif +#else +//Pintool data +#define RTE_UART1_CTS_PORT UART1_CTS_PORT +#if (UART1_CTS_LOC == 10) +#define RTE_UART1_CTS_PIN UART1_CTS_PIN +#define RTE_UART1_CTS_MUX 6 +#define RTE_UART1_CTS_PAD 6 +#endif +#if (UART1_CTS_LOC == 11) +#define RTE_UART1_CTS_PIN UART1_CTS_PIN +#define RTE_UART1_CTS_MUX 6 +#define RTE_UART1_CTS_PAD 0 //no pad +#endif +#if (UART1_CTS_LOC == 12) +#define RTE_UART1_CTS_PIN UART1_CTS_PIN +#define RTE_UART1_CTS_MUX 9 +#define RTE_UART1_CTS_PAD 15 +#endif +#if (UART1_CTS_LOC == 13) +#define RTE_UART1_CTS_PIN (UART1_CTS_PIN + GPIO_MAX_PIN) +#define RTE_UART1_CTS_MUX 9 +#define RTE_UART1_CTS_PAD 23 +#endif +#if (UART1_CTS_LOC == 14) +#define RTE_UART1_CTS_PIN (UART1_CTS_PIN + GPIO_MAX_PIN) +#define RTE_UART1_CTS_MUX 6 +#define RTE_UART1_CTS_PAD 29 +#endif +#if (UART1_CTS_LOC == 15) +#define RTE_UART1_CTS_PIN (UART1_CTS_PIN + GPIO_MAX_PIN) +#define RTE_UART1_CTS_MUX 9 +#define RTE_UART1_CTS_PAD 31 +#endif +//Pintool data +#endif + +// UART1_RTS <0=>P0_10 <1=>P0_27 <2=>P0_50 <3=>P0_64 <4=>P0_70 <5=>P0_72 <6=>P0_31 +// RTS of UART1 +#ifndef UART1_RTS_LOC +#ifdef SLI_SI91X_MCU_CONFIG_RADIO_BOARD_BASE_VER +#define RTE_UART1_RTS_PORT_ID 0 +#else +#define RTE_UART1_RTS_PORT_ID 0 +#endif + +#if (RTE_UART1_RTS_PORT_ID == 0) +#define RTE_UART1_RTS_PORT 0 +#define RTE_UART1_RTS_PIN 10 +#define RTE_UART1_RTS_MUX 6 +#define RTE_UART1_RTS_PAD 5 +#elif (RTE_UART1_RTS_PORT_ID == 1) +#define RTE_UART1_RTS_PORT 0 +#define RTE_UART1_RTS_PIN 27 +#define RTE_UART1_RTS_MUX 6 +#define RTE_UART1_RTS_PAD 0 //no pad +#elif (RTE_UART1_RTS_PORT_ID == 2) +#define RTE_UART1_RTS_PORT 0 +#define RTE_UART1_RTS_PIN 50 +#define RTE_UART1_RTS_MUX 9 +#define RTE_UART1_RTS_PAD 14 +#elif (RTE_UART1_RTS_PORT_ID == 3) +#define RTE_UART1_RTS_PORT 0 +#define RTE_UART1_RTS_PIN 70 +#define RTE_UART1_RTS_MUX 6 +#define RTE_UART1_RTS_PAD 28 +#elif (RTE_UART1_RTS_PORT_ID == 4) +#define RTE_UART1_RTS_PORT 0 +#define RTE_UART1_RTS_PIN 72 +#define RTE_UART1_RTS_MUX 9 +#define RTE_UART1_RTS_PAD 30 +#else +#error "Invalid UART1 RTE_UART1_RTS_PIN Pin Configuration!" +#endif +#else +//Pintool data +#define RTE_UART1_RTS_PORT UART1_RTS_PORT +#if (UART1_RTS_LOC == 16) +#define RTE_UART1_RTS_PIN UART1_RTS_PIN +#define RTE_UART1_RTS_MUX 6 +#define RTE_UART1_RTS_PAD 5 +#endif +#if (UART1_RTS_LOC == 17) +#define RTE_UART1_RTS_PIN UART1_RTS_PIN +#define RTE_UART1_RTS_MUX 6 +#define RTE_UART1_RTS_PAD 0 //no pad +#endif +#if (UART1_RTS_LOC == 18) +#define RTE_UART1_RTS_PIN UART1_RTS_PIN +#define RTE_UART1_RTS_MUX 9 +#define RTE_UART1_RTS_PAD 14 +#endif +#if (UART1_RTS_LOC == 19) +#define RTE_UART1_RTS_PIN (UART1_RTS_PIN + GPIO_MAX_PIN) +#define RTE_UART1_RTS_MUX 9 +#define RTE_UART1_RTS_PAD 22 +#endif +#if (UART1_RTS_LOC == 20) +#define RTE_UART1_RTS_PIN (UART1_RTS_PIN + GPIO_MAX_PIN) +#define RTE_UART1_RTS_MUX 6 +#define RTE_UART1_RTS_PAD 28 +#endif +#if (UART1_RTS_LOC == 21) +#define RTE_UART1_RTS_PIN (UART1_RTS_PIN + GPIO_MAX_PIN) +#define RTE_UART1_RTS_MUX 9 +#define RTE_UART1_RTS_PAD 30 +#endif +//Pintool data +#endif + +// + +// ULP_UART [Driver_ULP_UART] +// Configuration settings for Driver_ULP_UART in component ::CMSIS Driver:USART +#define RTE_ULP_UART 1 + +#define RTE_ULP_UART_CLK_SRC ULP_UART_REF_CLK +#define RTE_ULP_UART_CLK_DIV_FACT 0 +#define RTE_ULP_UART_FRAC_SEL USART_FRACTIONAL_DIVIDER + +#define RTE_ULP_UART_LOOPBACK 0 +#define RTE_ULP_UART_DMA_MODE1_EN 0 + +#define RTE_ULP_UART_TX_FIFO_THRESHOLD USART_TRIGGER_TX_EMPTY +#define RTE_ULP_UART_RX_FIFO_THRESHOLD USART_TRIGGER_RX_AEMPTY + +#define RTE_ULP_UART_DMA_TX_LEN_PER_DES 1024 +#define RTE_ULP_UART_DMA_RX_LEN_PER_DES 1024 + +#define RTE_ULPUART_CHNL_UDMA_TX_CH 1 + +#define RTE_ULPUART_CHNL_UDMA_RX_CH 0 + +/*ULPSS UART PINS*/ +// UART1_TX <0=>P0_3 <1=>P0_7 <2=>P0_11 +// TX of ULPSS UART +#ifndef ULP_UART_TX_LOC +#define RTE_ULP_UART_TX_PORT_ID 1 +#if (RTE_ULP_UART_TX_PORT_ID == 0) +#define RTE_ULP_UART_TX_PORT 0 +#define RTE_ULP_UART_TX_PIN 7 +#define RTE_ULP_UART_TX_MUX 3 +#elif (RTE_ULP_UART_TX_PORT_ID == 1) +#define RTE_ULP_UART_TX_PORT 0 +#define RTE_ULP_UART_TX_PIN 11 +#define RTE_ULP_UART_TX_MUX 3 +#else +#error "Invalid ULPSS UART RTE_ULP_UART_TX_PIN Pin Configuration!" +#endif +#else +//Pintool data +#define RTE_ULP_UART_TX_PORT ULP_UART_TX_PORT +#define RTE_ULP_UART_TX_PIN ULP_UART_TX_PIN +#define RTE_ULP_UART_TX_MUX 3 +//Pintool data +#endif + +// UART1_RX <0=>P0_2 <1=>P0_6 <2=>P0_9 +// RX of ULPSS UART +#ifndef ULP_UART_RX_LOC +#define RTE_ULP_UART_RX_PORT_ID 2 +#if (RTE_ULP_UART_RX_PORT_ID == 0) +#define RTE_ULP_UART_RX_PORT 0 +#define RTE_ULP_UART_RX_PIN 2 +#define RTE_ULP_UART_RX_MUX 3 +#elif (RTE_ULP_UART_RX_PORT_ID == 1) +#define RTE_ULP_UART_RX_PORT 0 +#define RTE_ULP_UART_RX_PIN 6 +#define RTE_ULP_UART_RX_MUX 3 +#elif (RTE_ULP_UART_RX_PORT_ID == 2) +#define RTE_ULP_UART_RX_PORT 0 +#define RTE_ULP_UART_RX_PIN 9 +#define RTE_ULP_UART_RX_MUX 3 +#else +#error "Invalid ULPSS UART RTE_ULP_UART_RX_PIN Pin Configuration!" +#endif +#else +//Pintool data +#define RTE_ULP_UART_RX_PORT ULP_UART_RX_PORT +#define RTE_ULP_UART_RX_PIN ULP_UART_RX_PIN +#define RTE_ULP_UART_RX_MUX 3 +//Pintool data +#endif + +// UART1_CTS <0=>P0_1 <1=>P0_5 <2=>P0_8 +// CTS of ULPSS UART +#ifndef ULP_UART_CTS_LOC +#define RTE_ULP_UART_CTS_PORT_ID 0 +#if (RTE_ULP_UART_CTS_PORT_ID == 0) +#define RTE_ULP_UART_CTS_PORT 0 +#define RTE_ULP_UART_CTS_PIN 1 +#define RTE_ULP_UART_CTS_MUX 3 +#elif (RTE_ULP_UART_CTS_PORT_ID == 1) +#define RTE_ULP_UART_CTS_PORT 0 +#define RTE_ULP_UART_CTS_PIN 8 +#define RTE_ULP_UART_CTS_MUX 3 +#else +#error "Invalid ULPSS UART RTE_ULP_UART_CTS_PIN Pin Configuration!" +#endif +#else +//Pintool data +#define RTE_ULP_UART_CTS_PORT ULP_UART_CTS_PORT +#define RTE_ULP_UART_CTS_PIN ULP_UART_CTS_PIN +#define RTE_ULP_UART_CTS_MUX 3 +//Pintool data +#endif + +// UART1_RTS <0=>P0_0 <1=>P0_4 <2=>P0_10 +// RTS of ULPSS UART +#ifndef ULP_UART_RTS_LOC +#define RTE_ULP_UART_RTS_PORT_ID 0 +#if (RTE_ULP_UART_RTS_PORT_ID == 0) +#define RTE_ULP_UART_RTS_PORT 0 +#define RTE_ULP_UART_RTS_PIN 10 +#else +#error "Invalid ULPSS UART RTE_ULP_UART_RTS_PIN Pin Configuration!" +#endif +#else +#define RTE_ULP_UART_RTS_PORT ULP_UART_RTS_PORT +#define RTE_ULP_UART_RTS_PIN ULP_UART_RTS_PIN +#endif +#define RTE_ULP_UART_RTS_MUX 8 + +// + +// SSI_MASTER (Serial Peripheral Interface 1) [Driver_SSI_MASTER] +// Configuration settings for Driver_SSI_MASTER in component ::CMSIS Driver:SPI +#define RTE_SSI_MASTER 1 + +// SSI_MASTER_MISO Pin <0=>GPIO_12 <1=>GPIO_27 <2=>GPIO_57 +#ifndef SSI_MASTER_DATA1_LOC +#ifdef SLI_SI91X_MCU_CONFIG_RADIO_BOARD_BASE_VER +#define RTE_SSI_MASTER_MISO_PORT_ID 1 +#else +#define RTE_SSI_MASTER_MISO_PORT_ID 0 +#endif + +#if (RTE_SSI_MASTER_MISO_PORT_ID == 0) +#define RTE_SSI_MASTER_MISO 1 +#define RTE_SSI_MASTER_MISO_PORT 0 +#define RTE_SSI_MASTER_MISO_PIN 12 +#define RTE_SSI_MASTER_MISO_MODE EGPIO_PIN_MUX_MODE3 +#define RTE_SSI_MASTER_MISO_PADSEL 7 +#elif (RTE_SSI_MASTER_MISO_PORT_ID == 1) +#define RTE_SSI_MASTER_MISO 1 +#define RTE_SSI_MASTER_MISO_PORT 0 +#define RTE_SSI_MASTER_MISO_PIN 27 +#define RTE_SSI_MASTER_MISO_MODE EGPIO_PIN_MUX_MODE3 +#define RTE_SSI_MASTER_MISO_PADSEL 0 //NO PAD +#elif (RTE_SSI_MASTER_MISO_PORT_ID == 2) +#define RTE_SSI_MASTER_MISO 1 +#define RTE_SSI_MASTER_MISO_PORT 0 +#define RTE_SSI_MASTER_MISO_PIN 57 +#define RTE_SSI_MASTER_MISO_MODE EGPIO_PIN_MUX_MODE3 +#define RTE_SSI_MASTER_MISO_PADSEL 21 +#else +#error "Invalid SSI_MASTER_MISO Pin Configuration!" +#endif +#else +//Pintool data +#define RTE_SSI_MASTER_MISO 1 +#define RTE_SSI_MASTER_MISO_PORT SSI_MASTER_MISO_DATA1_PORT +#define RTE_SSI_MASTER_MISO_PIN SSI_MASTER_MISO_DATA1_PIN +#define RTE_SSI_MASTER_MISO_MODE EGPIO_PIN_MUX_MODE3 +#if (SSI_MASTER_DATA1_LOC == 3) +#define RTE_SSI_MASTER_MISO_PADSEL 7 +#endif +#if (SSI_MASTER_DATA1_LOC == 4) +#define RTE_SSI_MASTER_MISO_PADSEL 0 //NO PAD +#endif +#if (SSI_MASTER_DATA1_LOC == 5) +#define RTE_SSI_MASTER_MISO_PADSEL 21 +#endif +//Pintool data +#endif + +// SSI_MASTER_MOSI Pin <0=>GPIO_11 <1=>GPIO_26 <2=>GPIO_56 +#ifndef SSI_MASTER_DATA0_LOC +#define RTE_SSI_MASTER_MOSI_PORT_ID 1 + +#if (RTE_SSI_MASTER_MOSI_PORT_ID == 0) +#define RTE_SSI_MASTER_MOSI 1 +#define RTE_SSI_MASTER_MOSI_PORT 0 +#define RTE_SSI_MASTER_MOSI_PIN 11 +#define RTE_SSI_MASTER_MOSI_MODE EGPIO_PIN_MUX_MODE3 +#define RTE_SSI_MASTER_MOSI_PADSEL 6 +#elif (RTE_SSI_MASTER_MOSI_PORT_ID == 1) +#define RTE_SSI_MASTER_MOSI 1 +#define RTE_SSI_MASTER_MOSI_PORT 0 +#define RTE_SSI_MASTER_MOSI_PIN 26 +#define RTE_SSI_MASTER_MOSI_MODE EGPIO_PIN_MUX_MODE3 +#define RTE_SSI_MASTER_MOSI_PADSEL 0 //NO PAD +#elif (RTE_SSI_MASTER_MOSI_PORT_ID == 2) +#define RTE_SSI_MASTER_MOSI 1 +#define RTE_SSI_MASTER_MOSI_PORT 0 +#define RTE_SSI_MASTER_MOSI_PIN 56 +#define RTE_SSI_MASTER_MOSI_MODE EGPIO_PIN_MUX_MODE3 +#define RTE_SSI_MASTER_MOSI_PADSEL 20 +#else +#error "Invalid SSI_MASTER_MOSI Pin Configuration!" +#endif +#else +//Pintool data +#define RTE_SSI_MASTER_MOSI 1 +#define RTE_SSI_MASTER_MOSI_PORT SSI_MASTER_MOSI_DATA0_PORT +#define RTE_SSI_MASTER_MOSI_PIN SSI_MASTER_MOSI_DATA0_PIN +#define RTE_SSI_MASTER_MOSI_MODE EGPIO_PIN_MUX_MODE3 +#if (SSI_MASTER_DATA0_LOC == 0) +#define RTE_SSI_MASTER_MOSI_PADSEL 6 +#endif +#if (SSI_MASTER_DATA0_LOC == 1) +#define RTE_SSI_MASTER_MOSI_PADSEL 0 //NO PAD +#endif +#if (SSI_MASTER_DATA0_LOC == 2) +#define RTE_SSI_MASTER_MOSI_PADSEL 20 +#endif +//Pintool data +#endif + +// SSI_MASTER_SCK Pin <0=>GPIO_8 <1=>GPIO_25 <2=>GPIO_52 +#ifndef SSI_MASTER_SCK_LOC +#define RTE_SSI_MASTER_SCK_PORT_ID 1 + +#if (RTE_SSI_MASTER_SCK_PORT_ID == 0) +#define RTE_SSI_MASTER_SCK 1 +#define RTE_SSI_MASTER_SCK_PORT 0 +#define RTE_SSI_MASTER_SCK_PIN 8 +#define RTE_SSI_MASTER_SCK_MODE EGPIO_PIN_MUX_MODE3 +#define RTE_SSI_MASTER_SCK_PADSEL 3 +#elif (RTE_SSI_MASTER_SCK_PORT_ID == 1) +#define RTE_SSI_MASTER_SCK 1 +#define RTE_SSI_MASTER_SCK_PORT 0 +#define RTE_SSI_MASTER_SCK_PIN 25 +#define RTE_SSI_MASTER_SCK_MODE EGPIO_PIN_MUX_MODE3 +#define RTE_SSI_MASTER_SCK_PADSEL 0 //NO PAD +#elif (RTE_SSI_MASTER_SCK_PORT_ID == 2) +#define RTE_SSI_MASTER_SCK 1 +#define RTE_SSI_MASTER_SCK_PORT 0 +#define RTE_SSI_MASTER_SCK_PIN 52 +#define RTE_SSI_MASTER_SCK_MODE EGPIO_PIN_MUX_MODE3 +#define RTE_SSI_MASTER_SCK_PADSEL 16 +#else +#error "Invalid SSI_MASTER_SCK Pin Configuration!" +#endif +#else +//Pintool data +#define RTE_SSI_MASTER_SCK 1 +#define RTE_SSI_MASTER_SCK_PORT SSI_MASTER_SCK__PORT +#define RTE_SSI_MASTER_SCK_PIN SSI_MASTER_SCK__PIN +#define RTE_SSI_MASTER_SCK_MODE EGPIO_PIN_MUX_MODE3 +#if (SSI_MASTER_SCK_LOC == 6) +#define RTE_SSI_MASTER_SCK_PADSEL 3 +#endif +#if (SSI_MASTER_SCK_LOC == 7) +#define RTE_SSI_MASTER_SCK_PADSEL 0 //NO PAD +#endif +#if (SSI_MASTER_SCK_LOC == 8) +#define RTE_SSI_MASTER_SCK_PADSEL 16 +#endif +//Pintool data +#endif + +#define M4_SSI_CS0 1 +#define M4_SSI_CS1 0 +#define M4_SSI_CS2 0 +#define M4_SSI_CS3 0 + +// SSI_MASTER_CS Pin <0=>GPIO_9 <1=>GPIO_28 <2=>GPIO_53 <3=>GPIO_10 <4=>GPIO_15 <5=>GPIO_50 <6=>GPIO_51 +#ifndef SSI_MASTER_CS0_LOC +#define RTE_SSI_MASTER_CS0_PORT_ID 1 + +#if (RTE_SSI_MASTER_CS0_PORT_ID == 0) +#define RTE_SSI_MASTER_CS0 M4_SSI_CS0 +#define RTE_SSI_MASTER_CS0_PORT 0 +#define RTE_SSI_MASTER_CS0_PIN 9 +#define RTE_SSI_MASTER_CS0_MODE EGPIO_PIN_MUX_MODE3 +#define RTE_SSI_MASTER_CS0_PADSEL 4 +#elif (RTE_SSI_MASTER_CS0_PORT_ID == 1) +#define RTE_SSI_MASTER_CS0 M4_SSI_CS0 +#define RTE_SSI_MASTER_CS0_PORT 0 +#define RTE_SSI_MASTER_CS0_PIN 28 +#define RTE_SSI_MASTER_CS0_MODE EGPIO_PIN_MUX_MODE3 +#define RTE_SSI_MASTER_CS0_PADSEL 0 //NO PAD +#elif (RTE_SSI_MASTER_CS0_PORT_ID == 2) +#define RTE_SSI_MASTER_CS0 M4_SSI_CS0 +#define RTE_SSI_MASTER_CS0_PORT 0 +#define RTE_SSI_MASTER_CS0_PIN 53 +#define RTE_SSI_MASTER_CS0_MODE EGPIO_PIN_MUX_MODE3 +#define RTE_SSI_MASTER_CS0_PADSEL 17 +#else +#error "Invalid SSI_MASTER_CS0 Pin Configuration!" +#endif +#else +//Pintool data +#define RTE_SSI_MASTER_CS0 M4_SSI_CS0 +#define RTE_SSI_MASTER_CS0_PORT SSI_MASTER_CS0__PORT +#define RTE_SSI_MASTER_CS0_PIN SSI_MASTER_CS0__PIN +#define RTE_SSI_MASTER_CS0_MODE EGPIO_PIN_MUX_MODE3 +#if (SSI_MASTER_CS0_LOC == 9) +#define RTE_SSI_MASTER_CS0_PADSEL 4 +#endif +#if (SSI_MASTER_CS0_LOC == 10) +#define RTE_SSI_MASTER_CS0_PADSEL 0 //NO PAD +#endif +#if (SSI_MASTER_CS0_LOC == 11) +#define RTE_SSI_MASTER_CS0_PADSEL 17 +#endif +//Pintool data +#endif + +//CS1 +#ifndef SSI_MASTER_CS1_LOC +#define RTE_SSI_MASTER_CS1_PORT_ID 0 +#if (RTE_SSI_MASTER_CS1_PORT_ID == 0) +#define RTE_SSI_MASTER_CS1_PORT 0 +#define RTE_SSI_MASTER_CS1_PIN 10 +#else +#error "Invalid SSI_MASTER_CS1 Pin Configuration!" +#endif +#else +#define RTE_SSI_MASTER_CS1_PORT SSI_MASTER_CS1__PORT +#define RTE_SSI_MASTER_CS1_PIN SSI_MASTER_CS1__PIN +#endif +#define RTE_SSI_MASTER_CS1 M4_SSI_CS1 +#define RTE_SSI_MASTER_CS1_MODE EGPIO_PIN_MUX_MODE3 +#define RTE_SSI_MASTER_CS1_PADSEL 5 + +//CS2 +#ifndef SSI_MASTER_CS2_LOC +#define RTE_SSI_MASTER_CS2_PORT_ID 1 +#if (RTE_SSI_MASTER_CS2_PORT_ID == 0) +#define RTE_SSI_MASTER_CS2 M4_SSI_CS2 +#define RTE_SSI_MASTER_CS2_PORT 0 +#define RTE_SSI_MASTER_CS2_PIN 15 +#define RTE_SSI_MASTER_CS2_MODE EGPIO_PIN_MUX_MODE3 +#define RTE_SSI_MASTER_CS2_PADSEL 8 +#elif (RTE_SSI_MASTER_CS2_PORT_ID == 1) +#define RTE_SSI_MASTER_CS2 M4_SSI_CS2 +#define RTE_SSI_MASTER_CS2_PORT 0 +#define RTE_SSI_MASTER_CS2_PIN 50 +#define RTE_SSI_MASTER_CS2_MODE EGPIO_PIN_MUX_MODE3 +#define RTE_SSI_MASTER_CS2_PADSEL 14 +#else +#error "Invalid SSI_MASTER_CS2 Pin Configuration!" +#endif +#else +//Pintool data +#define RTE_SSI_MASTER_CS2 M4_SSI_CS2 +#define RTE_SSI_MASTER_CS2_PORT SSI_MASTER_CS2__PORT +#define RTE_SSI_MASTER_CS2_PIN SSI_MASTER_CS2__PIN +#define RTE_SSI_MASTER_CS2_MODE EGPIO_PIN_MUX_MODE3 +#if (SSI_MASTER_CS2_LOC == 13) +#define RTE_SSI_MASTER_CS2_PADSEL 8 +#endif +#if (SSI_MASTER_CS2_LOC == 14) +#define RTE_SSI_MASTER_CS2_PADSEL 14 +#endif +//Pintool data +#endif + +//CS3 +#ifndef SSI_MASTER_CS3_LOC +#define RTE_SSI_MASTER_CS3_PORT_ID 0 +#if (RTE_SSI_MASTER_CS3_PORT_ID == 0) +#define RTE_SSI_MASTER_CS3_PORT 0 +#define RTE_SSI_MASTER_CS3_PIN 51 +#else +#error "Invalid SSI_MASTER_CS3 Pin Configuration!" +#endif +#else +#define RTE_SSI_MASTER_CS3_PORT SSI_MASTER_CS3__PORT +#define RTE_SSI_MASTER_CS3_PIN SSI_MASTER_CS3__PIN +#endif +#define RTE_SSI_MASTER_CS3 M4_SSI_CS3 +#define RTE_SSI_MASTER_CS3_MODE EGPIO_PIN_MUX_MODE3 +#define RTE_SSI_MASTER_CS3_PADSEL 15 + +// DMA Rx +// Channel <28=>28 +// Selects DMA Channel (only Channel 28 can be used) +// +#define RTE_SSI_MASTER_UDMA_RX_CH 28 + +// DMA Tx +// Channel <29=>29 +// Selects DMA Channel (only Channel 29 can be used) +// +#define RTE_SSI_MASTER_UDMA_TX_CH 29 +// + +// SSI_SLAVE (Serial Peripheral Interface 2) [Driver_SSI_SLAVE] +// Configuration settings for Driver_SSI_SLAVE in component ::CMSIS Driver:SPI +#define RTE_SSI_SLAVE 1 + +#define RTE_SSI_SLAVE_INPUT_CLOCK SSISLAVE_CLK + +// SSI_SLAVE_MISO Pin <0=>Not Used <1=>GPIO_11 <2=>GPIO_28 <3=>GPIO_49 <4=>GPIO_57 +#ifndef SSI_SLAVE_MISO_LOC +#define RTE_SSI_SLAVE_MISO_PORT_ID 2 + +#if (RTE_SSI_SLAVE_MISO_PORT_ID == 0) +#define RTE_SSI_SLAVE_MISO 0 +#elif (RTE_SSI_SLAVE_MISO_PORT_ID == 1) +#define RTE_SSI_SLAVE_MISO 1 +#define RTE_SSI_SLAVE_MISO_PORT 0 +#define RTE_SSI_SLAVE_MISO_PIN 11 +#define RTE_SSI_SLAVE_MISO_MODE EGPIO_PIN_MUX_MODE8 +#define RTE_SSI_SLAVE_MISO_PADSEL 6 +#elif (RTE_SSI_SLAVE_MISO_PORT_ID == 2) +#define RTE_SSI_SLAVE_MISO 1 +#define RTE_SSI_SLAVE_MISO_PORT 0 +#define RTE_SSI_SLAVE_MISO_PIN 28 +#define RTE_SSI_SLAVE_MISO_MODE EGPIO_PIN_MUX_MODE8 +#define RTE_SSI_SLAVE_MISO_PADSEL 0 //no pad +#elif (RTE_SSI_SLAVE_MISO_PORT_ID == 3) +#define RTE_SSI_SLAVE_MISO 1 +#define RTE_SSI_SLAVE_MISO_PORT 0 +#define RTE_SSI_SLAVE_MISO_PIN 49 +#define RTE_SSI_SLAVE_MISO_MODE EGPIO_PIN_MUX_MODE8 +#define RTE_SSI_SLAVE_MISO_PADSEL 13 +#elif (RTE_SSI_SLAVE_MISO_PORT_ID == 4) +#define RTE_SSI_SLAVE_MISO 1 +#define RTE_SSI_SLAVE_MISO_PORT 0 +#define RTE_SSI_SLAVE_MISO_PIN 57 +#define RTE_SSI_SLAVE_MISO_MODE EGPIO_PIN_MUX_MODE8 +#define RTE_SSI_SLAVE_MISO_PADSEL 21 +#else +#error "Invalid SSI_SLAVE_MISO Pin Configuration!" +#endif +#else +//Pintool data +#define RTE_SSI_SLAVE_MISO 1 +#define RTE_SSI_SLAVE_MISO_PORT SSI_SLAVE_MISO__PORT +#define RTE_SSI_SLAVE_MISO_PIN SSI_SLAVE_MISO__PIN +#define RTE_SSI_SLAVE_MISO_MODE EGPIO_PIN_MUX_MODE8 +#if (SSI_SLAVE_MISO_LOC == 5) +#define RTE_SSI_SLAVE_MISO_PADSEL 6 +#endif +#if (SSI_SLAVE_MISO_LOC == 6) +#define RTE_SSI_SLAVE_MISO_PADSEL 0 //no pad +#endif +#if (SSI_SLAVE_MISO_LOC == 7) +#define RTE_SSI_SLAVE_MISO_PADSEL 13 +#endif +#if (SSI_SLAVE_MISO_LOC == 8) +#define RTE_SSI_SLAVE_MISO_PADSEL 21 +#endif +//Pintool data +#endif + +// SSI_SLAVE_MOSI Pin <0=>Not Used <1=>GPIO_10 <2=>GPIO_27 <3=>GPIO_48 <4=>GPIO_56 +#ifndef SSI_SLAVE_MOSI_LOC +#ifdef SLI_SI91X_MCU_CONFIG_RADIO_BOARD_BASE_VER +#define RTE_SSI_SLAVE_MOSI_PORT_ID 2 +#else +#define RTE_SSI_SLAVE_MOSI_PORT_ID 1 +#endif + +#if (RTE_SSI_SLAVE_MOSI_PORT_ID == 0) +#define RTE_SSI_SLAVE_MOSI 0 +#elif (RTE_SSI_SLAVE_MOSI_PORT_ID == 1) +#define RTE_SSI_SLAVE_MOSI 1 +#define RTE_SSI_SLAVE_MOSI_PORT 0 +#define RTE_SSI_SLAVE_MOSI_PIN 10 +#define RTE_SSI_SLAVE_MOSI_MODE EGPIO_PIN_MUX_MODE8 +#define RTE_SSI_SLAVE_MOSI_PADSEL 5 +#elif (RTE_SSI_SLAVE_MOSI_PORT_ID == 2) +#define RTE_SSI_SLAVE_MOSI 1 +#define RTE_SSI_SLAVE_MOSI_PORT 0 +#define RTE_SSI_SLAVE_MOSI_PIN 27 +#define RTE_SSI_SLAVE_MOSI_MODE EGPIO_PIN_MUX_MODE8 +#define RTE_SSI_SLAVE_MOSI_PADSEL 0 //no pad +#elif (RTE_SSI_SLAVE_MOSI_PORT_ID == 3) +#define RTE_SSI_SLAVE_MOSI 1 +#define RTE_SSI_SLAVE_MOSI_PORT 0 +#define RTE_SSI_SLAVE_MOSI_PIN 48 +#define RTE_SSI_SLAVE_MOSI_MODE EGPIO_PIN_MUX_MODE8 +#define RTE_SSI_SLAVE_MOSI_PADSEL 12 +#elif (RTE_SSI_SLAVE_MOSI_PORT_ID == 4) +#define RTE_SSI_SLAVE_MOSI 1 +#define RTE_SSI_SLAVE_MOSI_PORT 0 +#define RTE_SSI_SLAVE_MOSI_PIN 56 +#define RTE_SSI_SLAVE_MOSI_MODE EGPIO_PIN_MUX_MODE8 +#define RTE_SSI_SLAVE_MOSI_PADSEL 20 +#else +#error "Invalid SSI_SLAVE_MOSI Pin Configuration!" +#endif +#else +//Pintool data +#define RTE_SSI_SLAVE_MOSI 1 +#define RTE_SSI_SLAVE_MOSI_PORT SSI_SLAVE_MOSI__PORT +#define RTE_SSI_SLAVE_MOSI_PIN SSI_SLAVE_MOSI__PIN +#define RTE_SSI_SLAVE_MOSI_MODE EGPIO_PIN_MUX_MODE8 +#if (SSI_SLAVE_MOSI_LOC == 1) +#define RTE_SSI_SLAVE_MOSI_PADSEL 5 +#endif +#if (SSI_SLAVE_MOSI_LOC == 2) +#define RTE_SSI_SLAVE_MOSI_PADSEL 0 //no pad +#endif +#if (SSI_SLAVE_MOSI_LOC == 3) +#define RTE_SSI_SLAVE_MOSI_PADSEL 12 +#endif +#if (SSI_SLAVE_MOSI_LOC == 4) +#define RTE_SSI_SLAVE_MOSI_PADSEL 20 +#endif +//Pintool data +#endif + +// SSI_SLAVE_SCK Pin <0=>Not Used <1=>GPIO_8 <2=>GPIO_26 <3=>GPIO_47 <4=>GPIO_52 +#ifndef SSI_SLAVE_SCK_LOC +#define RTE_SSI_SLAVE_SCK_PORT_ID 2 + +#if (RTE_SSI_SLAVE_SCK_PORT_ID == 0) +#define RTE_SSI_SLAVE_SCK 0 +#elif (RTE_SSI_SLAVE_SCK_PORT_ID == 1) +#define RTE_SSI_SLAVE_SCK 1 +#define RTE_SSI_SLAVE_SCK_PORT 0 +#define RTE_SSI_SLAVE_SCK_PIN 8 +#define RTE_SSI_SLAVE_SCK_MODE EGPIO_PIN_MUX_MODE8 +#define RTE_SSI_SLAVE_SCK_PADSEL 3 +#elif (RTE_SSI_SLAVE_SCK_PORT_ID == 2) +#define RTE_SSI_SLAVE_SCK 1 +#define RTE_SSI_SLAVE_SCK_PORT 0 +#define RTE_SSI_SLAVE_SCK_PIN 26 +#define RTE_SSI_SLAVE_SCK_MODE EGPIO_PIN_MUX_MODE8 +#define RTE_SSI_SLAVE_SCK_PADSEL 0 //no pad +#elif (RTE_SSI_SLAVE_SCK_PORT_ID == 3) +#define RTE_SSI_SLAVE_SCK 1 +#define RTE_SSI_SLAVE_SCK_PORT 0 +#define RTE_SSI_SLAVE_SCK_PIN 47 +#define RTE_SSI_SLAVE_SCK_MODE EGPIO_PIN_MUX_MODE8 +#define RTE_SSI_SLAVE_SCK_PADSEL 11 +#elif (RTE_SSI_SLAVE_SCK_PORT_ID == 4) +#define RTE_SSI_SLAVE_SCK 1 +#define RTE_SSI_SLAVE_SCK_PORT 0 +#define RTE_SSI_SLAVE_SCK_PIN 52 +#define RTE_SSI_SLAVE_SCK_MODE EGPIO_PIN_MUX_MODE8 +#define RTE_SSI_SLAVE_SCK_PADSEL 16 +#else +#error "Invalid SSI_SLAVE_SCK Pin Configuration!" +#endif +#else +//Pintool data +#define RTE_SSI_SLAVE_SCK 1 +#define RTE_SSI_SLAVE_SCK_PORT SSI_SLAVE_SCK__PORT +#define RTE_SSI_SLAVE_SCK_PIN SSI_SLAVE_SCK__PIN +#define RTE_SSI_SLAVE_SCK_MODE EGPIO_PIN_MUX_MODE8 +#if (SSI_SLAVE_SCK_LOC == 9) +#define RTE_SSI_SLAVE_SCK_PADSEL 3 +#endif +#if (SSI_SLAVE_SCK_LOC == 10) +#define RTE_SSI_SLAVE_SCK_PADSEL 0 //no pad +#endif +#if (SSI_SLAVE_SCK_LOC == 11) +#define RTE_SSI_SLAVE_SCK_PADSEL 11 +#endif +#if (SSI_SLAVE_SCK_LOC == 12) +#define RTE_SSI_SLAVE_SCK_PADSEL 16 +#endif +//Pintool data +#endif + +// SSI_SLAVE_CS Pin <0=>Not Used <1=>GPIO_9 <2=>GPIO_25 <3=>GPIO_46 <4=>GPIO_53 +#ifndef SSI_SLAVE_CS0_LOC +#define RTE_SSI_SLAVE_CS_PORT_ID 1 + +#if (RTE_SSI_SLAVE_CS_PORT_ID == 0) +#define RTE_SSI_SLAVE_CS 0 +#elif (RTE_SSI_SLAVE_CS_PORT_ID == 1) +#define RTE_SSI_SLAVE_CS 1 +#define RTE_SSI_SLAVE_CS_PORT 0 +#define RTE_SSI_SLAVE_CS_PIN 9 +#define RTE_SSI_SLAVE_CS_MODE EGPIO_PIN_MUX_MODE8 +#define RTE_SSI_SLAVE_CS_PADSEL 4 +#elif (RTE_SSI_SLAVE_CS_PORT_ID == 2) +#define RTE_SSI_SLAVE_CS 1 +#define RTE_SSI_SLAVE_CS_PORT 0 +#define RTE_SSI_SLAVE_CS_PIN 25 +#define RTE_SSI_SLAVE_CS_MODE EGPIO_PIN_MUX_MODE8 +#define RTE_SSI_SLAVE_CS_PADSEL 0 //no pad +#elif (RTE_SSI_SLAVE_CS_PORT_ID == 3) +#define RTE_SSI_SLAVE_CS 1 +#define RTE_SSI_SLAVE_CS_PORT 0 +#define RTE_SSI_SLAVE_CS_PIN 46 +#define RTE_SSI_SLAVE_CS_MODE EGPIO_PIN_MUX_MODE8 +#define RTE_SSI_SLAVE_CS_PADSEL 10 +#elif (RTE_SSI_SLAVE_CS_PORT_ID == 4) +#define RTE_SSI_SLAVE_CS 1 +#define RTE_SSI_SLAVE_CS_PORT 0 +#define RTE_SSI_SLAVE_CS_PIN 53 +#define RTE_SSI_SLAVE_CS_MODE EGPIO_PIN_MUX_MODE8 +#define RTE_SSI_SLAVE_CS_PADSEL 17 +#else +#error "Invalid SSI_SLAVE_CS Pin Configuration!" +#endif +#else +//Pintool data +#define RTE_SSI_SLAVE_CS 1 +#define RTE_SSI_SLAVE_CS_PORT SSI_SLAVE_CS0__PORT +#define RTE_SSI_SLAVE_CS_PIN SSI_SLAVE_CS0__PIN +#define RTE_SSI_SLAVE_CS_MODE EGPIO_PIN_MUX_MODE8 +#if (SSI_SLAVE_CS0_LOC == 13) +#define RTE_SSI_SLAVE_CS_PADSEL 4 +#endif +#if (SSI_SLAVE_CS0_LOC == 14) +#define RTE_SSI_SLAVE_CS_PADSEL 0 //no pad +#endif +#if (SSI_SLAVE_CS0_LOC == 15) +#define RTE_SSI_SLAVE_CS_PADSEL 10 +#endif +#if (SSI_SLAVE_CS0_LOC == 16) +#define RTE_SSI_SLAVE_CS_PADSEL 17 +#endif +//Pintool data +#endif + +// DMA Rx +// Channel <22=>22 +// Selects DMA Channel (only Channel 22 can be used) +// +#define RTE_SSI_SLAVE_UDMA_RX_CH 22 +#define RTE_SSI_SLAVE_DMA_RX_LEN_PER_DES 1024 + +// DMA Tx +// Channel <23=>23 +// Selects DMA Channel (only Channel 23 can be used) +// +#define RTE_SSI_SLAVE_UDMA_TX_CH 23 +#define RTE_SSI_SLAVE_DMA_TX_LEN_PER_DES 1024 + +// + +// ULP SPI Peripheral (Serial Peripheral Interface 3) [Driver_SSI_ULP_MASTER] +// Configuration settings for Driver_SSI_ULP_MASTER in component ::CMSIS Driver:SPI +#define RTE_SSI_ULP_MASTER 1 + +// Enable multiple CSN lines +#define ULP_SSI_CS0 1 +#define ULP_SSI_CS1 0 +#define ULP_SSI_CS2 0 + +// SSI_ULP_MASTER_MISO Pin <0=>Not Used <1=>ULP_GPIO_2 <2=>ULP_GPIO_9 +#ifndef ULP_SPI_MISO_LOC +#define RTE_SSI_ULP_MASTER_MISO_PORT_ID 0 +#if (RTE_SSI_ULP_MASTER_MISO_PORT_ID == 0) +#define RTE_SSI_ULP_MASTER_MISO 1 +#define RTE_SSI_ULP_MASTER_MISO_PORT 0 +#define RTE_SSI_ULP_MASTER_MISO_PIN 2 +#define RTE_SSI_ULP_MASTER_MISO_MODE 1 +#elif (RTE_SSI_ULP_MASTER_MISO_PORT_ID == 1) +#define RTE_SSI_ULP_MASTER_MISO 1 +#define RTE_SSI_ULP_MASTER_MISO_PORT 0 +#define RTE_SSI_ULP_MASTER_MISO_PIN 9 +#define RTE_SSI_ULP_MASTER_MISO_MODE 1 +#else +#error "Invalid SSI_ULP_MISO Pin Configuration!" +#endif +#else +//Pintool data +#define RTE_SSI_ULP_MASTER_MISO 1 +#define RTE_SSI_ULP_MASTER_MISO_PORT ULP_SPI_MISO__PORT +#define RTE_SSI_ULP_MASTER_MISO_PIN ULP_SPI_MISO__PIN +#define RTE_SSI_ULP_MASTER_MISO_MODE 1 +//Pintool data +#endif + +// SSI_ULP_MASTER_MOSI Pin <0=>Not Used <1=>ULP_GPIO_1 <2=>ULP_GPIO_11 +#ifndef ULP_SPI_MOSI_LOC +#define RTE_SSI_ULP_MASTER_MOSI_PORT_ID 0 +#if (RTE_SSI_ULP_MASTER_MOSI_PORT_ID == 0) +#define RTE_SSI_ULP_MASTER_MOSI 1 +#define RTE_SSI_ULP_MASTER_MOSI_PORT 0 +#define RTE_SSI_ULP_MASTER_MOSI_PIN 1 +#define RTE_SSI_ULP_MASTER_MOSI_MODE 1 +#elif (RTE_SSI_ULP_MASTER_MOSI_PORT_ID == 1) +#define RTE_SSI_ULP_MASTER_MOSI 1 +#define RTE_SSI_ULP_MASTER_MOSI_PORT 0 +#define RTE_SSI_ULP_MASTER_MOSI_PIN 11 +#define RTE_SSI_ULP_MASTER_MOSI_MODE 1 +#else +#error "Invalid SSI_ULP_MOSI Pin Configuration!" +#endif +#else +//Pintool data +#define RTE_SSI_ULP_MASTER_MOSI 1 +#define RTE_SSI_ULP_MASTER_MOSI_PORT ULP_SPI_MOSI__PORT +#define RTE_SSI_ULP_MASTER_MOSI_PIN ULP_SPI_MOSI__PIN +#define RTE_SSI_ULP_MASTER_MOSI_MODE 1 +//Pintool data +#endif + +// SSI_ULP_MASTER_SCK Pin <0=>Not Used <1=>ULP_GPIO_0 <2=>ULP_GPIO_8 +#ifndef ULP_SPI_SCK_LOC +#ifdef SLI_SI91X_MCU_CONFIG_RADIO_BOARD_BASE_VER +#define RTE_SSI_ULP_MASTER_SCK_PORT_ID 2 +#else +#define RTE_SSI_ULP_MASTER_SCK_PORT_ID 2 +#endif +#if (RTE_SSI_ULP_MASTER_SCK_PORT_ID == 0) +#define RTE_SSI_ULP_MASTER_SCK 0 +#elif (RTE_SSI_ULP_MASTER_SCK_PORT_ID == 1) +#define RTE_SSI_ULP_MASTER_SCK 1 +#define RTE_SSI_ULP_MASTER_SCK_PORT 0 +#define RTE_SSI_ULP_MASTER_SCK_PIN 0 +#define RTE_SSI_ULP_MASTER_SCK_MODE 1 +#elif (RTE_SSI_ULP_MASTER_SCK_PORT_ID == 2) +#define RTE_SSI_ULP_MASTER_SCK 1 +#define RTE_SSI_ULP_MASTER_SCK_PORT 0 +#define RTE_SSI_ULP_MASTER_SCK_PIN 8 +#define RTE_SSI_ULP_MASTER_SCK_MODE 1 +#else +#error "Invalid SSI_ULP_SCK Pin Configuration!" +#endif +#else +//Pintool data +#define RTE_SSI_ULP_MASTER_SCK 1 +#define RTE_SSI_ULP_MASTER_SCK_PORT ULP_SPI_SCK__PORT +#define RTE_SSI_ULP_MASTER_SCK_PIN ULP_SPI_SCK__PIN +#define RTE_SSI_ULP_MASTER_SCK_MODE 1 +//Pintool data +#endif + +// CS0 +#ifndef ULP_SPI_CS0_LOC +#define RTE_SSI_ULP_MASTER_CS0_PORT_ID 1 +#if (RTE_SSI_ULP_MASTER_CS0_PORT_ID == 0) +#define RTE_SSI_ULP_MASTER_CS0 ULP_SSI_CS0 +#define RTE_SSI_ULP_MASTER_CS0_PORT 0 +#define RTE_SSI_ULP_MASTER_CS0_PIN 3 +#define RTE_SSI_ULP_MASTER_CS0_MODE 1 +#elif (RTE_SSI_ULP_MASTER_CS0_PORT_ID == 1) +#define RTE_SSI_ULP_MASTER_CS0 ULP_SSI_CS0 +#define RTE_SSI_ULP_MASTER_CS0_PORT 0 +#define RTE_SSI_ULP_MASTER_CS0_PIN 10 +#define RTE_SSI_ULP_MASTER_CS0_MODE 1 +#else +#error "Change RTE_SSI_ULP_MASTER_CS_PORT_ID other than '1' or'3' as per PACKAGE_TYPE" +#endif +#else +//Pintool data +#define RTE_SSI_ULP_MASTER_CS0 ULP_SSI_CS0 +#define RTE_SSI_ULP_MASTER_CS0_PORT ULP_SPI_CS0__PORT +#define RTE_SSI_ULP_MASTER_CS0_PIN ULP_SPI_CS0__PIN +#define RTE_SSI_ULP_MASTER_CS0_MODE 1 +//Pintool data +#endif + +// CS1 +#ifndef ULP_SPI_CS1_LOC +#define RTE_SSI_ULP_MASTER_CS1_PORT 0 +#define RTE_SSI_ULP_MASTER_CS1_PIN 4 +#else +#define RTE_SSI_ULP_MASTER_CS1_PORT ULP_SPI_CS1__PORT +#define RTE_SSI_ULP_MASTER_CS1_PIN ULP_SPI_CS1__PIN +#endif +#define RTE_SSI_ULP_MASTER_CS1 ULP_SSI_CS1 +#define RTE_SSI_ULP_MASTER_CS1_MODE 1 + +// CS2 +#ifndef ULP_SPI_CS2_LOC +#define RTE_SSI_ULP_MASTER_CS2_PORT 0 +#define RTE_SSI_ULP_MASTER_CS2_PIN 6 +#else +#define RTE_SSI_ULP_MASTER_CS2_PORT ULP_SPI_CS2__PORT +#define RTE_SSI_ULP_MASTER_CS2_PIN ULP_SPI_CS2__PIN +#endif +#define RTE_SSI_ULP_MASTER_CS2 ULP_SSI_CS2 +#define RTE_SSI_ULP_MASTER_CS2_MODE 1 + +// DMA Rx +// Channel <2=>2 +// Selects DMA Channel (only Channel 2 can be used) +// +#define RTE_SSI_ULP_MASTER_UDMA_RX_CH 2 +#define RTE_SSI_ULP_MASTER_DMA_RX_LEN_PER_DES 96 + +// DMA Tx +// Channel <3=>3 +// Selects DMA Channel (only Channel 3 can be used) +// +#define RTE_SSI_ULP_MASTER_UDMA_TX_CH 3 +#define RTE_SSI_ULP_MASTER_DMA_TX_LEN_PER_DES 96 + +// +/*=================================================================== + UDMA Defines +====================================================================*/ +// UDMA [Driver_UDMA] +#define DESC_MAX_LEN 0x400 +#define RTE_UDMA0 1 +#define UDMA0_IRQHandler IRQ033_Handler +#define CHNL_MASK_REQ0 0 +#define CHNL_PRIORITY0 0 +#define DMA_PERI_ACK0 0 +#define BURST_REQ0_EN 1 +#define UDMA0_CHNL_PRIO_LVL 1 +#define UDMA0_SRAM_BASE 0x1FC00 + +#define RTE_UDMA1 1 +#define UDMA1_IRQHandler IRQ010_Handler +#define CHNL_MASK_REQ1 0 +#define CHNL_PRIORITY1 0 +#define BURST_REQ1_EN 1 +#define CHNL_HIGH_PRIO_EN1 1 +#define UDMA1_CHNL_PRIO_LVL 1 +#define ULP_SRAM_START_ADDR 0x24060000 +#define ULP_SRAM_END_ADDR 0x24063E00 +// RTE_UDMA1_BASE_MEM <0=>PS2 <1=>PS4 +#define RTE_UDMA1_BASE_MEM 0 +#if (RTE_UDMA1_BASE_MEM == 0) +#define UDMA1_SRAM_BASE 0x24061C00 +#elif (RTE_UDMA1_BASE_MEM == 1) +#define UDMA1_SRAM_BASE 0x1CC00 +#else +#error "Invalid UDMA1 Control Base Address!" +#endif +// + +// I2S0 [Driver_I2S0] +// Configuration settings for Driver_I2S0 in component ::CMSIS Driver:I2S + +#define RTE_I2S0 1 +#define I2S0_IRQHandler IRQ064_Handler +/*I2S0 PINS*/ + +// I2S0_SCLK <0=>P0_8 <1=>P0_25 <2=>P0_46 <3=>P0_52 +// SCLK of I2S0 +#ifndef I2S0_SCLK_LOC +#define RTE_I2S0_SCLK_PORT_ID 1 + +#if (RTE_I2S0_SCLK_PORT_ID == 0) +#define RTE_I2S0_SCLK_PORT 0 +#define RTE_I2S0_SCLK_PIN 8 +#define RTE_I2S0_SCLK_MUX 7 +#define RTE_I2S0_SCLK_PAD 3 +#elif (RTE_I2S0_SCLK_PORT_ID == 1) +#define RTE_I2S0_SCLK_PORT 0 +#define RTE_I2S0_SCLK_PIN 25 +#define RTE_I2S0_SCLK_MUX 7 +#define RTE_I2S0_SCLK_PAD 0 //no pad +#elif (RTE_I2S0_SCLK_PORT_ID == 2) +#define RTE_I2S0_SCLK_PORT 0 +#define RTE_I2S0_SCLK_PIN 46 +#define RTE_I2S0_SCLK_MUX 7 +#define RTE_I2S0_SCLK_PAD 10 +#elif (RTE_I2S0_SCLK_PORT_ID == 3) +#define RTE_I2S0_SCLK_PORT 0 +#define RTE_I2S0_SCLK_PIN 52 +#define RTE_I2S0_SCLK_MUX 7 +#define RTE_I2S0_SCLK_PAD 16 +#else +#error "Invalid I2S0 RTE_I2S0_SCLK Pin Configuration!" +#endif +#else +//Pintool data +#define RTE_I2S0_SCLK_PORT I2S0_SCLK_PORT +#define RTE_I2S0_SCLK_PIN I2S0_SCLK_PIN +#define RTE_I2S0_SCLK_MUX 7 +#if (I2S0_SCLK_LOC == 0) +#define RTE_I2S0_SCLK_PAD 3 +#endif +#if (I2S0_SCLK_LOC == 1) +#define RTE_I2S0_SCLK_PAD 0 //no pad +#endif +#if (I2S0_SCLK_LOC == 2) +#define RTE_I2S0_SCLK_PAD 10 +#endif +#if (I2S0_SCLK_LOC == 3) +#define RTE_I2S0_SCLK_PAD 16 +#endif +//Pintool data +#endif + +// I2S0_WSCLK <0=>P0_9 <1=>P0_26 <2=>P0_47 <3=>P0_53 +// WSCLK for I2S0 +#ifndef I2S0_WSCLK_LOC +#define RTE_I2S0_WSCLK_PORT_ID 1 + +#if (RTE_I2S0_WSCLK_PORT_ID == 0) +#define RTE_I2S0_WSCLK_PORT 0 +#define RTE_I2S0_WSCLK_PIN 9 +#define RTE_I2S0_WSCLK_MUX 7 +#define RTE_I2S0_WSCLK_PAD 4 +#elif (RTE_I2S0_WSCLK_PORT_ID == 1) +#define RTE_I2S0_WSCLK_PORT 0 +#define RTE_I2S0_WSCLK_PIN 26 +#define RTE_I2S0_WSCLK_MUX 7 +#define RTE_I2S0_WSCLK_PAD 0 //no pad +#elif (RTE_I2S0_WSCLK_PORT_ID == 2) +#define RTE_I2S0_WSCLK_PORT 0 +#define RTE_I2S0_WSCLK_PIN 47 +#define RTE_I2S0_WSCLK_MUX 7 +#define RTE_I2S0_WSCLK_PAD 11 +#elif (RTE_I2S0_WSCLK_PORT_ID == 3) +#define RTE_I2S0_WSCLK_PORT 0 +#define RTE_I2S0_WSCLK_PIN 53 +#define RTE_I2S0_WSCLK_MUX 7 +#define RTE_I2S0_WSCLK_PAD 17 +#else +#error "Invalid I2S0 RTE_I2S0_WSCLK Pin Configuration!" +#endif +#else +//Pintool data +#define RTE_I2S0_WSCLK_PORT I2S0_WSCLK_PORT +#define RTE_I2S0_WSCLK_PIN I2S0_WSCLK_PIN +#define RTE_I2S0_WSCLK_MUX 7 +#if (I2S0_WSCLK_LOC == 4) +#define RTE_I2S0_WSCLK_PAD 4 +#endif +#if (I2S0_WSCLK_LOC == 5) +#define RTE_I2S0_WSCLK_PAD 0 +#endif +#if (I2S0_WSCLK_LOC == 6) +#define RTE_I2S0_WSCLK_PAD 11 +#endif +#if (I2S0_WSCLK_LOC == 7) +#define RTE_I2S0_WSCLK_PAD 17 +#endif +//Pintool data +#endif + +// I2S0_DOUT0 <0=>P0_11 <1=>P0_28 <2=>P0_49 <3=>P0_57 +// DOUT0 for I2S0 +#ifndef I2S0_DOUT0_LOC +#define RTE_I2S0_DOUT0_PORT_ID 1 + +#if (RTE_I2S0_DOUT0_PORT_ID == 0) +#define RTE_I2S0_DOUT0_PORT 0 +#define RTE_I2S0_DOUT0_PIN 11 +#define RTE_I2S0_DOUT0_MUX 7 +#define RTE_I2S0_DOUT0_PAD 6 +#elif (RTE_I2S0_DOUT0_PORT_ID == 1) +#define RTE_I2S0_DOUT0_PORT 0 +#define RTE_I2S0_DOUT0_PIN 28 +#define RTE_I2S0_DOUT0_MUX 7 +#define RTE_I2S0_DOUT0_PAD 0 // no pad +#elif (RTE_I2S0_DOUT0_PORT_ID == 2) +#define RTE_I2S0_DOUT0_PORT 0 +#define RTE_I2S0_DOUT0_PIN 49 +#define RTE_I2S0_DOUT0_MUX 7 +#define RTE_I2S0_DOUT0_PAD 13 +#elif (RTE_I2S0_DOUT0_PORT_ID == 3) +#define RTE_I2S0_DOUT0_PORT 0 +#define RTE_I2S0_DOUT0_PIN 57 +#define RTE_I2S0_DOUT0_MUX 7 +#define RTE_I2S0_DOUT0_PAD 21 +#else +#error "Invalid I2S0 RTE_I2S0_DOUT0 Pin Configuration!" +#endif +#else +//Pintool data +#define RTE_I2S0_DOUT0_PORT I2S0_DOUT0_PORT +#define RTE_I2S0_DOUT0_PIN I2S0_DOUT0_PIN +#define RTE_I2S0_DOUT0_MUX 7 +#if (I2S0_DOUT0_LOC == 8) +#define RTE_I2S0_DOUT0_PAD 6 +#endif +#if (I2S0_DOUT0_LOC == 9) +#define RTE_I2S0_DOUT0_PAD 0 +#endif +#if (I2S0_DOUT0_LOC == 10) +#define RTE_I2S0_DOUT0_PAD 13 +#endif +#if (I2S0_DOUT0_LOC == 11) +#define RTE_I2S0_DOUT0_PAD 21 +#endif +//Pintool data +#endif + +// I2S0_DIN0 <0=>P0_10 <1=>P0_27 <2=>P0_48 <3=>P0_56 +// DIN0 for I2S0 +#ifndef I2S0_DIN0_LOC +#define RTE_I2S0_DIN0_PORT_ID 1 + +#if (RTE_I2S0_DIN0_PORT_ID == 0) +#define RTE_I2S0_DIN0_PORT 0 +#define RTE_I2S0_DIN0_PIN 10 +#define RTE_I2S0_DIN0_MUX 7 +#define RTE_I2S0_DIN0_PAD 5 +#elif (RTE_I2S0_DIN0_PORT_ID == 1) +#define RTE_I2S0_DIN0_PORT 0 +#define RTE_I2S0_DIN0_PIN 27 +#define RTE_I2S0_DIN0_MUX 7 +#define RTE_I2S0_DIN0_PAD 0 // no pad +#elif (RTE_I2S0_DIN0_PORT_ID == 2) +#define RTE_I2S0_DIN0_PORT 0 +#define RTE_I2S0_DIN0_PIN 48 +#define RTE_I2S0_DIN0_MUX 7 +#define RTE_I2S0_DIN0_PAD 12 +#elif (RTE_I2S0_DIN0_PORT_ID == 3) +#define RTE_I2S0_DIN0_PORT 0 +#define RTE_I2S0_DIN0_PIN 56 +#define RTE_I2S0_DIN0_MUX 7 +#define RTE_I2S0_DIN0_PAD 20 +#else +#error "Invalid I2S0 RTE_I2S0_DIN0 Pin Configuration!" +#endif +#else +//Pintool data +#define RTE_I2S0_DIN0_PORT I2S0_DIN0_PORT +#define RTE_I2S0_DIN0_PIN I2S0_DIN0_PIN +#define RTE_I2S0_DIN0_MUX 7 +#if (I2S0_DIN0_LOC == 12) +#define RTE_I2S0_DIN0_PAD 5 +#endif +#if (I2S0_DIN0_LOC == 13) +#define RTE_I2S0_DIN0_PAD 0 +#endif +#if (I2S0_DIN0_LOC == 14) +#define RTE_I2S0_DIN0_PAD 12 +#endif +#if (I2S0_DIN0_LOC == 15) +#define RTE_I2S0_DIN0_PAD 20 +#endif +//Pintool data +#endif + +// I2S0_DOUT1 <0=>P0_7 <1=>P0_30 <2=>P0_51 <3=>P0_55 +// DOUT1 for I2S0 +#ifndef I2S0_DOUT1_LOC +#ifdef SLI_SI91X_MCU_CONFIG_RADIO_BOARD_BASE_VER +#define RTE_I2S0_DOUT1_PORT_ID 1 +#else +#define RTE_I2S0_DOUT1_PORT_ID 0 +#endif + +#if (RTE_I2S0_DOUT1_PORT_ID == 0) +#define RTE_I2S0_DOUT1_PORT 0 +#define RTE_I2S0_DOUT1_PIN 7 +#define RTE_I2S0_DOUT1_MUX 7 +#define RTE_I2S0_DOUT1_PAD 2 +#elif (RTE_I2S0_DOUT1_PORT_ID == 1) +#define RTE_I2S0_DOUT1_PORT 0 +#define RTE_I2S0_DOUT1_PIN 30 +#define RTE_I2S0_DOUT1_MUX 7 +#define RTE_I2S0_DOUT1_PAD 0 //no pad +#elif (RTE_I2S0_DOUT1_PORT_ID == 2) +#define RTE_I2S0_DOUT1_PORT 0 +#define RTE_I2S0_DOUT1_PIN 51 +#define RTE_I2S0_DOUT1_MUX 7 +#define RTE_I2S0_DOUT1_PAD 15 +#elif (RTE_I2S0_DOUT1_PORT_ID == 3) +#define RTE_I2S0_DOUT1_PORT 0 +#define RTE_I2S0_DOUT1_PIN 55 +#define RTE_I2S0_DOUT1_MUX 7 +#define RTE_I2S0_DOUT1_PAD 19 +#else +#error "Invalid I2S0 RTE_I2S0_DOUT1 Pin Configuration!" +#endif +#else +//Pintool data +#define RTE_I2S0_DOUT1_PORT I2S0_DOUT1_PORT +#define RTE_I2S0_DOUT1_PIN I2S0_DOUT1_PIN +#define RTE_I2S0_DOUT1_MUX 7 +#if (I2S0_DOUT1_LOC == 16) +#define RTE_I2S0_DOUT1_PAD 2 +#endif +#if (I2S0_DOUT1_LOC == 17) +#define RTE_I2S0_DOUT1_PAD 0 +#endif +#if (I2S0_DOUT1_LOC == 18) +#define RTE_I2S0_DOUT1_PAD 15 +#endif +#if (I2S0_DOUT1_LOC == 19) +#define RTE_I2S0_DOUT1_PAD 19 +#endif +//Pintool data +#endif + +// I2S0_DIN1 <0=>P0_6 <1=>P0_29 <2=>P0_50 <3=>P0_54 +// DIN1 for I2S0 +#ifndef I2S0_DIN1_LOC +#define RTE_I2S0_DIN1_PORT_ID 0 + +#if (RTE_I2S0_DIN1_PORT_ID == 0) +#define RTE_I2S0_DIN1_PORT 0 +#define RTE_I2S0_DIN1_PIN 6 +#define RTE_I2S0_DIN1_MUX 7 +#define RTE_I2S0_DIN1_PAD 1 +#elif (RTE_I2S0_DIN1_PORT_ID == 1) +#define RTE_I2S0_DIN1_PORT 0 +#define RTE_I2S0_DIN1_PIN 29 +#define RTE_I2S0_DIN1_MUX 7 +#define RTE_I2S0_DIN1_PAD 0 //no pad +#elif (RTE_I2S0_DIN1_PORT_ID == 2) +#define RTE_I2S0_DIN1_PORT 0 +#define RTE_I2S0_DIN1_PIN 50 +#define RTE_I2S0_DIN1_MUX 7 +#define RTE_I2S0_DIN1_PAD 14 +#elif (RTE_I2S0_DIN1_PORT_ID == 3) +#define RTE_I2S0_DIN1_PORT 0 +#define RTE_I2S0_DIN1_PIN 54 +#define RTE_I2S0_DIN1_MUX 7 +#define RTE_I2S0_DIN1_PAD 18 +#else +#error "Invalid I2S0 RTE_I2S0_DIN1 Pin Configuration!" +#endif +#else +//Pintool data +#define RTE_I2S0_DIN1_PORT I2S0_DIN1_PORT +#define RTE_I2S0_DIN1_PIN I2S0_DIN1_PIN +#define RTE_I2S0_DIN1_MUX 7 +#if (I2S0_DIN1_LOC == 20) +#define RTE_I2S0_DIN1_PAD 1 +#endif +#if (I2S0_DIN1_LOC == 21) +#define RTE_I2S0_DIN1_PAD 0 +#endif +#if (I2S0_DIN1_LOC == 22) +#define RTE_I2S0_DIN1_PAD 14 +#endif +#if (I2S0_DIN1_LOC == 23) +#define RTE_I2S0_DIN1_PAD 18 +#endif +//Pintool data +#endif +// FIFO level can have value 0 to 7 +#define I2S0_TX_FIFO_LEVEL (0U) +#define I2S0_RX_FIFO_LEVEL (2U) + +// I2S0_TX_RES <0=>12 +// <1=>16 +// <2=>20 +// <3=>24 +#define RTE_I2S0_TX_RES 1 +#if (RTE_I2S0_TX_RES == 0) +#define I2S0_TX_RES RES_12_BIT +#elif (RTE_I2S0_TX_RES == 1) +#define I2S0_TX_RES RES_16_BIT +#elif (RTE_I2S0_TX_RES == 2) +#define I2S0_TX_RES RES_20_BIT +#elif (RTE_I2S0_TX_RES == 3) +#define I2S0_TX_RES RES_24_BIT +#else +#error "Invalid I2S0 TX channel resolution!" +#endif + +// I2S0_RX_RES <0=>12 +// <1=>16 +// <2=>20 +// <3=>24 +#define RTE_I2S0_RX_RES 1 +#if (RTE_I2S0_RX_RES == 0) +#define I2S0_RX_RES RES_12_BIT +#elif (RTE_I2S0_RX_RES == 1) +#define I2S0_RX_RES RES_16_BIT +#elif (RTE_I2S0_RX_RES == 2) +#define I2S0_RX_RES RES_20_BIT +#elif (RTE_I2S0_RX_RES == 3) +#define I2S0_RX_RES RES_24_BIT +#else +#error "Invalid I2S0 RX channel resolution!" +#endif + +#define RTE_I2S0_CHNL_UDMA_TX_EN 1 +#define RTE_I2S0_CHNL_UDMA_TX_CH 15 + +#define RTE_I2S0_CHNL_UDMA_RX_EN 1 +#define RTE_I2S0_CHNL_UDMA_RX_CH 14 + +#define RTE_I2S0_DMA_TX_LEN_PER_DES 1024 +#define RTE_I2S0_DMA_RX_LEN_PER_DES 1024 + +// + +// ULP I2S [Driver_I2S1] +// Configuration settings for Driver_I2S1 in component ::Drivers:I2S +#define RTE_I2S1 1 +#define I2S1_IRQHandler IRQ014_Handler + +// I2S1_SCLK Pin <0=>P0_3 <1=>P0_7 <2=>P0_8 +/*I2S1 PINS*/ +#ifndef ULP_I2S_SCLK_LOC +#ifdef SLI_SI91X_MCU_CONFIG_RADIO_BOARD_BASE_VER +#define RTE_I2S1_SCLK_PORT_ID 0 +#else +#define RTE_I2S1_SCLK_PORT_ID 2 +#endif +#if (RTE_I2S1_SCLK_PORT_ID == 0) +#define RTE_I2S1_SCLK_PORT 0 +#define RTE_I2S1_SCLK_PIN 3 +#define RTE_I2S1_SCLK_MUX 2 +#elif (RTE_I2S1_SCLK_PORT_ID == 1) +#define RTE_I2S1_SCLK_PORT 0 +#define RTE_I2S1_SCLK_PIN 7 +#define RTE_I2S1_SCLK_MUX 2 +#elif (RTE_I2S1_SCLK_PORT_ID == 2) +#define RTE_I2S1_SCLK_PORT 0 +#define RTE_I2S1_SCLK_PIN 8 +#define RTE_I2S1_SCLK_MUX 2 +#else +#error "Invalid I2S1 RTE_I2S1_SCLK Pin Configuration!" +#endif +#else +//Pintool data +#define RTE_I2S1_SCLK_PORT ULP_I2S_SCLK_PORT +#define RTE_I2S1_SCLK_PIN ULP_I2S_SCLK_PIN +#define RTE_I2S1_SCLK_MUX 2 +//Pintool data +#endif + +// I2S1_WSCLK Pin <0=>P0_2 <1=>P0_4 <2=>P0_10 +#ifndef ULP_I2S_WSCLK_LOC +#define RTE_I2S1_WSCLK_PORT_ID 0 +#if (RTE_I2S1_WSCLK_PORT_ID == 0) +#define RTE_I2S1_WSCLK_PORT 0 +#define RTE_I2S1_WSCLK_PIN 2 +#define RTE_I2S1_WSCLK_MUX 2 +#elif (RTE_I2S1_WSCLK_PORT_ID == 1) +#define RTE_I2S1_WSCLK_PORT 0 +#define RTE_I2S1_WSCLK_PIN 10 +#define RTE_I2S1_WSCLK_MUX 2 +#else +#error "Invalid I2S1 RTE_I2S1_WSCLK Pin Configuration!" +#endif +#else +//Pintool data +#define RTE_I2S1_WSCLK_PORT ULP_I2S_WSCLK_PORT +#define RTE_I2S1_WSCLK_PIN ULP_I2S_WSCLK_PIN +#define RTE_I2S1_WSCLK_MUX 2 +//Pintool data +#endif + +// I2S1_DOUT0 Pin <0=>P0_1 <1=>P0_5 <2=>P0_11 +#ifndef ULP_I2S_DOUT0_LOC +#define RTE_I2S1_DOUT0_PORT_ID 0 +#if (RTE_I2S1_DOUT0_PORT_ID == 0) +#define RTE_I2S1_DOUT0_PORT 0 +#define RTE_I2S1_DOUT0_PIN 1 +#define RTE_I2S1_DOUT0_MUX 2 +#elif (RTE_I2S1_DOUT0_PORT_ID == 1) +#define RTE_I2S1_DOUT0_PORT 0 +#define RTE_I2S1_DOUT0_PIN 11 +#define RTE_I2S1_DOUT0_MUX 2 +#else +#error "Invalid I2S1 RTE_I2S1_DOUT0 Pin Configuration!" +#endif +#else +//Pintool data +#define RTE_I2S1_DOUT0_PORT ULP_I2S_DOUT0_PORT +#define RTE_I2S1_DOUT0_PIN ULP_I2S_DOUT0_PIN +#define RTE_I2S1_DOUT0_MUX 2 +//Pintool data +#endif + +// I2S1_DIN0 Pin <0=>P0_0 <1=>P0_6 <2=>P0_9 <3=>P0_13 +#ifndef ULP_I2S_DIN0_LOC +#define RTE_I2S1_DIN0_PORT_ID 1 +#if (RTE_I2S1_DIN0_PORT_ID == 0) +#define RTE_I2S1_DIN0_PORT 0 +#define RTE_I2S1_DIN0_PIN 0 +#define RTE_I2S1_DIN0_MUX 2 +#elif (RTE_I2S1_DIN0_PORT_ID == 1) +#define RTE_I2S1_DIN0_PORT 0 +#define RTE_I2S1_DIN0_PIN 6 +#define RTE_I2S1_DIN0_MUX 2 +#elif (RTE_I2S1_DIN0_PORT_ID == 2) +#define RTE_I2S1_DIN0_PORT 0 +#define RTE_I2S1_DIN0_PIN 9 +#define RTE_I2S1_DIN0_MUX 2 +#else +#error "Invalid I2S1 RTE_I2S1_DIN0 Pin Configuration!" +#endif +#else +//Pintool data +#define RTE_I2S1_DIN0_PORT ULP_I2S_DIN0_PORT +#define RTE_I2S1_DIN0_PIN ULP_I2S_DIN0_PIN +#define RTE_I2S1_DIN0_MUX 2 +//Pintool data +#endif + +// FIFO level can have value 0 to 7 +#define I2S1_TX_FIFO_LEVEL (0U) +#define I2S1_RX_FIFO_LEVEL (2U) + +// I2S1_TX_RES <0=>12 +// <1=>16 +// <2=>20 +// <3=>24 +#define RTE_I2S1_TX_RES 1 +#if (RTE_I2S1_TX_RES == 0) +#define I2S1_TX_RES RES_12_BIT +#elif (RTE_I2S1_TX_RES == 1) +#define I2S1_TX_RES RES_16_BIT +#elif (RTE_I2S1_TX_RES == 2) +#define I2S1_TX_RES RES_20_BIT +#elif (RTE_I2S1_TX_RES == 3) +#define I2S1_TX_RES RES_24_BIT +#else +#error "Invalid I2S1 TX channel resolution!" +#endif + +// I2S1_RX_RES <0=>12 +// <1=>16 +// <2=>20 +// <3=>24 +#define RTE_I2S1_RX_RES 1 +#if (RTE_I2S1_RX_RES == 0) +#define I2S1_RX_RES RES_12_BIT +#elif (RTE_I2S1_RX_RES == 1) +#define I2S1_RX_RES RES_16_BIT +#elif (RTE_I2S1_RX_RES == 2) +#define I2S1_RX_RES RES_20_BIT +#elif (RTE_I2S1_RX_RES == 3) +#define I2S1_RX_RES RES_24_BIT +#else +#error "Invalid I2S1 RX channel resolution!" +#endif + +#define RTE_I2S1_CHNL_UDMA_TX_EN 1 +#define RTE_I2S1_CHNL_UDMA_TX_CH 7 + +#define RTE_I2S1_CHNL_UDMA_RX_EN 1 +#define RTE_I2S1_CHNL_UDMA_RX_CH 6 + +#define RTE_I2S1_DMA_TX_LEN_PER_DES 1024 +#define RTE_I2S1_DMA_RX_LEN_PER_DES 1024 + +// I2S1 [Driver_I2S1] + +// I2C0 (Inter-integrated Circuit Interface 0) [Driver_I2C0] +// Configuration settings for Driver_I2C0 in component ::Drivers:I2C + +#define RTE_I2C0 1 +#define I2C0_IRQHandler IRQ042_Handler + +// I2C0_SCL Pin <0=>P0_7 <1=>P0_65 <2=>P0_66 <3=>P0_75 <4=>P0_32 +#ifndef I2C0_SCL_LOC +#define RTE_I2C0_SCL_PORT_ID 1 + +#if (RTE_I2C0_SCL_PORT_ID == 0) +#define RTE_I2C0_SCL_PORT 0 +#define RTE_I2C0_SCL_PIN 7 +#define RTE_I2C0_SCL_MUX 4 +#define RTE_I2C0_SCL_PAD 2 +#define RTE_I2C0_SCL_I2C_REN 7 +#elif (RTE_I2C0_SCL_PORT_ID == 1) +#define RTE_I2C0_SCL_PORT 0 +#define RTE_I2C0_SCL_PIN 65 +#define RTE_I2C0_SCL_MUX 4 +#define RTE_I2C0_SCL_PAD 23 +#define RTE_I2C0_SCL_I2C_REN 1 +#elif (RTE_I2C0_SCL_PORT_ID == 2) +#define RTE_I2C0_SCL_PORT 0 +#define RTE_I2C0_SCL_PIN 66 +#define RTE_I2C0_SCL_MUX 4 +#define RTE_I2C0_SCL_PAD 24 +#define RTE_I2C0_SCL_I2C_REN 2 +#elif (RTE_I2C0_SCL_PORT_ID == 3) +#define RTE_I2C0_SCL_PORT 0 +#define RTE_I2C0_SCL_PIN 75 +#define RTE_I2C0_SCL_MUX 4 +#define RTE_I2C0_SCL_PAD 33 +#define RTE_I2C0_SCL_I2C_REN 11 +#else +#error "Invalid I2C0 RTE_I2C0_SCL Pin Configuration!" +#endif +#else +//Pintool data +#define RTE_I2C0_SCL_PORT I2C0_SCL_PORT +#if (I2C0_SCL_LOC == 0) +#define RTE_I2C0_SCL_PIN I2C0_SCL_PIN +#define RTE_I2C0_SCL_MUX 4 +#define RTE_I2C0_SCL_PAD 2 +#define RTE_I2C0_SCL_I2C_REN 7 +#endif +#if (I2C0_SCL_LOC == 1) +#define RTE_I2C0_SCL_PIN (I2C0_SCL_PIN + GPIO_MAX_PIN) +#define RTE_I2C0_SCL_MUX 4 +#define RTE_I2C0_SCL_PAD 23 +#define RTE_I2C0_SCL_I2C_REN 1 +#endif +#if (I2C0_SCL_LOC == 2) +#define RTE_I2C0_SCL_PIN (I2C0_SCL_PIN + GPIO_MAX_PIN) +#define RTE_I2C0_SCL_MUX 4 +#define RTE_I2C0_SCL_PAD 33 +#define RTE_I2C0_SCL_I2C_REN 11 +#endif +//Pintool data +#endif + +// I2C0_SCL Pin <0=>P0_6 <1=>P0_64 <2=>P0_67 <3=>P0_74 <4=>P0_31 +#ifndef I2C0_SDA_LOC +#ifdef SLI_SI91X_MCU_CONFIG_RADIO_BOARD_BASE_VER +#define RTE_I2C0_SDA_PORT_ID 2 +#else +#define RTE_I2C0_SDA_PORT_ID 0 +#endif + +#if (RTE_I2C0_SDA_PORT_ID == 0) +#define RTE_I2C0_SDA_PORT 0 +#define RTE_I2C0_SDA_PIN 6 +#define RTE_I2C0_SDA_MUX 4 +#define RTE_I2C0_SDA_PAD 1 +#define RTE_I2C0_SDA_I2C_REN 6 +#elif (RTE_I2C0_SDA_PORT_ID == 1) +#define RTE_I2C0_SDA_PORT 0 +#define RTE_I2C0_SDA_PIN 67 +#define RTE_I2C0_SDA_MUX 4 +#define RTE_I2C0_SDA_PAD 25 +#define RTE_I2C0_SDA_I2C_REN 3 +#elif (RTE_I2C0_SDA_PORT_ID == 2) +#define RTE_I2C0_SDA_PORT 0 +#define RTE_I2C0_SDA_PIN 74 +#define RTE_I2C0_SDA_MUX 4 +#define RTE_I2C0_SDA_PAD 32 +#define RTE_I2C0_SDA_I2C_REN 10 +#else +#error "Invalid I2C0 RTE_I2C0_SDA Pin Configuration!" +#endif +#else +//Pintool data +#define RTE_I2C0_SDA_PORT I2C0_SDA_PORT +#if (I2C0_SDA_LOC == 3) +#define RTE_I2C0_SDA_PIN I2C0_SDA_PIN +#define RTE_I2C0_SDA_MUX 4 +#define RTE_I2C0_SDA_PAD 1 +#define RTE_I2C0_SDA_I2C_REN 6 +#endif +#if (I2C0_SDA_LOC == 4) +#define RTE_I2C0_SDA_PIN (I2C0_SDA_PIN + GPIO_MAX_PIN) +#define RTE_I2C0_SDA_MUX 4 +#define RTE_I2C0_SDA_PAD 22 +#define RTE_I2C0_SDA_I2C_REN 3 +#endif +#if (I2C0_SDA_LOC == 5) +#define RTE_I2C0_SDA_PIN (I2C0_SDA_PIN + GPIO_MAX_PIN) +#define RTE_I2C0_SDA_MUX 4 +#define RTE_I2C0_SDA_PAD 32 +#define RTE_I2C0_SDA_I2C_REN 10 +#endif +//Pintool data +#endif + +#define IC_SCL_STUCK_TIMEOUT 20 +#define IC_SDA_STUCK_TIMEOUT 20 + +#define I2C_DMA 0 +#if (I2C_DMA == 1) +#define DMA_TX_TL 1 +#define DMA_RX_TL 1 +#endif +// I2C1 [Driver_I2C0] + +// I2C1 (Inter-integrated Circuit Interface 1) [Driver_I2C1] +// Configuration settings for Driver_I2C1 in component ::Drivers:I2C + +#define RTE_I2C1 1 +#define I2C1_IRQHandler IRQ061_Handler +// I2C1_SCL Pin <0=>P0_6 <1=>P0_29 <2=>P0_50 <3=>P0_54 <4=>P0_64 <4=>P0_66 <4=>P0_70 <7=>P0_33 +#ifndef I2C1_SCL_LOC +#define RTE_I2C1_SCL_PORT_ID 2 + +#if (RTE_I2C1_SCL_PORT_ID == 0) +#define RTE_I2C1_SCL_PORT 0 +#define RTE_I2C1_SCL_PIN 6 +#define RTE_I2C1_SCL_MUX 5 +#define RTE_I2C1_SCL_PAD 1 +#define RTE_I2C1_SCL_REN 6 +#elif (RTE_I2C1_SCL_PORT_ID == 1) +#define RTE_I2C1_SCL_PORT 0 +#define RTE_I2C1_SCL_PIN 29 +#define RTE_I2C1_SCL_MUX 5 +#define RTE_I2C1_SCL_PAD 0 //no pad +#define RTE_I2C1_SCL_REN 29 +#elif (RTE_I2C1_SCL_PORT_ID == 2) +#define RTE_I2C1_SCL_PORT 0 +#define RTE_I2C1_SCL_PIN 50 +#define RTE_I2C1_SCL_MUX 5 +#define RTE_I2C1_SCL_PAD 14 +#define RTE_I2C1_SCL_REN 50 +#elif (RTE_I2C1_SCL_PORT_ID == 3) +#define RTE_I2C1_SCL_PORT 0 +#define RTE_I2C1_SCL_PIN 54 +#define RTE_I2C1_SCL_MUX 5 +#define RTE_I2C1_SCL_PAD 18 +#define RTE_I2C1_SCL_REN 54 +#elif (RTE_I2C1_SCL_PORT_ID == 5) +#define RTE_I2C1_SCL_PORT 0 +#define RTE_I2C1_SCL_PIN 66 +#define RTE_I2C1_SCL_MUX 5 +#define RTE_I2C1_SCL_PAD 24 +#define RTE_I2C1_SCL_REN 2 +#elif (RTE_I2C1_SCL_PORT_ID == 6) +#define RTE_I2C1_SCL_PORT 0 +#define RTE_I2C1_SCL_PIN 70 +#define RTE_I2C1_SCL_MUX 5 +#define RTE_I2C1_SCL_PAD 29 +#define RTE_I2C1_SCL_REN 6 +#else +#error "Invalid I2C1_SCL Pin Configuration!" +#endif +#else +//Pintool data +#define RTE_I2C1_SCL_PORT I2C1_SCL_PORT +#if (I2C1_SCL_LOC == 0) +#define RTE_I2C1_SCL_PIN I2C1_SCL_PIN +#define RTE_I2C1_SCL_MUX 5 +#define RTE_I2C1_SCL_PAD 1 +#define RTE_I2C1_SCL_REN 6 +#endif +#if (I2C1_SCL_LOC == 1) +#define RTE_I2C1_SCL_PIN I2C1_SCL_PIN +#define RTE_I2C1_SCL_MUX 5 +#define RTE_I2C1_SCL_PAD 0 //no pad +#define RTE_I2C1_SCL_REN 29 +#endif +#if (I2C1_SCL_LOC == 2) +#define RTE_I2C1_SCL_PIN I2C1_SCL_PIN +#define RTE_I2C1_SCL_MUX 5 +#define RTE_I2C1_SCL_PAD 14 +#define RTE_I2C1_SCL_REN 50 +#endif +#if (I2C1_SCL_LOC == 3) +#define RTE_I2C1_SCL_PIN I2C1_SCL_PIN +#define RTE_I2C1_SCL_MUX 5 +#define RTE_I2C1_SCL_PAD 18 +#define RTE_I2C1_SCL_REN 54 +#endif +#if (I2C1_SCL_LOC == 4) +#define RTE_I2C1_SCL_PIN (I2C1_SCL_PIN + GPIO_MAX_PIN) +#define RTE_I2C1_SCL_MUX 5 +#define RTE_I2C1_SCL_PAD 22 +#define RTE_I2C1_SCL_REN 2 +#endif +#if (I2C1_SCL_LOC == 5) +#define RTE_I2C1_SCL_PIN (I2C1_SCL_PIN + GPIO_MAX_PIN) +#define RTE_I2C1_SCL_MUX 5 +#define RTE_I2C1_SCL_PAD 29 +#define RTE_I2C1_SCL_REN 6 +#endif +//Pintool data +#endif + +// I2C1_SCL Pin <0=>P0_7 <1=>P0_30 <2=>P0_51 <3=>P0_55 <4=>P0_65 <4=>P0_67 <4=>P0_71 <7=>P0_34 +#ifndef I2C1_SDA_LOC +#define RTE_I2C1_SDA_PORT_ID 2 + +#if (RTE_I2C1_SDA_PORT_ID == 0) +#define RTE_I2C1_SDA_PORT 0 +#define RTE_I2C1_SDA_PIN 7 +#define RTE_I2C1_SDA_MUX 5 +#define RTE_I2C1_SDA_PAD 2 +#define RTE_I2C1_SDA_REN 7 +#elif (RTE_I2C1_SDA_PORT_ID == 1) +#define RTE_I2C1_SDA_PORT 0 +#define RTE_I2C1_SDA_PIN 30 +#define RTE_I2C1_SDA_MUX 5 +#define RTE_I2C1_SDA_PAD 0 //no pad +#define RTE_I2C1_SDA_REN 30 +#elif (RTE_I2C1_SDA_PORT_ID == 2) +#define RTE_I2C1_SDA_PORT 0 +#define RTE_I2C1_SDA_PIN 51 +#define RTE_I2C1_SDA_MUX 5 +#define RTE_I2C1_SDA_PAD 15 +#define RTE_I2C1_SDA_REN 51 +#elif (RTE_I2C1_SDA_PORT_ID == 3) +#define RTE_I2C1_SDA_PORT 0 +#define RTE_I2C1_SDA_PIN 55 +#define RTE_I2C1_SDA_MUX 5 +#define RTE_I2C1_SDA_PAD 19 +#define RTE_I2C1_SDA_REN 55 +#elif (RTE_I2C1_SDA_PORT_ID == 4) +#define RTE_I2C1_SDA_PORT 0 +#define RTE_I2C1_SDA_PIN 65 +#define RTE_I2C1_SDA_MUX 5 +#define RTE_I2C1_SDA_PAD 23 +#define RTE_I2C1_SDA_REN 1 +#elif (RTE_I2C1_SDA_PORT_ID == 5) +#define RTE_I2C1_SDA_PORT 0 +#define RTE_I2C1_SDA_PIN 67 +#define RTE_I2C1_SDA_MUX 5 +#define RTE_I2C1_SDA_PAD 25 +#define RTE_I2C1_SDA_REN 3 +#elif (RTE_I2C1_SDA_PORT_ID == 6) +#define RTE_I2C1_SDA_PORT 0 +#define RTE_I2C1_SDA_PIN 71 +#define RTE_I2C1_SDA_MUX 5 +#define RTE_I2C1_SDA_PAD 29 +#define RTE_I2C1_SDA_REN 7 +#else +#error "Invalid I2C1_SDA Pin Configuration!" +#endif +#else +//Pintool data +#define RTE_I2C1_SDA_PORT I2C1_SDA_PORT +#if (I2C1_SDA_LOC == 6) +#define RTE_I2C1_SDA_PIN I2C1_SDA_PIN +#define RTE_I2C1_SDA_MUX 5 +#define RTE_I2C1_SDA_PAD 2 +#define RTE_I2C1_SDA_REN 7 +#endif +#if (I2C1_SDA_LOC == 7) +#define RTE_I2C1_SDA_PIN I2C1_SDA_PIN +#define RTE_I2C1_SDA_MUX 5 +#define RTE_I2C1_SDA_PAD 0 //no pad +#define RTE_I2C1_SDA_REN 30 +#endif +#if (I2C1_SDA_LOC == 8) +#define RTE_I2C1_SDA_PIN I2C1_SDA_PIN +#define RTE_I2C1_SDA_MUX 5 +#define RTE_I2C1_SDA_PAD 15 +#define RTE_I2C1_SDA_REN 51 +#endif +#if (I2C1_SDA_LOC == 9) +#define RTE_I2C1_SDA_PIN I2C1_SDA_PIN +#define RTE_I2C1_SDA_MUX 5 +#define RTE_I2C1_SDA_PAD 19 +#define RTE_I2C1_SDA_REN 55 +#endif +#if (I2C1_SDA_LOC == 10) +#define RTE_I2C1_SDA_PIN (I2C1_SDA_PIN + GPIO_MAX_PIN) +#define RTE_I2C1_SDA_MUX 5 +#define RTE_I2C1_SDA_PAD 23 +#define RTE_I2C1_SDA_REN 1 +#endif +#if (I2C1_SDA_LOC == 11) +#define RTE_I2C1_SDA_PIN (I2C1_SDA_PIN + GPIO_MAX_PIN) +#define RTE_I2C1_SDA_MUX 5 +#define RTE_I2C1_SDA_PAD 29 +#define RTE_I2C1_SDA_REN 7 +#endif +//Pintool data +#endif + +#define IC_SCL_STUCK_TIMEOUT 20 +#define IC_SDA_STUCK_TIMEOUT 20 + +#define DMA_EN 0 +#if (DMA_EN == 1) +#define DMA_TX_TL 1 +#define DMA_RX_TL 1 +#endif + +// I2C1 [Driver_I2C1] + +// ULP I2C (Inter-integrated Circuit Interface 2) [Driver_I2C2] +// Configuration settings for Driver_I2C2 in component ::Drivers:I2C +#define RTE_I2C2 1 +#define I2C2_IRQHandler IRQ013_Handler + +// I2C2_SCL Pin <0=>P0_1 <1=>P0_5 <2=>P0_7 <3=>P0_8 <4=>P0_13 +#ifndef ULP_I2C_SCL_LOC +#ifdef SLI_SI91X_MCU_CONFIG_RADIO_BOARD_BASE_VER +#define RTE_I2C2_SCL_PORT_ID 0 +#else +#define RTE_I2C2_SCL_PORT_ID 0 +#endif +#if (RTE_I2C2_SCL_PORT_ID == 0) +#define RTE_I2C2_SCL_PORT 0 +#define RTE_I2C2_SCL_PIN 7 +#define RTE_I2C2_SCL_MUX 4 +#define RTE_I2C2_SCL_REN 7 +#elif (RTE_I2C2_SCL_PORT_ID == 1) +#define RTE_I2C2_SCL_PORT 0 +#define RTE_I2C2_SCL_PIN 8 +#define RTE_I2C2_SCL_MUX 4 +#define RTE_I2C2_SCL_REN 8 +#else +#error "Invalid I2C2_SCL Pin Configuration!" +#endif +#else +//Pintool data +#define RTE_I2C2_SCL_PORT ULP_I2C_SCL_PORT +#define RTE_I2C2_SCL_PIN ULP_I2C_SCL_PIN +#define RTE_I2C2_SCL_MUX 4 +#if (ULP_I2C_SCL_LOC == 0) +#define RTE_I2C2_SCL_REN 0 +#elif (ULP_I2C_SCL_LOC == 1) +#define RTE_I2C2_SCL_REN 0 +#elif (ULP_I2C_SCL_LOC == 2) +#define RTE_I2C2_SCL_REN 7 +#elif (ULP_I2C_SCL_LOC == 3) +#define RTE_I2C2_SCL_REN 8 +#endif +//Pintool data +#endif + +// I2C2_SDA Pin <0=>P0_0 <1=>P0_4 <2=>P0_6 <3=>P0_9 <4=>P0_11 <5=>P0_12 +#ifndef ULP_I2C_SDA_LOC +#define RTE_I2C2_SDA_PORT_ID 0 +#if (RTE_I2C2_SDA_PORT_ID == 0) +#define RTE_I2C2_SDA_PORT 0 +#define RTE_I2C2_SDA_PIN 6 +#define RTE_I2C2_SDA_MUX 4 +#define RTE_I2C2_SDA_REN 6 +#elif (RTE_I2C2_SDA_PORT_ID == 1) +#define RTE_I2C2_SDA_PORT 0 +#define RTE_I2C2_SDA_PIN 9 +#define RTE_I2C2_SDA_MUX 4 +#define RTE_I2C2_SDA_REN 9 +#elif (RTE_I2C2_SDA_PORT_ID == 2) +#define RTE_I2C2_SDA_PORT 0 +#define RTE_I2C2_SDA_PIN 11 +#define RTE_I2C2_SDA_MUX 4 +#define RTE_I2C2_SDA_REN 11 +#else +#error "Invalid I2C2_SDA Pin Configuration!" +#endif +#else +//Pintool data +#define RTE_I2C2_SDA_PORT I2C2_SDA_PORT +#define RTE_I2C2_SDA_PIN I2C2_SDA_PIN +#define RTE_I2C2_SDA_MUX 4 +#if (ULP_I2C_SDA_LOC == 4) +#define RTE_I2C2_SDA_REN 0 +#elif (ULP_I2C_SDA_LOC == 5) +#define RTE_I2C2_SDA_REN 0 +#elif (ULP_I2C_SDA_LOC == 6) +#define RTE_I2C2_SDA_REN 6 +#elif (ULP_I2C_SDA_LOC == 7) +#define RTE_I2C2_SDA_REN 9 +#elif (ULP_I2C_SDA_LOC == 8) +#define RTE_I2C2_SDA_REN 11 +#endif +//Pintool data +#endif + +#define IC_SCL_STUCK_TIMEOUT 20 +#define IC_SDA_STUCK_TIMEOUT 20 + +#define DMA_EN 0 +#if (DMA_EN == 1) +#define DMA_TX_TL 1 +#define DMA_RX_TL 1 +#endif + +// I2C2 [Driver_I2C2] + +// GSPI (Generic SPI master) [Driver_GSPI_MASTER] +// Configuration settings for Driver_GSPI_MASTER in component ::Drivers:GSPI +#define RTE_GSPI_MASTER 1 + +// GSPI_MASTER_CLK <0=>P0_8 <1=>P0_25 <2=>P0_46 <3=>P0_52 +// CLK of GSPI0 +#ifndef GSPI_MASTER_SCK_LOC +#define RTE_GSPI_MASTER_CLK_PORT_ID 1 + +#if (RTE_GSPI_MASTER_CLK_PORT_ID == 0) +#define RTE_GSPI_MASTER_CLK_PORT 0 +#define RTE_GSPI_MASTER_CLK_PIN 8 +#define RTE_GSPI_MASTER_CLK_MUX 4 +#define RTE_GSPI_MASTER_CLK_PAD 3 +#elif (RTE_GSPI_MASTER_CLK_PORT_ID == 1) +#define RTE_GSPI_MASTER_CLK_PORT 0 +#define RTE_GSPI_MASTER_CLK_PIN 25 +#define RTE_GSPI_MASTER_CLK_MUX 4 +#define RTE_GSPI_MASTER_CLK_PAD 0 //NO PAD +#elif (RTE_GSPI_MASTER_CLK_PORT_ID == 2) +#define RTE_GSPI_MASTER_CLK_PORT 0 +#define RTE_GSPI_MASTER_CLK_PIN 46 +#define RTE_GSPI_MASTER_CLK_MUX 4 +#define RTE_GSPI_MASTER_CLK_PAD 10 +#elif (RTE_GSPI_MASTER_CLK_PORT_ID == 3) +#define RTE_GSPI_MASTER_CLK_PORT 0 +#define RTE_GSPI_MASTER_CLK_PIN 52 +#define RTE_GSPI_MASTER_CLK_MUX 4 +#define RTE_GSPI_MASTER_CLK_PAD 16 +#else +#error "Invalid GSPI0 RTE_GSPI_MASTER_CLK_PIN Pin Configuration!" +#endif +#else +//Pintool data +#define RTE_GSPI_MASTER_CLK_PORT GSPI_MASTER_SCK__PORT +#define RTE_GSPI_MASTER_CLK_PIN GSPI_MASTER_SCK__PIN +#define RTE_GSPI_MASTER_CLK_MUX 4 +#if (GSPI_MASTER_SCK_LOC == 0) +#define RTE_GSPI_MASTER_CLK_PAD 3 +#endif +#if (GSPI_MASTER_SCK_LOC == 1) +#define RTE_GSPI_MASTER_CLK_PAD 0 +#endif +#if (GSPI_MASTER_SCK_LOC == 2) +#define RTE_GSPI_MASTER_CLK_PAD 10 +#endif +#if (GSPI_MASTER_SCK_LOC == 3) +#define RTE_GSPI_MASTER_CLK_PAD 16 +#endif +//Pintool data +#endif + +// GSPI_MASTER_CS0 +// <0=>P0_9 <1=>P0_28 <2=>P0_49 <3=>P0_53 +// CS0 of GSPI0 +// +#ifndef GSPI_MASTER_CS0_LOC +#define RTE_GSPI_MASTER_CS0_PORT_ID 1 + +#if (RTE_GSPI_MASTER_CS0_PORT_ID == 0) +#define RTE_GSPI_MASTER_CS0 1 +#define RTE_GSPI_MASTER_CS0_PORT 0 +#define RTE_GSPI_MASTER_CS0_PIN 9 +#define RTE_GSPI_MASTER_CS0_MUX 4 +#define RTE_GSPI_MASTER_CS0_PAD 4 +#elif (RTE_GSPI_MASTER_CS0_PORT_ID == 1) +#define RTE_GSPI_MASTER_CS0 1 +#define RTE_GSPI_MASTER_CS0_PORT 0 +#define RTE_GSPI_MASTER_CS0_PIN 28 +#define RTE_GSPI_MASTER_CS0_MUX 4 +#define RTE_GSPI_MASTER_CS0_PAD 0 //NO PAD +#elif (RTE_GSPI_MASTER_CS0_PORT_ID == 2) +#define RTE_GSPI_MASTER_CS0 1 +#define RTE_GSPI_MASTER_CS0_PORT 0 +#define RTE_GSPI_MASTER_CS0_PIN 49 +#define RTE_GSPI_MASTER_CS0_MUX 4 +#define RTE_GSPI_MASTER_CS0_PAD 13 +#elif (RTE_GSPI_MASTER_CS0_PORT_ID == 3) +#define RTE_GSPI_MASTER_CS0 1 +#define RTE_GSPI_MASTER_CS0_PORT 0 +#define RTE_GSPI_MASTER_CS0_PIN 53 +#define RTE_GSPI_MASTER_CS0_MUX 4 +#define RTE_GSPI_MASTER_CS0_PAD 17 +#else +#error "Invalid GSPI0 RTE_GSPI_MASTER_CS0_PIN Pin Configuration!" +#endif +#else +//Pintool data +#define RTE_GSPI_MASTER_CS0 1 +#define RTE_GSPI_MASTER_CS0_PORT GSPI_MASTER_CS0__PORT +#define RTE_GSPI_MASTER_CS0_PIN GSPI_MASTER_CS0__PIN +#define RTE_GSPI_MASTER_CS0_MUX 4 +#if (GSPI_MASTER_CS0_LOC == 4) +#define RTE_GSPI_MASTER_CS0_PAD 4 +#endif +#if (GSPI_MASTER_CS0_LOC == 5) +#define RTE_GSPI_MASTER_CS0_PAD 0 +#endif +#if (GSPI_MASTER_CS0_LOC == 6) +#define RTE_GSPI_MASTER_CS0_PAD 13 +#endif +#if (GSPI_MASTER_CS0_LOC == 7) +#define RTE_GSPI_MASTER_CS0_PAD 17 +#endif +//Pintool data +#endif + +// GSPI_MASTER_CS1 +// <0=>P0_10 <1=>P0_29 <2=>P0_50 <3=>P0_54 +// CS1 of GSPI0 +// +#ifndef GSPI_MASTER_CS1_LOC +#define RTE_GSPI_MASTER_CS1_PORT_ID 1 +#if (RTE_GSPI_MASTER_CS1_PORT_ID == 0) +#define RTE_GSPI_MASTER_CS1 1 +#define RTE_GSPI_MASTER_CS1_PORT 0 +#define RTE_GSPI_MASTER_CS1_PIN 10 +#define RTE_GSPI_MASTER_CS1_MUX 4 +#define RTE_GSPI_MASTER_CS1_PAD 5 +#elif (RTE_GSPI_MASTER_CS1_PORT_ID == 1) +#define RTE_GSPI_MASTER_CS1 1 +#define RTE_GSPI_MASTER_CS1_PORT 0 +#define RTE_GSPI_MASTER_CS1_PIN 29 +#define RTE_GSPI_MASTER_CS1_MUX 4 +#define RTE_GSPI_MASTER_CS1_PAD 0 //NO PAD +#elif (RTE_GSPI_MASTER_CS1_PORT_ID == 2) +#define RTE_GSPI_MASTER_CS1 1 +#define RTE_GSPI_MASTER_CS1_PORT 0 +#define RTE_GSPI_MASTER_CS1_PIN 50 +#define RTE_GSPI_MASTER_CS1_MUX 4 +#define RTE_GSPI_MASTER_CS1_PAD 14 +#elif (RTE_GSPI_MASTER_CS1_PORT_ID == 3) +#define RTE_GSPI_MASTER_CS1 1 +#define RTE_GSPI_MASTER_CS1_PORT 0 +#define RTE_GSPI_MASTER_CS1_PIN 54 +#define RTE_GSPI_MASTER_CS1_MUX 4 +#define RTE_GSPI_MASTER_CS1_PAD 18 +#else +#error "Invalid GSPI0 RTE_GSPI_MASTER_CS1_PIN Pin Configuration!" +#endif +#else +//Pintool data +#define RTE_GSPI_MASTER_CS1 1 +#define RTE_GSPI_MASTER_CS1_PORT GSPI_MASTER_CS1__PORT +#define RTE_GSPI_MASTER_CS1_PIN GSPI_MASTER_CS1__PIN +#define RTE_GSPI_MASTER_CS1_MUX 4 +#if (GSPI_MASTER_CS1_LOC == 8) +#define RTE_GSPI_MASTER_CS1_PAD 5 +#endif +#if (GSPI_MASTER_CS1_LOC == 9) +#define RTE_GSPI_MASTER_CS1_PAD 0 +#endif +#if (GSPI_MASTER_CS1_LOC == 10) +#define RTE_GSPI_MASTER_CS1_PAD 14 +#endif +#if (GSPI_MASTER_CS1_LOC == 11) +#define RTE_GSPI_MASTER_CS1_PAD 18 +#endif +//Pintool data +#endif + +// GSPI_MASTER_CS2 +// <0=>P0_15 <1=>P0_30 <2=>P0_51 <3=>P0_55 +// CS2 of GSPI0 +// +#ifndef GSPI_MASTER_CS2_LOC +#define RTE_GSPI_MASTER_CS2_PORT_ID 1 +#if (RTE_GSPI_MASTER_CS2_PORT_ID == 0) +#define RTE_GSPI_MASTER_CS2 1 +#define RTE_GSPI_MASTER_CS2_PORT 0 +#define RTE_GSPI_MASTER_CS2_PIN 15 +#define RTE_GSPI_MASTER_CS2_MUX 4 +#define RTE_GSPI_MASTER_CS2_PAD 8 +#elif (RTE_GSPI_MASTER_CS2_PORT_ID == 1) +#define RTE_GSPI_MASTER_CS2 1 +#define RTE_GSPI_MASTER_CS2_PORT 0 +#define RTE_GSPI_MASTER_CS2_PIN 30 +#define RTE_GSPI_MASTER_CS2_MUX 4 +#define RTE_GSPI_MASTER_CS2_PAD 0 //NO PAD +#elif (RTE_GSPI_MASTER_CS2_PORT_ID == 2) +#define RTE_GSPI_MASTER_CS2 1 +#define RTE_GSPI_MASTER_CS2_PORT 0 +#define RTE_GSPI_MASTER_CS2_PIN 51 +#define RTE_GSPI_MASTER_CS2_MUX 4 +#define RTE_GSPI_MASTER_CS2_PAD 15 +#elif (RTE_GSPI_MASTER_CS2_PORT_ID == 3) +#define RTE_GSPI_MASTER_CS2 1 +#define RTE_GSPI_MASTER_CS2_PORT 0 +#define RTE_GSPI_MASTER_CS2_PIN 55 +#define RTE_GSPI_MASTER_CS2_MUX 4 +#define RTE_GSPI_MASTER_CS2_PAD 19 +#else +#error "Invalid GSPI0 RTE_GSPI_MASTER_CS2_PIN Pin Configuration!" +#endif +#else +//Pintool data +#define RTE_GSPI_MASTER_CS2 1 +#define RTE_GSPI_MASTER_CS2_PORT GSPI_MASTER_CS2__PORT +#define RTE_GSPI_MASTER_CS2_PIN GSPI_MASTER_CS2__PIN +#define RTE_GSPI_MASTER_CS2_MUX 4 +#if (GSPI_MASTER_CS2_LOC == 12) +#define RTE_GSPI_MASTER_CS2_PAD 8 +#endif +#if (GSPI_MASTER_CS2_LOC == 13) +#define RTE_GSPI_MASTER_CS2_PAD 0 +#endif +#if (GSPI_MASTER_CS2_LOC == 14) +#define RTE_GSPI_MASTER_CS2_PAD 15 +#endif +#if (GSPI_MASTER_CS2_LOC == 15) +#define RTE_GSPI_MASTER_CS2_PAD 19 +#endif +//Pintool data +#endif + +// GSPI_MASTER_MOSI <0=>P0_12 <1=>P0_27 <2=>P0_48 <3=>P0_57 <4=>P0_6 +// MOSI of GSPI0 +#ifndef GSPI_MASTER_MOSI_LOC +#define RTE_GSPI_MASTER_MOSI_PORT_ID 1 + +#if (RTE_GSPI_MASTER_MOSI_PORT_ID == 0) +#define RTE_GSPI_MASTER_MOSI_PORT 0 +#define RTE_GSPI_MASTER_MOSI_PIN 12 +#define RTE_GSPI_MASTER_MOSI_MUX 4 +#define RTE_GSPI_MASTER_MOSI_PAD 7 +#elif (RTE_GSPI_MASTER_MOSI_PORT_ID == 1) +#define RTE_GSPI_MASTER_MOSI_PORT 0 +#define RTE_GSPI_MASTER_MOSI_PIN 27 +#define RTE_GSPI_MASTER_MOSI_MUX 4 +#define RTE_GSPI_MASTER_MOSI_PAD 0 //NO PAD +#elif (RTE_GSPI_MASTER_MOSI_PORT_ID == 2) +#define RTE_GSPI_MASTER_MOSI_PORT 0 +#define RTE_GSPI_MASTER_MOSI_PIN 48 +#define RTE_GSPI_MASTER_MOSI_MUX 4 +#define RTE_GSPI_MASTER_MOSI_PAD 12 +#elif (RTE_GSPI_MASTER_MOSI_PORT_ID == 3) +#define RTE_GSPI_MASTER_MOSI_PORT 0 +#define RTE_GSPI_MASTER_MOSI_PIN 57 +#define RTE_GSPI_MASTER_MOSI_MUX 4 +#define RTE_GSPI_MASTER_MOSI_PAD 21 +#elif (RTE_GSPI_MASTER_MOSI_PORT_ID == 4) +#define RTE_GSPI_MASTER_MOSI_PORT 0 +#define RTE_GSPI_MASTER_MOSI_PIN 6 +#define RTE_GSPI_MASTER_MOSI_MUX 12 +#define RTE_GSPI_MASTER_MOSI_PAD 1 +#else +#error "Invalid GSPI0 RTE_GSPI_MASTER_MOSI_PIN Pin Configuration!" +#endif +#else +//Pintool data +#define RTE_GSPI_MASTER_MOSI_PORT GSPI_MASTER_MOSI__PORT +#define RTE_GSPI_MASTER_MOSI_PIN GSPI_MASTER_MOSI__PIN +#if (GSPI_MASTER_MOSI_LOC == 16) +#define RTE_GSPI_MASTER_MOSI_MUX 4 +#define RTE_GSPI_MASTER_MOSI_PAD 1 +#endif +#if (GSPI_MASTER_MOSI_LOC == 17) +#define RTE_GSPI_MASTER_MOSI_MUX 4 +#define RTE_GSPI_MASTER_MOSI_PAD 0 +#endif +#if (GSPI_MASTER_MOSI_LOC == 18) +#define RTE_GSPI_MASTER_MOSI_MUX 4 +#define RTE_GSPI_MASTER_MOSI_PAD 12 +#endif +#if (GSPI_MASTER_MOSI_LOC == 19) +#define RTE_GSPI_MASTER_MOSI_MUX 4 +#define RTE_GSPI_MASTER_MOSI_PAD 21 +#endif +#if (GSPI_MASTER_MOSI_LOC == 20) +#define RTE_GSPI_MASTER_MOSI_MUX 12 +#define RTE_GSPI_MASTER_MOSI_PAD 1 +#endif +//Pintool data +#endif + +// GSPI_MASTER_MISO <0=>P0_11 <1=>P0_26 <2=>P0_47 <3=>P0_56 +// MISO of GSPI0 +#ifndef GSPI_MASTER_MISO_LOC +#define RTE_GSPI_MASTER_MISO_PORT_ID 1 + +#if (RTE_GSPI_MASTER_MISO_PORT_ID == 0) +#define RTE_GSPI_MASTER_MISO_PORT 0 +#define RTE_GSPI_MASTER_MISO_PIN 11 +#define RTE_GSPI_MASTER_MISO_MUX 4 +#define RTE_GSPI_MASTER_MISO_PAD 6 +#elif (RTE_GSPI_MASTER_MISO_PORT_ID == 1) +#define RTE_GSPI_MASTER_MISO_PORT 0 +#define RTE_GSPI_MASTER_MISO_PIN 26 +#define RTE_GSPI_MASTER_MISO_MUX 4 +#define RTE_GSPI_MASTER_MISO_PAD 0 //NO PAD +#elif (RTE_GSPI_MASTER_MISO_PORT_ID == 2) +#define RTE_GSPI_MASTER_MISO_PORT 0 +#define RTE_GSPI_MASTER_MISO_PIN 47 +#define RTE_GSPI_MASTER_MISO_MUX 4 +#define RTE_GSPI_MASTER_MISO_PAD 11 +#elif (RTE_GSPI_MASTER_MISO_PORT_ID == 3) +#define RTE_GSPI_MASTER_MISO_PORT 0 +#define RTE_GSPI_MASTER_MISO_PIN 56 +#define RTE_GSPI_MASTER_MISO_MUX 4 +#define RTE_GSPI_MASTER_MISO_PAD 20 +#else +#error "Invalid GSPI0 RTE_GSPI_MASTER_MISO_PIN Pin Configuration!" +#endif +#else +//Pintool data +#define RTE_GSPI_MASTER_MISO_PORT GSPI_MASTER_MISO__PORT +#define RTE_GSPI_MASTER_MISO_PIN GSPI_MASTER_MISO__PIN +#define RTE_GSPI_MASTER_MISO_MUX 4 +#if (GSPI_MASTER_MISO_LOC == 21) +#define RTE_GSPI_MASTER_MISO_PAD 6 +#endif +#if (GSPI_MASTER_MISO_LOC == 22) +#define RTE_GSPI_MASTER_MISO_PAD 0 +#endif +#if (GSPI_MASTER_MISO_LOC == 23) +#define RTE_GSPI_MASTER_MISO_PAD 11 +#endif +#if (GSPI_MASTER_MISO_LOC == 24) +#define RTE_GSPI_MASTER_MISO_PAD 20 +#endif +//Pintool data +#endif + +#if defined(HIGH_THROUGHPUT_EN) && (HIGH_THROUGHPUT_EN == ENABLE) +#define RTE_GSPI_MASTER_CHNL_UDMA_TX_EN 1 +#define RTE_GSPI_MASTER_CHNL_UDMA_TX_CH 11 + +#define RTE_GSPI_MASTER_CHNL_UDMA_RX_EN 1 +#define RTE_GSPI_MASTER_CHNL_UDMA_RX_CH 10 + +#define RTE_FIFO_AFULL_THRLD 3 +#define RTE_FIFO_AEMPTY_THRLD 7 + +#define TX_DMA_ARB_SIZE ARBSIZE_4 +#define RX_DMA_ARB_SIZE ARBSIZE_8 +#else +#define RTE_GSPI_MASTER_CHNL_UDMA_TX_EN 0 +#define RTE_GSPI_MASTER_CHNL_UDMA_TX_CH 11 + +#define RTE_GSPI_MASTER_CHNL_UDMA_RX_EN 0 +#define RTE_GSPI_MASTER_CHNL_UDMA_RX_CH 10 + +#define RTE_FIFO_AFULL_THRLD 0 +#define RTE_FIFO_AEMPTY_THRLD 0 + +#define TX_DMA_ARB_SIZE ARBSIZE_1 +#define RX_DMA_ARB_SIZE ARBSIZE_1 +#endif + +// (Generic SPI master)[Driver_GSPI_MASTER] + +// (State Configurable Timer) Interface +#define SCT_CLOCK_SOURCE M4_SOCCLKFOROTHERCLKSCT +#define SCT_CLOCK_DIV_FACT 1 + +//SCT_IN_0 <0=>GPIO_25 <1=>GPIO_64 <2=>GPIO_68 + +#ifndef SCT_IN0_LOC +#define RTE_SCT_IN_0_PORT_ID 0 + +#if (RTE_SCT_IN_0_PORT_ID == 0) +#define RTE_SCT_IN_0_PORT 0 +#define RTE_SCT_IN_0_PIN 25 +#define RTE_SCT_IN_0_MUX 9 +#define RTE_SCT_IN_0_PAD 0 //no pad +#else +#error "Invalid RTE_SCT_IN_0_PIN Pin Configuration!" +#endif +#else +//Pintool data +#define RTE_SCT_IN_0_PORT SCT_IN0_PORT +#if (SCT_IN0_LOC == 0) +#define RTE_SCT_IN_0_PIN SCT_IN0_PIN +#define RTE_SCT_IN_0_MUX 9 +#define RTE_SCT_IN_0_PAD 0 //no pad +#elif (SCT_IN0_LOC == 1) +#define RTE_SCT_IN_0_PIN (SCT_IN0_PIN + GPIO_MAX_PIN) +#define RTE_SCT_IN_0_MUX 7 +#define RTE_SCT_IN_0_PAD 22 +#elif (SCT_IN0_LOC == 2) +#define RTE_SCT_IN_0_PIN (SCT_IN0_PIN + GPIO_MAX_PIN) +#define RTE_SCT_IN_0_MUX 9 +#define RTE_SCT_IN_0_PAD 26 +#endif +//Pintool data +#endif + +//SCT_IN_1 <0=>GPIO_26 <1=>GPIO_65 <2=>GPIO_69 +#ifndef SCT_IN1_LOC +#define RTE_SCT_IN_1_PORT_ID 1 + +#if (RTE_SCT_IN_1_PORT_ID == 0) +#define RTE_SCT_IN_1_PORT 0 +#define RTE_SCT_IN_1_PIN 26 +#define RTE_SCT_IN_1_MUX 9 +#define RTE_SCT_IN_1_PAD 0 //no pad +#elif (RTE_SCT_IN_1_PORT_ID == 1) +#define RTE_SCT_IN_1_PORT 0 +#define RTE_SCT_IN_1_PIN 65 +#define RTE_SCT_IN_1_MUX 7 +#define RTE_SCT_IN_1_PAD 23 +#else +#error "Invalid RTE_SCT_IN_1_PIN Pin Configuration!" +#endif +#else +//Pintool data +#define RTE_SCT_IN_1_PORT SCT_IN1_PORT +#if (SCT_IN1_LOC == 3) +#define RTE_SCT_IN_1_PIN SCT_IN1_PIN +#define RTE_SCT_IN_1_MUX 9 +#define RTE_SCT_IN_1_PAD 0 //no pad +#endif +#if (SCT_IN1_LOC == 4) +#define RTE_SCT_IN_1_PIN (SCT_IN1_PIN + GPIO_MAX_PIN) +#define RTE_SCT_IN_1_MUX 7 +#define RTE_SCT_IN_1_PAD 23 +#endif +#if (SCT_IN1_LOC == 5) +#define RTE_SCT_IN_1_PIN (SCT_IN1_PIN + GPIO_MAX_PIN) +#define RTE_SCT_IN_1_MUX 9 +#define RTE_SCT_IN_1_PAD 27 +#endif +//Pintool data +#endif + +//SCT_IN_2 <0=>GPIO_27 <1=>GPIO_66 <2=>GPIO_70 +#ifndef SCT_IN2_LOC +#ifdef SLI_SI91X_MCU_CONFIG_RADIO_BOARD_BASE_VER +#define RTE_SCT_IN_2_PORT_ID 0 +#else +#define RTE_SCT_IN_2_PORT_ID 1 +#endif + +#if (RTE_SCT_IN_2_PORT_ID == 0) +#define RTE_SCT_IN_2_PORT 0 +#define RTE_SCT_IN_2_PIN 27 +#define RTE_SCT_IN_2_MUX 9 +#define RTE_SCT_IN_2_PAD 0 //no pad +#elif (RTE_SCT_IN_2_PORT_ID == 1) +#define RTE_SCT_IN_2_PORT 0 +#define RTE_SCT_IN_2_PIN 66 +#define RTE_SCT_IN_2_MUX 7 +#define RTE_SCT_IN_2_PAD 24 +#elif (RTE_SCT_IN_2_PORT_ID == 2) +#define RTE_SCT_IN_2_PORT 0 +#define RTE_SCT_IN_2_PIN 70 +#define RTE_SCT_IN_2_MUX 9 +#define RTE_SCT_IN_2_PAD 28 +#else +#error "Invalid RTE_SCT_IN_0_PIN Pin Configuration!" +#endif +#else +//Pintool data +#define RTE_SCT_IN_2_PORT SCT_IN2_PORT +#if (SCT_IN2_LOC == 6) +#define RTE_SCT_IN_2_PIN SCT_IN2_PIN +#define RTE_SCT_IN_2_MUX 9 +#define RTE_SCT_IN_2_PAD 0 //no pad +#endif +#if (SCT_IN2_LOC == 7) +#define RTE_SCT_IN_2_PIN (SCT_IN2_PIN + GPIO_MAX_PIN) +#define RTE_SCT_IN_2_MUX 9 +#define RTE_SCT_IN_2_PAD 28 +#endif +//Pintool data +#endif + +//SCT_IN_3 <0=>GPIO_28 <1=>GPIO_67 <2=>GPIO_71 +#ifndef SCT_IN3_LOC +#ifdef SLI_SI91X_MCU_CONFIG_RADIO_BOARD_BASE_VER +#define RTE_SCT_IN_3_PORT_ID 0 +#else +#define RTE_SCT_IN_3_PORT_ID 1 +#endif + +#if (RTE_SCT_IN_3_PORT_ID == 0) +#define RTE_SCT_IN_3_PORT 0 +#define RTE_SCT_IN_3_PIN 28 +#define RTE_SCT_IN_3_MUX 9 +#define RTE_SCT_IN_3_PAD 0 //no pad +#elif (RTE_SCT_IN_3_PORT_ID == 1) +#define RTE_SCT_IN_3_PORT 0 +#define RTE_SCT_IN_3_PIN 67 +#define RTE_SCT_IN_3_MUX 7 +#define RTE_SCT_IN_3_PAD 25 +#elif (RTE_SCT_IN_3_PORT_ID == 2) +#define RTE_SCT_IN_3_PORT 0 +#define RTE_SCT_IN_3_PIN 71 +#define RTE_SCT_IN_3_MUX 9 +#define RTE_SCT_IN_3_PAD 29 +#else +#error "Invalid RTE_SCT_IN_0_PIN Pin Configuration!" +#endif +#else +//Pintool data +#define RTE_SCT_IN_3_PORT SCT_IN3_PORT +#if (SCT_IN3_LOC == 8) +#define RTE_SCT_IN_3_PIN SCT_IN3_PIN +#define RTE_SCT_IN_3_MUX 9 +#define RTE_SCT_IN_3_PAD 0 //no pad +#endif +#if (SCT_IN3_LOC == 9) +#define RTE_SCT_IN_3_PIN (SCT_IN3_PIN + GPIO_MAX_PIN) +#define RTE_SCT_IN_3_MUX 9 +#define RTE_SCT_IN_3_PAD 29 +#endif +//Pintool data +#endif + +// SCT_OUT_0 <0=>GPIO_29 <1=>GPIO_68 +#ifndef SCT_OUT0_LOC +#define RTE_SCT_OUT_0_PORT_ID 0 +#if (RTE_SCT_OUT_0_PORT_ID == 0) +#define RTE_SCT_OUT_0_PORT 0 +#define RTE_SCT_OUT_0_PIN 29 +#define RTE_SCT_OUT_0_MUX 9 +#define RTE_SCT_OUT_0_PAD 0 //no pad +#else +#error "Invalid RTE_SCT_OUT_0_PIN Pin Configuration!" +#endif +#else +//Pintool data +#define RTE_SCT_OUT_0_PORT SCT_OUT0_PORT +#if (SCT_OUT0_LOC == 10) +#define RTE_SCT_OUT_0_PIN SCT_OUT0_PIN +#define RTE_SCT_OUT_0_MUX 9 +#define RTE_SCT_OUT_0_PAD 0 //no pad +#elif (SCT_OUT0_LOC == 11) +#define RTE_SCT_OUT_0_PIN (SCT_OUT0_PIN + GPIO_MAX_PIN) +#define RTE_SCT_OUT_0_MUX 7 +#define RTE_SCT_OUT_0_PAD 26 +#endif +//Pintool data +#endif + +// SCT_OUT_1 <0=>GPIO_30 <1=>GPIO_69 +#ifndef SCT_OUT1_LOC +#define RTE_SCT_OUT_1_PORT_ID 0 +#if (RTE_SCT_OUT_1_PORT_ID == 0) +#define RTE_SCT_OUT_1_PORT 0 +#define RTE_SCT_OUT_1_PIN 30 +#define RTE_SCT_OUT_1_MUX 9 +#define RTE_SCT_OUT_1_PAD 0 //no pad +#else +#error "Invalid RTE_SCT_OUT_1_PIN Pin Configuration!" +#endif +#else +//Pintool data +#define RTE_SCT_OUT_1_PORT SCT_OUT1_PORT +#if (SCT_OUT1_LOC == 12) +#define RTE_SCT_OUT_1_PIN SCT_OUT1_PIN +#define RTE_SCT_OUT_1_MUX 9 +#define RTE_SCT_OUT_1_PAD 0 //no pad +#elif (SCT_OUT1_LOC == 13) +#define RTE_SCT_OUT_1_PIN (SCT_OUT1_PIN + GPIO_MAX_PIN) +#define RTE_SCT_OUT_1_MUX 7 +#define RTE_SCT_OUT_1_PAD 27 +#endif +//Pintool data +#endif + +//Pintool data +#define RTE_SCT_OUT_2_PORT SCT_OUT2_PORT +#define RTE_SCT_OUT_2_PIN SCT_OUT2_PIN +#define RTE_SCT_OUT_2_MUX 7 +#define RTE_SCT_OUT_2_PAD 28 +//Pintool data + +//Pintool data +#define RTE_SCT_OUT_3_PORT SCT_OUT3_PORT +#define RTE_SCT_OUT_3_PIN SCT_OUT3_PIN +#define RTE_SCT_OUT_3_MUX 7 +#define RTE_SCT_OUT_3_PAD 29 +//Pintool data + +//Pintool data +#define RTE_SCT_OUT_4_PORT SCT_OUT4_PORT +#define RTE_SCT_OUT_4_PIN SCT_OUT4_PIN +#define RTE_SCT_OUT_4_MUX 7 +#define RTE_SCT_OUT_4_PAD 30 +//Pintool data + +//Pintool data +#define RTE_SCT_OUT_5_PORT SCT_OUT5_PORT +#define RTE_SCT_OUT_5_PIN SCT_OUT5_PIN +#define RTE_SCT_OUT_5_MUX 7 +#define RTE_SCT_OUT_5_PAD 31 +//Pintool data + +//Pintool data +#define RTE_SCT_OUT_6_PORT SCT_OUT6_PORT +#define RTE_SCT_OUT_6_PIN SCT_OUT6_PIN +#define RTE_SCT_OUT_6_MUX 7 +#define RTE_SCT_OUT_6_PAD 32 +//Pintool data + +//Pintool data +#define RTE_SCT_OUT_7_PORT SCT_OUT7_PORT +#define RTE_SCT_OUT_7_PIN SCT_OUT7_PIN +#define RTE_SCT_OUT_7_MUX 7 +#define RTE_SCT_OUT_7_PAD 33 +//Pintool data + +// SIO // +//<> Serial Input Output +//SIO_0 <0=>GPIO_6 <1=>GPIO_25 <2=>GPIO_64 <3=>GPIO_72 +#ifndef SIO_0_LOC +#define RTE_SIO_0_PORT_ID 0 + +#if (RTE_SIO_0_PORT_ID == 0) +#define RTE_SIO_0_PORT 0 +#define RTE_SIO_0_PIN 6 +#define RTE_SIO_0_MUX 1 +#define RTE_SIO_0_PAD 1 +#elif (RTE_SIO_0_PORT_ID == 1) +#define RTE_SIO_0_PORT 0 +#define RTE_SIO_0_PIN 25 +#define RTE_SIO_0_MUX 1 +#define RTE_SIO_0_PAD 0 //no pad +#elif (RTE_SIO_0_PORT_ID == 2) +#define RTE_SIO_0_PORT 0 +#define RTE_SIO_0_PIN 72 +#define RTE_SIO_0_MUX 1 +#define RTE_SIO_0_PAD 30 +#else +#error "Invalid RTE_SIO_0_PIN Pin Configuration!" +#endif +#else +//Pintool data +#define RTE_SIO_0_PORT SIO_SIO0_PORT +#define RTE_SIO_0_MUX 1 +#if (SIO_0_LOC == 0) +#define RTE_SIO_0_PIN SIO_SIO0_PIN +#define RTE_SIO_0_PAD 1 +#endif +#if (SIO_0_LOC == 1) +#define RTE_SIO_0_PIN SIO_SIO0_PIN +#define RTE_SIO_0_PAD 0 +#endif +#if (SIO_0_LOC == 2) +#define RTE_SIO_0_PIN (SIO_SIO0_PIN + GPIO_MAX_PIN) +#define RTE_SIO_0_PAD 22 +#endif +#if (SIO_0_LOC == 3) +#define RTE_SIO_0_PIN (SIO_SIO0_PIN + GPIO_MAX_PIN) +#define RTE_SIO_0_PAD 30 +#endif +//Pintool data +#endif + +//SIO_1 <0=>GPIO_7 <1=>GPIO_26 <2=>GPIO_65 <3=>GPIO_73 +#ifndef SIO_1_LOC +#ifdef SLI_SI91X_MCU_CONFIG_RADIO_BOARD_BASE_VER +#define RTE_SIO_1_PORT_ID 1 +#else +#define RTE_SIO_1_PORT_ID 0 +#endif + +#if (RTE_SIO_1_PORT_ID == 0) +#define RTE_SIO_1_PORT 0 +#define RTE_SIO_1_PIN 7 +#define RTE_SIO_1_MUX 1 +#define RTE_SIO_1_PAD 2 +#elif (RTE_SIO_1_PORT_ID == 1) +#define RTE_SIO_1_PORT 0 +#define RTE_SIO_1_PIN 26 +#define RTE_SIO_1_MUX 1 +#define RTE_SIO_1_PAD 0 // no pad +#elif (RTE_SIO_1_PORT_ID == 2) +#define RTE_SIO_1_PORT 0 +#define RTE_SIO_1_PIN 65 +#define RTE_SIO_1_MUX 1 +#define RTE_SIO_1_PAD 23 +#elif (RTE_SIO_1_PORT_ID == 3) +#define RTE_SIO_1_PORT 0 +#define RTE_SIO_1_PIN 73 +#define RTE_SIO_1_MUX 1 +#define RTE_SIO_1_PAD 31 +#else +#error "Invalid RTE_SIO_1_PIN Pin Configuration!" +#endif +#else +//Pintool data +#define RTE_SIO_1_PORT SIO_SIO1_PORT +#define RTE_SIO_1_MUX 1 +#if (SIO_1_LOC == 4) +#define RTE_SIO_1_PIN SIO_SIO1_PIN +#define RTE_SIO_1_PAD 2 +#endif +#if (SIO_1_LOC == 5) +#define RTE_SIO_1_PIN SIO_SIO1_PIN +#define RTE_SIO_1_PAD 0 +#endif +#if (SIO_1_LOC == 6) +#define RTE_SIO_1_PIN (SIO_SIO1_PIN + GPIO_MAX_PIN) +#define RTE_SIO_1_PAD 23 +#endif +#if (SIO_1_LOC == 7) +#define RTE_SIO_1_PIN (SIO_SIO1_PIN + GPIO_MAX_PIN) +#define RTE_SIO_1_PAD 31 +#endif +//Pintool data +#endif + +// SIO_2 <0=>GPIO_8 <1=>GPIO_27 <2=>GPIO_66 <3=>GPIO_74 +#ifndef SIO_2_LOC +#define RTE_SIO_2_PORT_ID 1 + +#if (RTE_SIO_2_PORT_ID == 0) +#define RTE_SIO_2_PORT 0 +#define RTE_SIO_2_PIN 8 +#define RTE_SIO_2_MUX 1 +#define RTE_SIO_2_PAD 3 +#elif (RTE_SIO_2_PORT_ID == 1) +#define RTE_SIO_2_PORT 0 +#define RTE_SIO_2_PIN 27 +#define RTE_SIO_2_MUX 1 +#define RTE_SIO_2_PAD 0 //no pad +#elif (RTE_SIO_2_PORT_ID == 2) +#define RTE_SIO_2_PORT 0 +#define RTE_SIO_2_PIN 66 +#define RTE_SIO_2_MUX 1 +#define RTE_SIO_2_PAD 24 +#elif (RTE_SIO_2_PORT_ID == 3) +#define RTE_SIO_2_PORT 0 +#define RTE_SIO_2_PIN 74 +#define RTE_SIO_2_MUX 1 +#define RTE_SIO_2_PAD 32 +#else +#error "Invalid RTE_SIO_2_PIN Pin Configuration!" +#endif +#else +//Pintool data +#define RTE_SIO_2_PORT SIO_SIO2_PORT +#define RTE_SIO_2_MUX 1 +#if (SIO_2_LOC == 8) +#define RTE_SIO_2_PIN SIO_SIO2_PIN +#define RTE_SIO_2_PAD 3 +#endif +#if (SIO_2_LOC == 9) +#define RTE_SIO_2_PIN SIO_SIO2_PIN +#define RTE_SIO_2_PAD 0 +#endif +#if (SIO_2_LOC == 10) +#define RTE_SIO_2_PIN (SIO_SIO2_PIN + GPIO_MAX_PIN) +#define RTE_SIO_2_PAD 32 +#endif +//Pintool data +#endif + +//SIO_3 <0=>GPIO_9 <1=>GPIO_28 <2=>GPIO_67 <3=>GPIO_75 +#ifndef SIO_3_LOC +#define RTE_SIO_3_PORT_ID 1 + +#if (RTE_SIO_3_PORT_ID == 0) +#define RTE_SIO_3_PORT 0 +#define RTE_SIO_3_PIN 9 +#define RTE_SIO_3_MUX 1 +#define RTE_SIO_3_PAD 4 +#elif (RTE_SIO_3_PORT_ID == 1) +#define RTE_SIO_3_PORT 0 +#define RTE_SIO_3_PIN 28 +#define RTE_SIO_3_MUX 1 +#define RTE_SIO_3_PAD 0 //no pad +#elif (RTE_SIO_3_PORT_ID == 2) +#define RTE_SIO_3_PORT 0 +#define RTE_SIO_3_PIN 67 +#define RTE_SIO_3_MUX 1 +#define RTE_SIO_3_PAD 25 +#elif (RTE_SIO_3_PORT_ID == 3) +#define RTE_SIO_3_PORT 0 +#define RTE_SIO_3_PIN 75 +#define RTE_SIO_3_MUX 1 +#define RTE_SIO_3_PAD 33 +#else +#error "Invalid RTE_SIO_3_PIN Pin Configuration!" +#endif +#else +//Pintool data +#define RTE_SIO_3_PORT SIO_SIO3_PORT +#define RTE_SIO_3_MUX 1 +#if (SIO_3_LOC == 11) +#define RTE_SIO_3_PIN SIO_SIO3_PIN +#define RTE_SIO_3_PAD 4 +#endif +#if (SIO_3_LOC == 12) +#define RTE_SIO_3_PIN SIO_SIO3_PIN +#define RTE_SIO_3_PAD 0 +#endif +#if (SIO_3_LOC == 13) +#define RTE_SIO_3_PIN (SIO_SIO3_PIN + GPIO_MAX_PIN) +#define RTE_SIO_3_PAD 33 +#endif +//Pintool data +#endif + +//SIO_4 <0=>GPIO_10 <1=>GPIO_29 <2=>GPIO_68 +#ifndef SIO_4_LOC +#ifdef SLI_SI91X_MCU_CONFIG_RADIO_BOARD_BASE_VER +#define RTE_SIO_4_PORT_ID 1 +#else +#define RTE_SIO_4_PORT_ID 0 +#endif +#if (RTE_SIO_4_PORT_ID == 0) +#define RTE_SIO_4_PORT 0 +#define RTE_SIO_4_PIN 10 +#define RTE_SIO_4_MUX 1 +#define RTE_SIO_4_PAD 5 +#elif (RTE_SIO_4_PORT_ID == 1) +#define RTE_SIO_4_PORT 0 +#define RTE_SIO_4_PIN 29 +#define RTE_SIO_4_MUX 1 +#define RTE_SIO_4_PAD 0 //NO PAD +#else +#error "Invalid RTE_SIO_3_PIN Pin Configuration!" +#endif +#else +//Pintool data +#define RTE_SIO_4_PORT SIO_SIO4_PORT +#define RTE_SIO_4_MUX 1 +#if (SIO_4_LOC == 14) +#define RTE_SIO_4_PAD 5 +#define RTE_SIO_4_PIN SIO_SIO4_PIN +#endif +#if (SIO_4_LOC == 15) +#define RTE_SIO_4_PAD 0 +#define RTE_SIO_4_PIN SIO_SIO4_PIN +#endif +#if (SIO_4_LOC == 16) +#define RTE_SIO_4_PAD 26 +#define RTE_SIO_4_PIN (SIO_SIO4_PIN + GPIO_MAX_PIN) +#endif +//Pintool data +#endif + +// SIO_5 <0=>GPIO_11 <1=>GPIO_30 <2=>GPIO_69 +#ifndef SIO_5_LOC +#define RTE_SIO_5_PORT_ID 0 +#if (RTE_SIO_5_PORT_ID == 0) +#define RTE_SIO_5_PORT 0 +#define RTE_SIO_5_PIN 11 +#define RTE_SIO_5_MUX 1 +#define RTE_SIO_5_PAD 6 +#elif (RTE_SIO_5_PORT_ID == 1) +#define RTE_SIO_5_PORT 0 +#define RTE_SIO_5_PIN 30 +#define RTE_SIO_5_MUX 1 +#define RTE_SIO_5_PAD 0 //no pad +#else +#error "Invalid RTE_SIO_5_PIN Pin Configuration!" +#endif +#else +//Pintool data +#define RTE_SIO_5_PORT SIO_SIO5_PORT +#define RTE_SIO_5_MUX 1 +#if (SIO_5_LOC == 17) +#define RTE_SIO_5_PAD 6 +#define RTE_SIO_5_PIN SIO_SIO5_PIN +#endif +#if (SIO_5_LOC == 18) +#define RTE_SIO_5_PAD 0 +#define RTE_SIO_5_PIN SIO_SIO5_PIN +#endif +#if (SIO_5_LOC == 19) +#define RTE_SIO_5_PAD 0 +#define RTE_SIO_5_PIN (SIO_SIO5_PIN + GPIO_MAX_PIN) +#endif +//Pintool data +#endif + +// SIO_6 GPIO_70 +#ifndef SIO_6_LOC +#define RTE_SIO_6_PORT 0 +#define RTE_SIO_6_PIN 70 +#else +#define RTE_SIO_6_PORT SIO_SIO6_PORT +#define RTE_SIO_6_PIN (SIO_SIO6_PIN + GPIO_MAX_PIN) +#endif +#define RTE_SIO_6_MUX 1 +#define RTE_SIO_6_PAD 28 + +// SIO_7 <0=>GPIO_15 <1=>GPIO_71 +#ifndef SIO_7_LOC +#ifdef SLI_SI91X_MCU_CONFIG_RADIO_BOARD_BASE_VER +#define RTE_SIO_7_PORT_ID 1 +#else +#define RTE_SIO_7_PORT_ID 0 +#endif + +#if (RTE_SIO_7_PORT_ID == 0) +#define RTE_SIO_7_PORT 0 +#define RTE_SIO_7_PIN 15 +#define RTE_SIO_7_MUX 1 +#define RTE_SIO_7_PAD 8 +#elif (RTE_SIO_7_PORT_ID == 1) +#define RTE_SIO_7_PORT 0 +#define RTE_SIO_7_PIN 71 +#define RTE_SIO_7_MUX 1 +#define RTE_SIO_7_PAD 29 +#else +#error "Invalid RTE_SIO_7_PIN Pin Configuration!" +#endif +#else +//Pintool data +#define RTE_SIO_7_PORT SIO_SIO7_PORT +#define RTE_SIO_7_MUX 1 +#if (SIO_7_LOC == 21) +#define RTE_SIO_7_PIN SIO_SIO7_PIN +#define RTE_SIO_7_PAD 8 +#endif +#if (SIO_7_LOC == 22) +#define RTE_SIO_7_PIN (SIO_SIO7_PIN + GPIO_MAX_PIN) +#define RTE_SIO_7_PAD 29 +#endif +//Pintool data +#endif + +//<> Pulse Width Modulation +//PWM_1H <0=>GPIO_7 <1=>GPIO_64 <2=>GPIO_65 +#ifndef PWM_1H_LOC +#ifdef SLI_SI91X_MCU_CONFIG_RADIO_BOARD_BASE_VER +#define RTE_PWM_1H_PORT_ID 0 +#else +#define RTE_PWM_1H_PORT_ID 0 +#endif + +#if (RTE_PWM_1H_PORT_ID == 0) +#define RTE_PWM_1H_PORT 0 +#define RTE_PWM_1H_PIN 7 +#define RTE_PWM_1H_MUX 10 +#define RTE_PWM_1H_PAD 2 +#elif (RTE_PWM_1H_PORT_ID == 1) +#define RTE_PWM_1H_PORT 0 +#define RTE_PWM_1H_PIN 65 +#define RTE_PWM_1H_MUX 8 +#define RTE_PWM_1H_PAD 22 +#else +#error "Invalid RTE_PWM_1H_PIN Pin Configuration!" +#endif +#else +//Pintool data +#define RTE_PWM_1H_PORT PWM_1H_PORT +#if (PWM_1H_LOC == 0) +#define RTE_PWM_1H_PIN PWM_1H_PIN +#define RTE_PWM_1H_MUX 10 +#define RTE_PWM_1H_PAD 2 +#endif +#if (PWM_1H_LOC == 1) +#define RTE_PWM_1H_PIN (PWM_1H_PIN + GPIO_MAX_PIN) +#define RTE_PWM_1H_MUX 8 +#define RTE_PWM_1H_PAD 22 +#endif +//Pintool data +#endif + +// PWM_1L <0=>GPIO_6 <1=>GPIO_64 <2=>GPIO_64 +#ifndef PWM_1L_LOC +#ifdef SLI_SI91X_MCU_CONFIG_RADIO_BOARD_BASE_VER +#define RTE_PWM_1L_PORT_ID 0 +#else +#define RTE_PWM_1L_PORT_ID 1 +#endif + +#if (RTE_PWM_1L_PORT_ID == 0) +#define RTE_PWM_1L_PORT 0 +#define RTE_PWM_1L_PIN 6 +#define RTE_PWM_1L_MUX 10 +#define RTE_PWM_1L_PAD 1 +#else +#error "Invalid RTE_PWM_1L_PIN Pin Configuration!" +#endif +#else +//Pintool data +#define RTE_PWM_1L_PORT PWM_1L_PORT +#if (PWM_1L_LOC == 2) +#define RTE_PWM_1L_PIN PWM_1L_PIN +#define RTE_PWM_1L_MUX 10 +#define RTE_PWM_1L_PAD 1 +#elif (PWM_1L_LOC == 3) +#define RTE_PWM_1L_PIN (PWM_1L_PIN + GPIO_MAX_PIN) +#define RTE_PWM_1L_MUX 8 +#define RTE_PWM_1L_PAD 22 +#endif +//Pintool data +#endif + +//PWM_2H <0=>GPIO_9 <1=>GPIO_67 <2=>GPIO_69 +#ifndef PWM_2H_LOC +#define RTE_PWM_2H_PORT_ID 0 +#if ((RTE_PWM_2H_PORT_ID == 2)) +#error "Invalid RTE_PWM_2H_PIN pin Configuration!" +#endif + +#if (RTE_PWM_2H_PORT_ID == 0) +#define RTE_PWM_2H_PORT 0 +#define RTE_PWM_2H_PIN 9 +#define RTE_PWM_2H_MUX 10 +#define RTE_PWM_2H_PAD 4 +#elif (RTE_PWM_2H_PORT_ID == 1) +#define RTE_PWM_2H_PORT 0 +#define RTE_PWM_2H_PIN 67 +#define RTE_PWM_2H_MUX 8 +#define RTE_PWM_2H_PAD 25 +#else +#error "Invalid RTE_PWM_2H_PIN Pin Configuration!" +#endif +#else +//Pintool data +#define RTE_PWM_2H_PORT PWM_2H_PORT +#if (PWM_2H_LOC == 4) +#define RTE_PWM_2H_PIN PWM_2H_PIN +#define RTE_PWM_2H_MUX 10 +#define RTE_PWM_2H_PAD 4 +#endif +#if (PWM_2H_LOC == 5) +#define RTE_PWM_2H_PIN (PWM_2H_PIN + GPIO_MAX_PIN) +#define RTE_PWM_2H_MUX 12 +#define RTE_PWM_2H_PAD 27 +#endif +//Pintool data +#endif + +// PWM_2L <0=>GPIO_8 <1=>GPIO_66 <2=>GPIO_68 +#ifndef PWM_2L_LOC +#define RTE_PWM_2L_PORT_ID 0 +#if ((RTE_PWM_2L_PORT_ID == 2)) +#error "Invalid RTE_PWM_2L_PIN pin Configuration!" +#endif + +#if (RTE_PWM_2L_PORT_ID == 0) +#define RTE_PWM_2L_PORT 0 +#define RTE_PWM_2L_PIN 8 +#define RTE_PWM_2L_MUX 10 +#define RTE_PWM_2L_PAD 3 +#elif (RTE_PWM_2L_PORT_ID == 1) +#define RTE_PWM_2L_PORT 0 +#define RTE_PWM_2L_PIN 66 +#define RTE_PWM_2L_MUX 8 +#define RTE_PWM_2L_PAD 24 +#else +#error "Invalid RTE_PWM_2L_PIN Pin Configuration!" +#endif +#else +//Pintool data +#define RTE_PWM_2L_PORT PWM_2L_PORT +#if (PWM_2L_LOC == 6) +#define RTE_PWM_2L_PIN PWM_2L_PIN +#define RTE_PWM_2L_MUX 10 +#define RTE_PWM_2L_PAD 3 +#endif +#if (PWM_2L_LOC == 7) +#define RTE_PWM_2L_PIN (PWM_2L_PIN + GPIO_MAX_PIN) +#define RTE_PWM_2L_MUX 8 +#define RTE_PWM_2L_PAD 24 +#endif +#if (PWM_2L_LOC == 8) +#define RTE_PWM_2L_PIN (PWM_2L_PIN + GPIO_MAX_PIN) +#define RTE_PWM_2L_MUX 12 +#define RTE_PWM_2L_PAD 26 +#endif +//Pintool data +#endif + +// PWM_3H <0=>GPIO_11 <1=>GPIO_69 +#ifndef PWM_3H_LOC +#define RTE_PWM_3H_PORT_ID 0 +#if (RTE_PWM_3H_PORT_ID == 0) +#define RTE_PWM_3H_PORT 0 +#define RTE_PWM_3H_PIN 11 +#define RTE_PWM_3H_MUX 10 +#define RTE_PWM_3H_PAD 6 +#else +#error "Invalid RTE_PWM_3H_PIN Pin Configuration!" +#endif +#else +//Pintool data +#define RTE_PWM_3H_PORT PWM_3H_PORT +#if (PWM_3H_LOC == 9) +#define RTE_PWM_3H_PIN PWM_3H_PIN +#define RTE_PWM_3H_MUX 10 +#define RTE_PWM_3H_PAD 6 +#elif (PWM_3H_LOC == 10) +#define RTE_PWM_3H_PIN (PWM_3H_PIN + GPIO_MAX_PIN) +#define RTE_PWM_3H_MUX 8 +#define RTE_PWM_3H_PAD 27 +#endif +//Pintool data +#endif + +// PWM_3L <0=>GPIO_10 <1=>GPIO_68 +#ifndef PWM_3L_LOC +#define RTE_PWM_3L_PORT_ID 0 + +#if (RTE_PWM_3L_PORT_ID == 0) +#define RTE_PWM_3L_PORT 0 +#define RTE_PWM_3L_PIN 10 +#define RTE_PWM_3L_MUX 10 +#define RTE_PWM_3L_PAD 5 +#else +#error "Invalid RTE_PWM_3L_PIN Pin Configuration!" +#endif +#else +//Pintool data +#define RTE_PWM_3L_PORT PWM_3L_PORT +#if (PWM_3L_LOC == 11) +#define RTE_PWM_3L_PIN PWM_3L_PIN +#define RTE_PWM_3L_MUX 10 +#define RTE_PWM_3L_PAD 5 +#elif (PWM_3L_LOC == 12) +#define RTE_PWM_3L_PIN (PWM_3L_PIN + GPIO_MAX_PIN) +#define RTE_PWM_3L_MUX 8 +#define RTE_PWM_3L_PAD 26 +#endif +//Pintool data +#endif + +// PWM_4H <0=>GPIO_15 <1=>GPIO_71 +#ifndef PWM_4H_LOC +#ifdef SLI_SI91X_MCU_CONFIG_RADIO_BOARD_BASE_VER +#define RTE_PWM_4H_PORT_ID 1 +#else +#define RTE_PWM_4H_PORT_ID 0 +#endif + +#if (RTE_PWM_4H_PORT_ID == 0) +#define RTE_PWM_4H_PORT 0 +#define RTE_PWM_4H_PIN 15 +#define RTE_PWM_4H_MUX 10 +#define RTE_PWM_4H_PAD 8 +#elif (RTE_PWM_4H_PORT_ID == 1) +#define RTE_PWM_4H_PORT 0 +#define RTE_PWM_4H_PIN 71 +#define RTE_PWM_4H_MUX 8 +#define RTE_PWM_4H_PAD 29 +#else +#error "Invalid RTE_PWM_4H_PIN Pin Configuration!" +#endif +#else +//Pintool data +#define RTE_PWM_4H_PORT PWM_4H_PORT +#define RTE_PWM_4H_PIN (PWM_4H_PIN + GPIO_MAX_PIN) +#define RTE_PWM_4H_MUX 8 +#define RTE_PWM_4H_PAD 29 +//Pintool data +#endif + +// PWM_4H <0=>GPIO_12 <1=>GPIO_70 +#ifndef PWM_4L_LOC +#ifdef SLI_SI91X_MCU_CONFIG_RADIO_BOARD_BASE_VER +#define RTE_PWM_4L_PORT_ID 1 +#else +#define RTE_PWM_4L_PORT_ID 0 +#endif + +#if (RTE_PWM_4L_PORT_ID == 0) +#define RTE_PWM_4L_PORT 0 +#define RTE_PWM_4L_PIN 12 +#define RTE_PWM_4L_MUX 10 +#define RTE_PWM_4L_PAD 7 +#elif (RTE_PWM_4L_PORT_ID == 1) +#define RTE_PWM_4L_PORT 0 +#define RTE_PWM_4L_PIN 70 +#define RTE_PWM_4L_MUX 8 +#define RTE_PWM_4L_PAD 28 +#else +#error "Invalid RTE_PWM_4L_PIN Pin Configuration!" +#endif +#else +//Pintool data +#define RTE_PWM_4L_PORT PWM_4L_PORT +#if (PWM_4L_LOC == 14) +#define RTE_PWM_4L_PIN PWM_4L_PIN +#define RTE_PWM_4L_MUX 10 +#define RTE_PWM_4L_PAD 7 +#endif +#if (PWM_4L_LOC == 15) +#define RTE_PWM_4L_PIN (PWM_4L_PIN + GPIO_MAX_PIN) +#define RTE_PWM_4L_MUX 8 +#define RTE_PWM_4L_PAD 28 +#endif +//Pintool data +#endif + +// PWM_FAULTA <0=>GPIO_25 <1=>GPIO_68 <1=>GPIO_73 +#ifndef PWM_FAULTA_LOC +#define RTE_PWM_FAULTA_PORT_ID 0 + +#if (RTE_PWM_FAULTA_PORT_ID == 0) +#define RTE_PWM_FAULTA_PORT 0 +#define RTE_PWM_FAULTA_PIN 25 +#define RTE_PWM_FAULTA_MUX 10 +#define RTE_PWM_FAULTA_PAD 0 //no pad +#elif (RTE_PWM_FAULTA_PORT_ID == 2) +#define RTE_PWM_FAULTA_PORT 0 +#define RTE_PWM_FAULTA_PIN 73 +#define RTE_PWM_FAULTA_MUX 8 +#define RTE_PWM_FAULTA_PAD 31 +#else +#error "Invalid RTE_PWM_FAULTA_PIN Pin Configuration!" +#endif +#else +//Pintool data +#define RTE_PWM_FAULTA_PORT PWM_FAULTA_PORT +#if (PWM_FAULTA_LOC == 16) +#define RTE_PWM_FAULTA_PIN PWM_FAULTA_PIN +#define RTE_PWM_FAULTA_MUX 10 +#define RTE_PWM_FAULTA_PAD 0 //no pad +#endif +#if (PWM_FAULTA_LOC == 17) +#define RTE_PWM_FAULTA_PIN (PWM_FAULTA_PIN + GPIO_MAX_PIN) +#define RTE_PWM_FAULTA_MUX 10 +#define RTE_PWM_FAULTA_PAD 26 +#endif +#if (PWM_FAULTA_LOC == 18) +#define RTE_PWM_FAULTA_PIN (PWM_FAULTA_PIN + GPIO_MAX_PIN) +#define RTE_PWM_FAULTA_MUX 8 +#define RTE_PWM_FAULTA_PAD 31 +#endif +//Pintool data +#endif + +// PWM_FAULTB <0=>GPIO_26 <1=>GPIO_69 <1=>GPIO_74 +#ifndef PWM_FAULTB_LOC +#define RTE_PWM_FAULTB_PORT_ID 0 + +#if (RTE_PWM_FAULTB_PORT_ID == 0) +#define RTE_PWM_FAULTB_PORT 0 +#define RTE_PWM_FAULTB_PIN 26 +#define RTE_PWM_FAULTB_MUX 10 +#define RTE_PWM_FAULTB_PAD 0 //no pad +#elif (RTE_PWM_FAULTB_PORT_ID == 2) +#define RTE_PWM_FAULTB_PORT 0 +#define RTE_PWM_FAULTB_PIN 74 +#define RTE_PWM_FAULTB_MUX 8 +#define RTE_PWM_FAULTB_PAD 32 +#else +#error "Invalid RTE_PWM_FAULTB_PIN Pin Configuration!" +#endif +#else +//Pintool data +#define RTE_PWM_FAULTB_PORT PWM_FAULTB_PORT +#if (PWM_FAULTB_LOC == 19) +#define RTE_PWM_FAULTB_PIN PWM_FAULTB_PIN +#define RTE_PWM_FAULTB_MUX 10 +#define RTE_PWM_FAULTB_PAD 0 //no pad +#endif +#if (PWM_FAULTB_LOC == 20) +#define RTE_PWM_FAULTB_PIN (PWM_FAULTB_PIN + GPIO_MAX_PIN) +#define RTE_PWM_FAULTB_MUX 10 +#define RTE_PWM_FAULTB_PAD 27 +#endif +#if (PWM_FAULTB_LOC == 21) +#define RTE_PWM_FAULTB_PIN (PWM_FAULTB_PIN + GPIO_MAX_PIN) +#define RTE_PWM_FAULTB_MUX 8 +#define RTE_PWM_FAULTB_PAD 32 +#endif +//Pintool data +#endif + +//PWM_SLP_EVENT_TRIG GPIO_72 +#ifndef PWM_EVTTRIG_LOC +#define RTE_PWM_SLP_EVENT_TRIG_PORT 0 +#define RTE_PWM_SLP_EVENT_TRIG_PIN 72 +#else +//Pintool data +#define RTE_PWM_SLP_EVENT_TRIG_PORT PWM_SLEEP_EVT_TRIG_PORT +#define RTE_PWM_SLP_EVENT_TRIG_PIN (PWM_SLEEP_EVT_TRIG_PIN + GPIO_MAX_PIN) +//Pintool data +#endif +#define RTE_PWM_SLP_EVENT_TRIG_MUX 8 +#define RTE_PWM_SLP_EVENT_TRIG_PAD 30 + +//PWM_TMR_EXT_TRIG_1 <0=>GPIO_27 <1=>GPIO_51 <2=>GPIO_70 <3=>GPIO_75 +#ifndef PWM_EXTTRIG1_LOC +#define RTE_PWM_TMR_EXT_TRIG_1_PORT_ID 0 + +#if (RTE_PWM_TMR_EXT_TRIG_1_PORT_ID == 0) +#define RTE_PWM_TMR_EXT_TRIG_1_PORT 0 +#define RTE_PWM_TMR_EXT_TRIG_1_PIN 27 +#define RTE_PWM_TMR_EXT_TRIG_1_MUX 10 +#define RTE_PWM_TMR_EXT_TRIG_1_PAD 0 //no pad +#elif (RTE_PWM_TMR_EXT_TRIG_1_PORT_ID == 1) +#define RTE_PWM_TMR_EXT_TRIG_1_PORT 0 +#define RTE_PWM_TMR_EXT_TRIG_1_PIN 51 +#define RTE_PWM_TMR_EXT_TRIG_1_MUX 8 +#define RTE_PWM_TMR_EXT_TRIG_1_PAD 15 +#elif (RTE_PWM_TMR_EXT_TRIG_1_PORT_ID == 2) +#define RTE_PWM_TMR_EXT_TRIG_1_PORT 0 +#define RTE_PWM_TMR_EXT_TRIG_1_PIN 70 +#define RTE_PWM_TMR_EXT_TRIG_1_MUX 10 +#define RTE_PWM_TMR_EXT_TRIG_1_PAD 28 +#elif (RTE_PWM_TMR_EXT_TRIG_1_PORT_ID == 3) +#define RTE_PWM_TMR_EXT_TRIG_1_PORT 0 +#define RTE_PWM_TMR_EXT_TRIG_1_PIN 75 +#define RTE_PWM_TMR_EXT_TRIG_1_MUX 8 +#define RTE_PWM_TMR_EXT_TRIG_1_PAD 33 +#else +#error "Invalid RTE_PWM_TMR_EXT_TRIG_1_PIN Pin Configuration!" +#endif +#else +//Pintool data +#define RTE_PWM_TMR_EXT_TRIG_1_PORT PWM_TMR_EXT_TRIG_1_PORT +#if (PWM_EXTTRIG1_LOC == 22) +#define RTE_PWM_TMR_EXT_TRIG_1_PIN PWM_TMR_EXT_TRIG_1_PIN +#define RTE_PWM_TMR_EXT_TRIG_1_MUX 10 +#define RTE_PWM_TMR_EXT_TRIG_1_PAD 0 //no pad +#endif +#if (PWM_EXTTRIG1_LOC == 23) +#define RTE_PWM_TMR_EXT_TRIG_1_PIN PWM_TMR_EXT_TRIG_1_PIN +#define RTE_PWM_TMR_EXT_TRIG_1_MUX 8 +#define RTE_PWM_TMR_EXT_TRIG_1_PAD 15 +#endif +#if (PWM_EXTTRIG1_LOC == 24) +#define RTE_PWM_TMR_EXT_TRIG_1_PIN (PWM_TMR_EXT_TRIG_1_PIN + GPIO_MAX_PIN) +#define RTE_PWM_TMR_EXT_TRIG_1_MUX 10 +#define RTE_PWM_TMR_EXT_TRIG_1_PAD 28 +#endif +#if (PWM_EXTTRIG1_LOC == 25) +#define RTE_PWM_TMR_EXT_TRIG_1_PIN (PWM_TMR_EXT_TRIG_1_PIN + GPIO_MAX_PIN) +#define RTE_PWM_TMR_EXT_TRIG_1_MUX 8 +#define RTE_PWM_TMR_EXT_TRIG_1_PAD 33 +#endif +//Pintool data +#endif + +//PWM_TMR_EXT_TRIG_2 <0=>GPIO_28 <1=>GPIO_54 <2=>GPIO_71 +#ifndef PWM_EXTTRIG2_LOC +#define RTE_PWM_TMR_EXT_TRIG_2_PORT_ID 0 + +#if (RTE_PWM_TMR_EXT_TRIG_2_PORT_ID == 0) +#define RTE_PWM_TMR_EXT_TRIG_2_PORT 0 +#define RTE_PWM_TMR_EXT_TRIG_2_PIN 28 +#define RTE_PWM_TMR_EXT_TRIG_2_MUX 10 +#define RTE_PWM_TMR_EXT_TRIG_2_PAD 0 //no pad +#elif (RTE_PWM_TMR_EXT_TRIG_2_PORT_ID == 1) +#define RTE_PWM_TMR_EXT_TRIG_2_PORT 0 +#define RTE_PWM_TMR_EXT_TRIG_2_PIN 54 +#define RTE_PWM_TMR_EXT_TRIG_2_MUX 8 +#define RTE_PWM_TMR_EXT_TRIG_2_PAD 18 +#elif (RTE_PWM_TMR_EXT_TRIG_2_PORT_ID == 2) +#define RTE_PWM_TMR_EXT_TRIG_2_PORT 0 +#define RTE_PWM_TMR_EXT_TRIG_2_PIN 71 +#define RTE_PWM_TMR_EXT_TRIG_2_MUX 10 +#define RTE_PWM_TMR_EXT_TRIG_2_PAD 29 +#else +#error "Invalid RTE_PWM_TMR_EXT_TRIG_2_PIN Pin Configuration!" +#endif +#else +//Pintool data +#define RTE_PWM_TMR_EXT_TRIG_2_PORT PWM_TMR_EXT_TRIG_2_PORT +#if (PWM_EXTTRIG2_LOC == 26) +#define RTE_PWM_TMR_EXT_TRIG_2_PIN PWM_TMR_EXT_TRIG_2_PIN +#define RTE_PWM_TMR_EXT_TRIG_2_MUX 10 +#define RTE_PWM_TMR_EXT_TRIG_2_PAD 0 //no pad +#endif +#if (PWM_EXTTRIG2_LOC == 27) +#define RTE_PWM_TMR_EXT_TRIG_2_PIN PWM_TMR_EXT_TRIG_2_PIN +#define RTE_PWM_TMR_EXT_TRIG_2_MUX 8 +#define RTE_PWM_TMR_EXT_TRIG_2_PAD 18 +#endif +#if (PWM_EXTTRIG2_LOC == 28) //Combination not available in pin mux +#define RTE_PWM_TMR_EXT_TRIG_2_PIN (PWM_TMR_EXT_TRIG_2_PIN + GPIO_MAX_PIN) +#define RTE_PWM_TMR_EXT_TRIG_2_MUX 10 +#define RTE_PWM_TMR_EXT_TRIG_2_PAD 29 +#endif +#if (PWM_EXTTRIG2_LOC == 29) +#define RTE_PWM_TMR_EXT_TRIG_2_PIN (PWM_TMR_EXT_TRIG_2_PIN + GPIO_MAX_PIN) +#define RTE_PWM_TMR_EXT_TRIG_2_MUX 10 +#define RTE_PWM_TMR_EXT_TRIG_2_PAD 29 +#endif +//Pintool data +#endif + +//PWM_TMR_EXT_TRIG_3 +//Pintool data +#define RTE_PWM_TMR_EXT_TRIG_3_PORT PWM_TMR_EXT_TRIG_3_PORT +#if (PWM_EXTTRIG3_LOC == 30) +#define RTE_PWM_TMR_EXT_TRIG_3_PIN PWM_TMR_EXT_TRIG_3_PIN +#define RTE_PWM_TMR_EXT_TRIG_3_MUX 10 +#define RTE_PWM_TMR_EXT_TRIG_3_PAD 0 //no pad +#endif +#if (PWM_EXTTRIG3_LOC == 31) +#define RTE_PWM_TMR_EXT_TRIG_3_PIN PWM_TMR_EXT_TRIG_3_PIN +#define RTE_PWM_TMR_EXT_TRIG_3_MUX 8 +#define RTE_PWM_TMR_EXT_TRIG_3_PAD 19 +#endif +#if (PWM_EXTTRIG3_LOC == 32) +#define RTE_PWM_TMR_EXT_TRIG_3_PIN (PWM_TMR_EXT_TRIG_3_PIN + GPIO_MAX_PIN) +#define RTE_PWM_TMR_EXT_TRIG_3_MUX 10 +#define RTE_PWM_TMR_EXT_TRIG_3_PAD 30 +#endif +//Pintool data + +//PWM_TMR_EXT_TRIG_4 +//Pintool data +#define RTE_PWM_TMR_EXT_TRIG_4_PORT PWM_TMR_EXT_TRIG_4_PORT +#if (PWM_EXTTRIG4_LOC == 33) +#define RTE_PWM_TMR_EXT_TRIG_4_PIN PWM_TMR_EXT_TRIG_4_PIN +#define RTE_PWM_TMR_EXT_TRIG_4_MUX 10 +#define RTE_PWM_TMR_EXT_TRIG_4_PAD 0 //no pad +#endif +#if (PWM_EXTTRIG4_LOC == 34) +#define RTE_PWM_TMR_EXT_TRIG_4_PIN PWM_TMR_EXT_TRIG_4_PIN +#define RTE_PWM_TMR_EXT_TRIG_4_MUX 8 +#define RTE_PWM_TMR_EXT_TRIG_4_PAD 14 +#endif +#if (PWM_EXTTRIG4_LOC == 35) +#define RTE_PWM_TMR_EXT_TRIG_4_PIN (PWM_TMR_EXT_TRIG_4_PIN + GPIO_MAX_PIN) +#define RTE_PWM_TMR_EXT_TRIG_4_MUX 10 +#define RTE_PWM_TMR_EXT_TRIG_4_PAD 31 +#endif +//Pintool data + +//<> QEI (Quadrature Encode Interface) + +//QEI_DIR <0=>GPIO_28 <1=>GPIO_49 <2=>GPIO_57 <3=>GPIO_67 <4=>GPIO_71 <5=>GPIO_73 <6=>GPIO_11 <7=>GPIO_34 + +#define RTE_QEI_DIR_PORT_ID 4 + +#if (RTE_QEI_DIR_PORT_ID == 0) +#define RTE_QEI_DIR_PORT 0 +#define RTE_QEI_DIR_PIN 28 +#define RTE_QEI_DIR_MUX 5 +#define RTE_QEI_DIR_PAD 0 //no pad +#elif (RTE_QEI_DIR_PORT_ID == 1) +#define RTE_QEI_DIR_PORT 0 +#define RTE_QEI_DIR_PIN 49 +#define RTE_QEI_DIR_MUX 3 +#define RTE_QEI_DIR_PAD 13 +#elif (RTE_QEI_DIR_PORT_ID == 2) +#define RTE_QEI_DIR_PORT 0 +#define RTE_QEI_DIR_PIN 57 +#define RTE_QEI_DIR_MUX 5 +#define RTE_QEI_DIR_PAD 21 +#elif (RTE_QEI_DIR_PORT_ID == 3) +#define RTE_QEI_DIR_PORT 0 +#define RTE_QEI_DIR_PIN 67 +#define RTE_QEI_DIR_MUX 3 +#define RTE_QEI_DIR_PAD 25 +#elif (RTE_QEI_DIR_PORT_ID == 4) +#define RTE_QEI_DIR_PORT 0 +#define RTE_QEI_DIR_PIN 71 +#define RTE_QEI_DIR_MUX 3 +#define RTE_QEI_DIR_PAD 29 +#elif (RTE_QEI_DIR_PORT_ID == 5) +#define RTE_QEI_DIR_PORT 0 +#define RTE_QEI_DIR_PIN 73 +#define RTE_QEI_DIR_MUX 3 +#define RTE_QEI_DIR_PAD 31 +#else +#error "Invalid RTE_QEI_DIR_PIN Pin Configuration!" +#endif + +//QEI_IDX <0=>GPIO_25 <1=>GPIO_46 <2=>GPIO_52 <3=>GPIO_64 <4=>GPIO_68 <5=>GPIO_72 <6=>GPIO_8 <7=>GPIO_13 + +#define RTE_QEI_IDX_PORT_ID 3 + +#if (RTE_QEI_IDX_PORT_ID == 0) +#define RTE_QEI_IDX_PORT 0 +#define RTE_QEI_IDX_PIN 25 +#define RTE_QEI_IDX_MUX 5 +#define RTE_QEI_IDX_PAD 0 //no pad +#elif (RTE_QEI_IDX_PORT_ID == 1) +#define RTE_QEI_IDX_PORT 0 +#define RTE_QEI_IDX_PIN 46 +#define RTE_QEI_IDX_MUX 3 +#define RTE_QEI_IDX_PAD 10 +#elif (RTE_QEI_IDX_PORT_ID == 2) +#define RTE_QEI_IDX_PORT 0 +#define RTE_QEI_IDX_PIN 52 +#define RTE_QEI_IDX_MUX 5 +#define RTE_QEI_IDX_PAD 16 +#elif (RTE_QEI_IDX_PORT_ID == 3) +#define RTE_QEI_IDX_PORT 0 +#define RTE_QEI_IDX_PIN 72 +#define RTE_QEI_IDX_MUX 3 +#define RTE_QEI_IDX_PAD 30 +#else +#error "Invalid RTE_QEI_IDX_PIN Pin Configuration!" +#endif + +//QEI_PHA <0=>GPIO_26 <1=>GPIO_47 <2=>GPIO_53 <3=>GPIO_65 <4=>GPIO_69 <5=>GPIO_73 <6=>GPIO_9 <7=>GPIO_32 + +#ifdef SLI_SI91X_MCU_CONFIG_RADIO_BOARD_BASE_VER +#define RTE_QEI_PHA_PORT_ID 3 +#else +#define RTE_QEI_PHA_PORT_ID 5 +#endif + +#if (RTE_QEI_PHA_PORT_ID == 0) +#define RTE_QEI_PHA_PORT 0 +#define RTE_QEI_PHA_PIN 26 +#define RTE_QEI_PHA_MUX 5 +#define RTE_QEI_PHA_PAD 0 //no pad +#elif (RTE_QEI_PHA_PORT_ID == 1) +#define RTE_QEI_PHA_PORT 0 +#define RTE_QEI_PHA_PIN 47 +#define RTE_QEI_PHA_MUX 3 +#define RTE_QEI_PHA_PAD 11 +#elif (RTE_QEI_PHA_PORT_ID == 2) +#define RTE_QEI_PHA_PORT 0 +#define RTE_QEI_PHA_PIN 53 +#define RTE_QEI_PHA_MUX 5 +#define RTE_QEI_PHA_PAD 17 +#elif (RTE_QEI_PHA_PORT_ID == 3) +#define RTE_QEI_PHA_PORT 0 +#define RTE_QEI_PHA_PIN 65 +#define RTE_QEI_PHA_MUX 3 +#define RTE_QEI_PHA_PAD 23 +#elif (RTE_QEI_PHA_PORT_ID == 4) +#define RTE_QEI_PHA_PORT 0 +#define RTE_QEI_PHA_PIN 73 +#define RTE_QEI_PHA_MUX 3 +#define RTE_QEI_PHA_PAD 31 +#else +#error "Invalid RTE_QEI_PHA_PIN Pin Configuration!" +#endif + +//QEI_PHB <0=>GPIO_27 <1=>GPIO_48 <1=>GPIO_56 <1=>GPIO_66 <1=>GPIO_70 <1=>GPIO_74 <7=>GPIO_33 + +#ifdef SLI_SI91X_MCU_CONFIG_RADIO_BOARD_BASE_VER +#define RTE_QEI_PHB_PORT_ID 5 +#else +#define RTE_QEI_PHB_PORT_ID 4 +#endif + +#if (RTE_QEI_PHB_PORT_ID == 0) +#define RTE_QEI_PHB_PORT 0 +#define RTE_QEI_PHB_PIN 27 +#define RTE_QEI_PHB_MUX 5 +#define RTE_QEI_PHB_PAD 0 //no pad +#elif (RTE_QEI_PHB_PORT_ID == 1) +#define RTE_QEI_PHB_PORT 0 +#define RTE_QEI_PHB_PIN 48 +#define RTE_QEI_PHB_MUX 3 +#define RTE_QEI_PHB_PAD 12 +#elif (RTE_QEI_PHB_PORT_ID == 2) +#define RTE_QEI_PHB_PORT 0 +#define RTE_QEI_PHB_PIN 56 +#define RTE_QEI_PHB_MUX 5 +#define RTE_QEI_PHB_PAD 20 +#elif (RTE_QEI_PHB_PORT_ID == 3) +#define RTE_QEI_PHB_PORT 0 +#define RTE_QEI_PHB_PIN 66 +#define RTE_QEI_PHB_MUX 3 +#define RTE_QEI_PHB_PAD 24 +#elif (RTE_QEI_PHB_PORT_ID == 4) +#define RTE_QEI_PHB_PORT 0 +#define RTE_QEI_PHB_PIN 70 +#define RTE_QEI_PHB_MUX 3 +#define RTE_QEI_PHB_PAD 28 +#elif (RTE_QEI_PHB_PORT_ID == 5) +#define RTE_QEI_PHB_PORT 0 +#define RTE_QEI_PHB_PIN 74 +#define RTE_QEI_PHB_MUX 3 +#define RTE_QEI_PHB_PAD 32 +#else +#error "Invalid RTE_QEI_PHB_PIN Pin Configuration!" +#endif + +#endif + +//ADC START + +#ifndef ADC_P0_LOC +#define RTE_ADC_P0_PORT 0 +#define RTE_ADC_P0_PIN 0 +#else +#define RTE_ADC_P0_PORT ADC_P0_PORT +#define RTE_ADC_P0_PIN ADC_P0_PIN +#endif +#define RTE_ADC_P0_MUX 1 + +#ifndef ADC_N0_LOC +#define RTE_ADC_N0_PORT 0 +#define RTE_ADC_N0_PIN 1 +#else +#define RTE_ADC_N0_PORT ADC_N0_PORT +#define RTE_ADC_N0_PIN ADC_N0_PIN +#endif +#define RTE_ADC_N0_MUX 1 + +#ifndef ADC_P1_LOC +#define RTE_ADC_P1_PORT 0 +#define RTE_ADC_P1_PIN 2 +#else +#define RTE_ADC_P1_PORT ADC_P1_PORT +#define RTE_ADC_P1_PIN ADC_P1_PIN +#endif +#define RTE_ADC_P1_MUX 1 + +#ifndef ADC_N1_LOC +#define RTE_ADC_N1_PORT 0 +#define RTE_ADC_N1_PIN 3 +#else +#define RTE_ADC_N1_PORT ADC_N1_PORT +#define RTE_ADC_N1_PIN ADC_N1_PIN +#endif +#define RTE_ADC_N1_MUX 1 + +#ifndef ADC_P2_LOC +#define RTE_ADC_P2_PORT 0 +#define RTE_ADC_P2_PIN 4 +#else +#define RTE_ADC_P2_PORT ADC_P2_PORT +#define RTE_ADC_P2_PIN ADC_P2_PIN +#endif +#define RTE_ADC_P2_MUX 1 + +#ifndef ADC_N2_LOC +#define RTE_ADC_N2_PORT 0 +#define RTE_ADC_N2_PIN 5 +#else +#define RTE_ADC_N2_PORT ADC_N2_PORT +#define RTE_ADC_N2_PIN ADC_N2_PIN +#endif +#define RTE_ADC_N2_MUX 1 + +#ifndef ADC_P3_LOC +#define RTE_ADC_P3_PORT 0 +#define RTE_ADC_P3_PIN 6 +#else +#define RTE_ADC_P3_PORT ADC_P3_PORT +#define RTE_ADC_P3_PIN ADC_P3_PIN +#endif +#define RTE_ADC_P3_MUX 1 + +#ifndef ADC_N3_LOC +#define RTE_ADC_N3_PORT 0 +#define RTE_ADC_N3_PIN 11 +#else +#define RTE_ADC_N3_PORT ADC_N3_PORT +#define RTE_ADC_N3_PIN ADC_N3_PIN +#endif +#define RTE_ADC_N3_MUX 1 + +#ifndef ADC_P4_LOC +#define RTE_ADC_P4_PORT 0 +#define RTE_ADC_P4_PIN 8 +#else +#define RTE_ADC_P4_PORT ADC_P4_PORT +#define RTE_ADC_P4_PIN ADC_P4_PIN +#endif +#define RTE_ADC_P4_MUX 1 + +#ifndef ADC_N4_LOC +#define RTE_ADC_N4_PORT 0 +#define RTE_ADC_N4_PIN 9 +#else +#define RTE_ADC_N4_PORT ADC_N4_PORT +#define RTE_ADC_N4_PIN ADC_N4_PIN +#endif +#define RTE_ADC_N4_MUX 1 + +#ifndef ADC_P5_LOC +#define RTE_ADC_P5_PORT 0 +#define RTE_ADC_P5_PIN 10 +#else +#define RTE_ADC_P5_PORT ADC_P5_PORT +#define RTE_ADC_P5_PIN ADC_P5_PIN +#endif +#define RTE_ADC_P5_MUX 1 + +#ifndef ADC_N5_LOC +#define RTE_ADC_N5_PORT 0 +#define RTE_ADC_N5_PIN 7 +#else +#define RTE_ADC_N5_PORT ADC_N5_PORT +#define RTE_ADC_N5_PIN ADC_N5_PIN +#endif +#define RTE_ADC_N5_MUX 1 + +#ifndef ADC_P6_LOC +#define RTE_ADC_P6_PORT 0 +#define RTE_ADC_P6_PIN 25 +#else +#define RTE_ADC_P6_PORT ADC_P6_PORT +#define RTE_ADC_P6_PIN ADC_P6_PIN +#endif +#define RTE_ADC_P6_MUX 1 +#define RTE_ADC_P6_PAD 0 + +#ifndef ADC_N6_LOC +#define RTE_ADC_N6_PORT 0 +#define RTE_ADC_N6_PIN 26 +#else +#define RTE_ADC_N6_PORT ADC_N6_PORT +#define RTE_ADC_N6_PIN ADC_N6_PIN +#endif +#define RTE_ADC_N6_MUX 1 +#define RTE_ADC_N6_PAD 0 + +#ifndef ADC_P7_LOC +#define RTE_ADC_P7_PORT 0 +#define RTE_ADC_P7_PIN 27 +#else +#define RTE_ADC_P7_PORT ADC_P7_PORT +#define RTE_ADC_P7_PIN ADC_P7_PIN +#endif +#define RTE_ADC_P7_MUX 1 +#define RTE_ADC_P7_PAD 0 + +#ifndef ADC_N7_LOC +#define RTE_ADC_N7_PORT 0 +#define RTE_ADC_N7_PIN 28 +#else +#define RTE_ADC_N7_PORT ADC_N7_PORT +#define RTE_ADC_N7_PIN ADC_N7_PIN +#endif +#define RTE_ADC_N7_MUX 1 +#define RTE_ADC_N7_PAD 0 + +#ifndef ADC_P8_LOC +#define RTE_ADC_P8_PORT 0 +#define RTE_ADC_P8_PIN 29 +#else +#define RTE_ADC_P8_PORT ADC_P8_PORT +#define RTE_ADC_P8_PIN ADC_P8_PIN +#endif +#define RTE_ADC_P8_MUX 1 +#define RTE_ADC_P8_PAD 0 + +#ifndef ADC_N8_LOC +#define RTE_ADC_N8_PORT 0 +#define RTE_ADC_N8_PIN 30 +#else +#define RTE_ADC_N8_PORT ADC_N8_PORT +#define RTE_ADC_N8_PIN ADC_N8_PIN +#endif +#define RTE_ADC_N8_MUX 1 +#define RTE_ADC_N8_PAD 0 + +#ifndef ADC_P10_LOC +#define RTE_ADC_P10_PORT 0 +#define RTE_ADC_P10_PIN 1 +#else +#define RTE_ADC_P10_PORT ADC_P10_PORT +#define RTE_ADC_P10_PIN ADC_P10_PIN +#endif +#define RTE_ADC_P10_MUX 1 + +#ifndef ADC_P11_LOC +#define RTE_ADC_P11_PORT 0 +#define RTE_ADC_P11_PIN 3 +#else +#define RTE_ADC_P11_PORT ADC_P11_PORT +#define RTE_ADC_P11_PIN ADC_P11_PIN +#endif +#define RTE_ADC_P11_MUX 1 + +#ifndef ADC_P12_LOC +#define RTE_ADC_P12_PORT 0 +#define RTE_ADC_P12_PIN 5 +#else +#define RTE_ADC_P12_PORT ADC_P12_PORT +#define RTE_ADC_P12_PIN ADC_P12_PIN +#endif +#define RTE_ADC_P12_MUX 1 + +#ifndef ADC_P13_LOC +#define RTE_ADC_P13_PORT 0 +#define RTE_ADC_P13_PIN 11 +#else +#define RTE_ADC_P13_PORT ADC_P13_PORT +#define RTE_ADC_P13_PIN ADC_P13_PIN +#endif +#define RTE_ADC_P13_MUX 1 + +#ifndef ADC_P14_LOC +#define RTE_ADC_P14_PORT 0 +#define RTE_ADC_P14_PIN 9 +#else +#define RTE_ADC_P14_PORT ADC_P14_PORT +#define RTE_ADC_P14_PIN ADC_P14_PIN +#endif +#define RTE_ADC_P14_MUX 1 + +#ifndef ADC_P15_LOC +#define RTE_ADC_P15_PORT 0 +#define RTE_ADC_P15_PIN 7 +#else +#define RTE_ADC_P15_PORT ADC_P15_PORT +#define RTE_ADC_P15_PIN ADC_P15_PIN +#endif +#define RTE_ADC_P15_MUX 1 + +#ifndef ADC_P16_LOC +#define RTE_ADC_P16_PORT 0 +#define RTE_ADC_P16_PIN 26 +#else +#define RTE_ADC_P16_PORT ADC_P16_PORT +#define RTE_ADC_P16_PIN ADC_P16_PIN +#endif +#define RTE_ADC_P16_MUX 1 +#define RTE_ADC_P16_PAD 0 + +#ifndef ADC_P17_LOC +#define RTE_ADC_P17_PORT 0 +#define RTE_ADC_P17_PIN 28 +#else +#define RTE_ADC_P17_PORT ADC_P17_PORT +#define RTE_ADC_P17_PIN ADC_P17_PIN +#endif +#define RTE_ADC_P17_MUX 1 +#define RTE_ADC_P17_PAD 0 + +#ifndef ADC_P18_LOC +#define RTE_ADC_P18_PORT 0 +#define RTE_ADC_P18_PIN 30 +#else +#define RTE_ADC_P18_PORT ADC_P18_PORT +#define RTE_ADC_P18_PIN ADC_P18_PIN +#endif +#define RTE_ADC_P18_MUX 1 +#define RTE_ADC_P18_PAD 0 + +//ADC END + +//COMPARATOR START + +#ifndef COMP1_P0_LOC +#define RTE_COMP1_P0_PORT 0 +#define RTE_COMP1_P0_PIN 0 +#else +#define RTE_COMP1_P0_PORT COMP1_P0_PORT +#define RTE_COMP1_P0_PIN COMP1_P0_PIN +#endif +#define RTE_COMP1_P0_MUX 0 + +#ifndef COMP1_N0_LOC +#define RTE_COMP1_N0_PORT 0 +#define RTE_COMP1_N0_PIN 1 +#else +#define RTE_COMP1_N0_PORT COMP1_N0_PORT +#define RTE_COMP1_N0_PIN COMP1_N0_PIN +#endif +#define RTE_COMP1_N0_MUX 0 + +#ifndef COMP1_P1_LOC +#define RTE_COMP1_P1_PORT 0 +#define RTE_COMP1_P1_PIN 5 +#else +#define RTE_COMP1_P1_PORT COMP1_P1_PORT +#define RTE_COMP1_P1_PIN COMP1_P1_PIN +#endif +#define RTE_COMP1_P1_MUX 0 + +#ifndef COMP1_N1_LOC +#define RTE_COMP1_N1_PORT 0 +#define RTE_COMP1_N1_PIN 4 +#else +#define RTE_COMP1_N1_PORT COMP1_N1_PORT +#define RTE_COMP1_N1_PIN COMP1_N1_PIN +#endif +#define RTE_COMP1_N1_MUX 0 + +#ifndef COMP2_P0_LOC +#define RTE_COMP2_P0_PORT 0 +#define RTE_COMP2_P0_PIN 2 +#else +#define RTE_COMP2_P0_PORT COMP2_P0_PORT +#define RTE_COMP2_P0_PIN COMP2_P0_PIN +#endif +#define RTE_COMP2_P0_MUX 0 + +#ifndef COMP2_N0_LOC +#define RTE_COMP2_N0_PORT 0 +#define RTE_COMP2_N0_PIN 3 +#else +#define RTE_COMP2_N0_PORT COMP2_N0_PORT +#define RTE_COMP2_N0_PIN COMP2_N0_PIN +#endif +#define RTE_COMP2_N0_MUX 0 + +#ifndef COMP2_P1_LOC +#define RTE_COMP2_P1_PORT 0 +#define RTE_COMP2_P1_PIN 27 +#else +#define RTE_COMP2_P1_PORT COMP2_P1_PORT +#define RTE_COMP2_P1_PIN COMP2_P1_PIN +#endif +#define RTE_COMP2_P1_MUX 0 +#define RTE_COMP2_P1_PAD 0 + +#ifndef COMP2_N1_LOC +#define RTE_COMP2_N1_PORT 0 +#define RTE_COMP2_N1_PIN 28 +#else +#define RTE_COMP2_N1_PORT COMP2_N1_PORT +#define RTE_COMP2_N1_PIN COMP2_N1_PIN +#endif +#define RTE_COMP2_N1_MUX 0 + +//COMPARATOR END + +#define RTE_GPIO_6_PORT 0 +#define RTE_GPIO_6_PAD 1 +#define RTE_GPIO_6_PIN 6 +#define RTE_GPIO_6_MODE 0 + +#define RTE_GPIO_7_PORT 0 +#define RTE_GPIO_7_PAD 2 +#define RTE_GPIO_7_PIN 7 +#define RTE_GPIO_7_MODE 0 + +#define RTE_GPIO_8_PORT 0 +#define RTE_GPIO_8_PAD 3 +#define RTE_GPIO_8_PIN 8 +#define RTE_GPIO_8_MODE 0 + +#define RTE_GPIO_9_PORT 0 +#define RTE_GPIO_9_PAD 4 +#define RTE_GPIO_9_PIN 9 +#define RTE_GPIO_9_MODE 0 + +#define RTE_GPIO_10_PORT 0 +#define RTE_GPIO_10_PAD 5 +#define RTE_GPIO_10_PIN 10 +#define RTE_GPIO_10_MODE 0 + +#define RTE_GPIO_11_PORT 0 +#define RTE_GPIO_11_PAD 6 +#define RTE_GPIO_11_PIN 11 +#define RTE_GPIO_11_MODE 0 + +#define RTE_GPIO_12_PORT 0 +#define RTE_GPIO_12_PAD 7 +#define RTE_GPIO_12_PIN 12 +#define RTE_GPIO_12_MODE 0 + +#define RTE_GPIO_15_PORT 0 +#define RTE_GPIO_15_PAD 8 +#define RTE_GPIO_15_PIN 15 +#define RTE_GPIO_15_MODE 0 + +#define RTE_GPIO_25_PORT 0 +#define RTE_GPIO_25_PIN 25 +#define RTE_GPIO_25_MODE 0 + +#define RTE_GPIO_26_PORT 0 +#define RTE_GPIO_26_PIN 26 +#define RTE_GPIO_26_MODE 0 + +#define RTE_GPIO_27_PORT 0 +#define RTE_GPIO_27_PIN 27 +#define RTE_GPIO_27_MODE 0 + +#define RTE_GPIO_28_PORT 0 +#define RTE_GPIO_28_PIN 28 +#define RTE_GPIO_28_MODE 0 + +#define RTE_GPIO_29_PORT 0 +#define RTE_GPIO_29_PIN 29 +#define RTE_GPIO_29_MODE 0 + +#define RTE_GPIO_30_PORT 0 +#define RTE_GPIO_30_PIN 30 +#define RTE_GPIO_30_MODE 0 + +#define RTE_GPIO_31_PORT 0 +#define RTE_GPIO_31_PAD 9 +#define RTE_GPIO_31_PIN 31 +#define RTE_GPIO_31_MODE 0 + +#define RTE_GPIO_32_PORT 0 +#define RTE_GPIO_32_PAD 9 +#define RTE_GPIO_32_PIN 32 +#define RTE_GPIO_32_MODE 0 + +#define RTE_GPIO_33_PORT 0 +#define RTE_GPIO_33_PAD 9 +#define RTE_GPIO_33_PIN 33 +#define RTE_GPIO_33_MODE 0 + +#define RTE_GPIO_34_PORT 0 +#define RTE_GPIO_34_PAD 9 +#define RTE_GPIO_34_PIN 34 +#define RTE_GPIO_34_MODE 0 + +#define RTE_GPIO_46_PORT 0 +#define RTE_GPIO_46_PAD 10 +#define RTE_GPIO_46_PIN 46 +#define RTE_GPIO_46_MODE 0 + +#define RTE_GPIO_47_PORT 0 +#define RTE_GPIO_47_PAD 11 +#define RTE_GPIO_47_PIN 47 +#define RTE_GPIO_47_MODE 0 + +#define RTE_GPIO_48_PORT 0 +#define RTE_GPIO_48_PAD 12 +#define RTE_GPIO_48_PIN 48 +#define RTE_GPIO_48_MODE 0 + +#define RTE_GPIO_49_PORT 0 +#define RTE_GPIO_49_PAD 13 +#define RTE_GPIO_49_PIN 49 +#define RTE_GPIO_49_MODE 0 + +#define RTE_GPIO_50_PORT 0 +#define RTE_GPIO_50_PAD 14 +#define RTE_GPIO_50_PIN 50 +#define RTE_GPIO_50_MODE 0 + +#define RTE_GPIO_51_PORT 0 +#define RTE_GPIO_51_PAD 15 +#define RTE_GPIO_51_PIN 51 +#define RTE_GPIO_51_MODE 0 + +#define RTE_GPIO_52_PORT 0 +#define RTE_GPIO_52_PAD 16 +#define RTE_GPIO_52_PIN 52 +#define RTE_GPIO_52_MODE 0 + +#define RTE_GPIO_53_PORT 0 +#define RTE_GPIO_53_PAD 17 +#define RTE_GPIO_53_PIN 53 +#define RTE_GPIO_53_MODE 0 + +#define RTE_GPIO_54_PORT 0 +#define RTE_GPIO_54_PAD 18 +#define RTE_GPIO_54_PIN 54 +#define RTE_GPIO_54_MODE 0 + +#define RTE_GPIO_55_PORT 0 +#define RTE_GPIO_55_PAD 19 +#define RTE_GPIO_55_PIN 55 +#define RTE_GPIO_55_MODE 0 + +#define RTE_GPIO_56_PORT 0 +#define RTE_GPIO_56_PAD 20 +#define RTE_GPIO_56_PIN 56 +#define RTE_GPIO_56_MODE 0 + +#define RTE_GPIO_57_PORT 0 +#define RTE_GPIO_57_PAD 21 +#define RTE_GPIO_57_PIN 57 +#define RTE_GPIO_57_MODE 0 + +#ifdef SLI_SI91X_MCU_CONFIG_RADIO_BOARD_BASE_VER +#define RTE_ULP_GPIO_0_PORT_ID 1 +#else +#define RTE_ULP_GPIO_0_PORT_ID 0 +#endif + +#if (RTE_ULP_GPIO_0_PORT_ID == 0) +#define RTE_ULP_GPIO_0_PORT 0 +#define RTE_ULP_GPIO_0_PAD 22 +#define RTE_ULP_GPIO_0_PIN 64 +#define RTE_ULP_GPIO_0_MODE 0 +#elif (RTE_ULP_GPIO_0_PORT_ID == 1) +#define RTE_ULP_GPIO_0_PORT 4 +#define RTE_ULP_GPIO_0_PIN 0 +#define RTE_ULP_GPIO_0_MODE 0 +#else +#error "Invalid RTE_ULP_GPIO_0_PIN Pin Configuration!" +#endif + +#ifdef SLI_SI91X_MCU_CONFIG_RADIO_BOARD_BASE_VER +#define RTE_ULP_GPIO_1_PORT_ID 1 +#else +#define RTE_ULP_GPIO_1_PORT_ID 0 +#endif + +#if (RTE_ULP_GPIO_1_PORT_ID == 0) +#define RTE_ULP_GPIO_1_PORT 0 +#define RTE_ULP_GPIO_1_PAD 23 +#define RTE_ULP_GPIO_1_PIN 65 +#define RTE_ULP_GPIO_1_MODE 0 +#elif (RTE_ULP_GPIO_1_PORT_ID == 1) +#define RTE_ULP_GPIO_1_PORT 4 +#define RTE_ULP_GPIO_1_PIN 1 +#define RTE_ULP_GPIO_1_MODE 0 +#else +#error "Invalid RTE_ULP_GPIO_1_PIN Pin Configuration!" +#endif + +#ifdef SLI_SI91X_MCU_CONFIG_RADIO_BOARD_BASE_VER +#define RTE_ULP_GPIO_2_PORT_ID 1 +#else +#define RTE_ULP_GPIO_2_PORT_ID 0 +#endif + +#if (RTE_ULP_GPIO_2_PORT_ID == 0) +#define RTE_ULP_GPIO_2_PORT 0 +#define RTE_ULP_GPIO_2_PAD 24 +#define RTE_ULP_GPIO_2_PIN 66 +#define RTE_ULP_GPIO_2_MODE 0 +#elif (RTE_ULP_GPIO_2_PORT_ID == 1) +#define RTE_ULP_GPIO_2_PORT 4 +#define RTE_ULP_GPIO_2_PIN 2 +#define RTE_ULP_GPIO_2_MODE 0 +#else +#error "Invalid RTE_ULP_GPIO_2_PIN Pin Configuration!" +#endif + +#ifdef SLI_SI91X_MCU_CONFIG_RADIO_BOARD_BASE_VER +#define RTE_ULP_GPIO_3_PORT_ID 1 +#else +#define RTE_ULP_GPIO_3_PORT_ID 0 +#endif + +#if (RTE_ULP_GPIO_3_PORT_ID == 0) +#define RTE_ULP_GPIO_3_PORT 0 +#define RTE_ULP_GPIO_3_PAD 25 +#define RTE_ULP_GPIO_3_PIN 67 +#define RTE_ULP_GPIO_3_MODE 0 +#elif (RTE_ULP_GPIO_3_PORT_ID == 1) +#define RTE_ULP_GPIO_3_PORT 4 +#define RTE_ULP_GPIO_3_PIN 3 +#define RTE_ULP_GPIO_3_MODE 0 +#else +#error "Invalid RTE_ULP_GPIO_3_PIN Pin Configuration!" +#endif + +#ifdef SLI_SI91X_MCU_CONFIG_RADIO_BOARD_BASE_VER +#define RTE_ULP_GPIO_4_PORT_ID 1 +#else +#define RTE_ULP_GPIO_4_PORT_ID 0 +#endif + +#if (RTE_ULP_GPIO_4_PORT_ID == 0) +#define RTE_ULP_GPIO_4_PORT 0 +#define RTE_ULP_GPIO_4_PAD 26 +#define RTE_ULP_GPIO_4_PIN 68 +#define RTE_ULP_GPIO_4_MODE 0 +#elif (RTE_ULP_GPIO_4_PORT_ID == 1) +#define RTE_ULP_GPIO_4_PORT 4 +#define RTE_ULP_GPIO_4_PIN 4 +#define RTE_ULP_GPIO_4_MODE 0 +#else +#error "Invalid RTE_ULP_GPIO_4_PIN Pin Configuration!" +#endif + +#ifdef SLI_SI91X_MCU_CONFIG_RADIO_BOARD_BASE_VER +#define RTE_ULP_GPIO_5_PORT_ID 1 +#else +#define RTE_ULP_GPIO_5_PORT_ID 0 +#endif + +#if (RTE_ULP_GPIO_5_PORT_ID == 0) +#define RTE_ULP_GPIO_5_PORT 4 +#define RTE_ULP_GPIO_5_PAD 27 +#define RTE_ULP_GPIO_5_PIN 69 +#define RTE_ULP_GPIO_5_MODE 0 +#elif (RTE_ULP_GPIO_5_PORT_ID == 1) +#define RTE_ULP_GPIO_5_PORT 4 +#define RTE_ULP_GPIO_5_PIN 5 +#define RTE_ULP_GPIO_5_MODE 0 +#else +#error "Invalid RTE_ULP_GPIO_5_PIN Pin Configuration!" +#endif + +#ifdef SLI_SI91X_MCU_CONFIG_RADIO_BOARD_BASE_VER +#define RTE_ULP_GPIO_6_PORT_ID 1 +#else +#define RTE_ULP_GPIO_6_PORT_ID 0 +#endif + +#if (RTE_ULP_GPIO_6_PORT_ID == 0) +#define RTE_ULP_GPIO_6_PORT 4 +#define RTE_ULP_GPIO_6_PAD 28 +#define RTE_ULP_GPIO_6_PIN 70 +#define RTE_ULP_GPIO_6_MODE 0 +#elif (RTE_ULP_GPIO_6_PORT_ID == 1) +#define RTE_ULP_GPIO_6_PORT 4 +#define RTE_ULP_GPIO_6_PIN 6 +#define RTE_ULP_GPIO_6_MODE 0 +#else +#error "Invalid RTE_ULP_GPIO_6_PIN Pin Configuration!" +#endif + +#ifdef SLI_SI91X_MCU_CONFIG_RADIO_BOARD_BASE_VER +#define RTE_ULP_GPIO_7_PORT_ID 1 +#else +#define RTE_ULP_GPIO_7_PORT_ID 0 +#endif + +#if (RTE_ULP_GPIO_7_PORT_ID == 0) +#define RTE_ULP_GPIO_7_PORT 4 +#define RTE_ULP_GPIO_7_PAD 29 +#define RTE_ULP_GPIO_7_PIN 71 +#define RTE_ULP_GPIO_7_MODE 0 +#elif (RTE_ULP_GPIO_7_PORT_ID == 1) +#define RTE_ULP_GPIO_7_PORT 4 +#define RTE_ULP_GPIO_7_PIN 7 +#define RTE_ULP_GPIO_7_MODE 0 +#else +#error "Invalid RTE_ULP_GPIO_7_PIN Pin Configuration!" +#endif + +#ifdef SLI_SI91X_MCU_CONFIG_RADIO_BOARD_BASE_VER +#define RTE_ULP_GPIO_8_PORT_ID 1 +#else +#define RTE_ULP_GPIO_8_PORT_ID 0 +#endif + +#if (RTE_ULP_GPIO_8_PORT_ID == 0) +#define RTE_ULP_GPIO_8_PORT 4 +#define RTE_ULP_GPIO_8_PAD 30 +#define RTE_ULP_GPIO_8_PIN 72 +#define RTE_ULP_GPIO_8_MODE 0 +#elif (RTE_ULP_GPIO_8_PORT_ID == 1) +#define RTE_ULP_GPIO_8_PORT 4 +#define RTE_ULP_GPIO_8_PIN 8 +#define RTE_ULP_GPIO_8_MODE 0 +#else +#error "Invalid RTE_ULP_GPIO_8_PIN Pin Configuration!" +#endif + +#ifdef SLI_SI91X_MCU_CONFIG_RADIO_BOARD_BASE_VER +#define RTE_ULP_GPIO_9_PORT_ID 1 +#else +#define RTE_ULP_GPIO_9_PORT_ID 0 +#endif + +#if (RTE_ULP_GPIO_9_PORT_ID == 0) +#define RTE_ULP_GPIO_9_PORT 4 +#define RTE_ULP_GPIO_9_PAD 31 +#define RTE_ULP_GPIO_9_PIN 73 +#define RTE_ULP_GPIO_9_MODE 0 +#elif (RTE_ULP_GPIO_9_PORT_ID == 1) +#define RTE_ULP_GPIO_9_PORT 4 +#define RTE_ULP_GPIO_9_PIN 9 +#define RTE_ULP_GPIO_9_MODE 0 +#else +#error "Invalid RTE_ULP_GPIO_9_PIN Pin Configuration!" +#endif + +#ifdef SLI_SI91X_MCU_CONFIG_RADIO_BOARD_BASE_VER +#define RTE_ULP_GPIO_10_PORT_ID 1 +#else +#define RTE_ULP_GPIO_10_PORT_ID 0 +#endif + +#if (RTE_ULP_GPIO_10_PORT_ID == 0) +#define RTE_ULP_GPIO_10_PORT 4 +#define RTE_ULP_GPIO_10_PAD 32 +#define RTE_ULP_GPIO_10_PIN 74 +#define RTE_ULP_GPIO_10_MODE 0 +#elif (RTE_ULP_GPIO_10_PORT_ID == 1) +#define RTE_ULP_GPIO_10_PORT 4 +#define RTE_ULP_GPIO_10_PIN 10 +#define RTE_ULP_GPIO_10_MODE 0 +#else +#error "Invalid RTE_ULP_GPIO_10_PIN Pin Configuration!" +#endif + +#ifdef SLI_SI91X_MCU_CONFIG_RADIO_BOARD_BASE_VER +#define RTE_ULP_GPIO_11_PORT_ID 1 +#else +#define RTE_ULP_GPIO_11_PORT_ID 0 +#endif + +#if (RTE_ULP_GPIO_11_PORT_ID == 0) +#define RTE_ULP_GPIO_11_PORT 4 +#define RTE_ULP_GPIO_11_PAD 33 +#define RTE_ULP_GPIO_11_PIN 75 +#define RTE_ULP_GPIO_11_MODE 0 +#elif (RTE_ULP_GPIO_11_PORT_ID == 1) +#define RTE_ULP_GPIO_11_PORT 4 +#define RTE_ULP_GPIO_11_PIN 11 +#define RTE_ULP_GPIO_11_MODE 0 +#else +#error "Invalid RTE_ULP_GPIO_11_PIN Pin Configuration!" +#endif + +// RTE_UULP_GPIO_x_PORT refers to port for UULP GPIO pin x +#define RTE_UULP_GPIO_0_PORT 5 +#define RTE_UULP_GPIO_0_PIN 0 +#define RTE_UULP_GPIO_0_MODE 0 + +#define RTE_UULP_GPIO_1_PORT 5 +#define RTE_UULP_GPIO_1_PIN 1 +#define RTE_UULP_GPIO_1_MODE 0 + +#define RTE_UULP_GPIO_2_PORT 5 +#define RTE_UULP_GPIO_2_PIN 2 +#define RTE_UULP_GPIO_2_MODE 0 + +#define RTE_UULP_GPIO_3_PORT 5 +#define RTE_UULP_GPIO_3_PIN 3 +#define RTE_UULP_GPIO_3_MODE 0 + +#define RTE_UULP_GPIO_4_PORT 5 +#define RTE_UULP_GPIO_4_PIN 4 +#define RTE_UULP_GPIO_4_MODE 0 + +#define RTE_UULP_GPIO_5_PIN 5 +#define RTE_UULP_GPIO_5_MODE 0 + +// UULP GPIO as enable pin for sensors +#define SENSOR_ENABLE_GPIO_MAPPED_TO_UULP +#define SENSOR_ENABLE_GPIO_PIN RTE_UULP_GPIO_1_PIN + +// Memlcd GPIOs +#define RTE_MEMLCD_CS_PIN 10 // Memlcd SPI CS pin +#define RTE_MEMLCD_CS_PORT 0 // Memlcd SPI CS port + +#define RTE_MEMLCD_EXTCOMIN_PIN 3 // Memlcd external communication pin +#define RTE_MEMLCD_EXTCOMIN_PORT 0 // Memlcd external communication port + +#define RTE_MEMLCD_ENABLE_DISPLAY_PIN 0 // Memlcd display enable pin +#define RTE_MEMLCD_ENABLE_DISPLAY_PORT 0 // Memlcd display enable port diff --git a/matter/si91x/siwx917/BRD2605A/config/SEGGER_RTT_Conf.h b/matter/si91x/siwx917/BRD2605A/config/SEGGER_RTT_Conf.h new file mode 100644 index 0000000000..91283ff736 --- /dev/null +++ b/matter/si91x/siwx917/BRD2605A/config/SEGGER_RTT_Conf.h @@ -0,0 +1,428 @@ +/********************************************************************* +* SEGGER Microcontroller GmbH * +* The Embedded Experts * +********************************************************************** +* * +* (c) 1995 - 2023 SEGGER Microcontroller GmbH * +* * +* www.segger.com Support: support@segger.com * +* * +********************************************************************** +* * +* SEGGER SystemView * Real-time application analysis * +* * +********************************************************************** +* * +* All rights reserved. * +* * +* SEGGER strongly recommends to not make any changes * +* to or modify the source code of this software in order to stay * +* compatible with the SystemView and RTT protocol, and J-Link. * +* * +* Redistribution and use in source and binary forms, with or * +* without modification, are permitted provided that the following * +* condition is met: * +* * +* o Redistributions of source code must retain the above copyright * +* notice, this condition and the following disclaimer. * +* * +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND * +* CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, * +* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF * +* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * +* DISCLAIMED. IN NO EVENT SHALL SEGGER Microcontroller BE LIABLE FOR * +* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * +* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT * +* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; * +* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * +* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE * +* USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * +* DAMAGE. * +* * +********************************************************************** +* * +* SystemView version: 3.52 * +* * +********************************************************************** +---------------------------END-OF-HEADER------------------------------ +File : SEGGER_RTT_Conf.h +Purpose : Implementation of SEGGER real-time transfer (RTT) which + allows real-time communication on targets which support + debugger memory accesses while the CPU is running. +Revision: $Rev: 24316 $ + +*/ + +#ifndef SEGGER_RTT_CONF_H +#define SEGGER_RTT_CONF_H + +#ifdef __IAR_SYSTEMS_ICC__ + #include +#endif + +/********************************************************************* +* +* Defines, configurable +* +********************************************************************** +*/ + +// +// Take in and set to correct values for Cortex-A systems with CPU cache +// +//#define SEGGER_RTT_CPU_CACHE_LINE_SIZE (32) // Largest cache line size (in bytes) in the current system +//#define SEGGER_RTT_UNCACHED_OFF (0xFB000000) // Address alias where RTT CB and buffers can be accessed uncached +// +// Most common case: +// Up-channel 0: RTT +// Up-channel 1: SystemView +// +#ifndef SEGGER_RTT_MAX_NUM_UP_BUFFERS + #define SEGGER_RTT_MAX_NUM_UP_BUFFERS (9) // Max. number of up-buffers (T->H) available on this target (Default: 9) +#endif +// +// Most common case: +// Down-channel 0: RTT +// Down-channel 1: SystemView +// +#ifndef SEGGER_RTT_MAX_NUM_DOWN_BUFFERS + #define SEGGER_RTT_MAX_NUM_DOWN_BUFFERS (9) // Max. number of down-buffers (H->T) available on this target (Default: 9) +#endif + +#ifndef BUFFER_SIZE_UP + #define BUFFER_SIZE_UP (1024) // Size of the buffer for terminal output of target, up to host (Default: 1k) +#endif + +#ifndef BUFFER_SIZE_DOWN + #define BUFFER_SIZE_DOWN (1024) // Size of the buffer for terminal input to target from host (Usually keyboard input) (Default: 16) +#endif + +#ifndef SEGGER_RTT_PRINTF_BUFFER_SIZE + #define SEGGER_RTT_PRINTF_BUFFER_SIZE (64u) // Size of buffer for RTT printf to bulk-send chars via RTT (Default: 64) +#endif + +#ifndef SEGGER_RTT_MODE_DEFAULT + #define SEGGER_RTT_MODE_DEFAULT SEGGER_RTT_MODE_NO_BLOCK_SKIP // Mode for pre-initialized terminal channel (buffer 0) +#endif + +/********************************************************************* +* +* RTT memcpy configuration +* +* memcpy() is good for large amounts of data, +* but the overhead is big for small amounts, which are usually stored via RTT. +* With SEGGER_RTT_MEMCPY_USE_BYTELOOP a simple byte loop can be used instead. +* +* SEGGER_RTT_MEMCPY() can be used to replace standard memcpy() in RTT functions. +* This is may be required with memory access restrictions, +* such as on Cortex-A devices with MMU. +*/ +#ifndef SEGGER_RTT_MEMCPY_USE_BYTELOOP + #define SEGGER_RTT_MEMCPY_USE_BYTELOOP 0 // 0: Use memcpy/SEGGER_RTT_MEMCPY, 1: Use a simple byte-loop +#endif +// +// Example definition of SEGGER_RTT_MEMCPY to external memcpy with GCC toolchains and Cortex-A targets +// +//#if ((defined __SES_ARM) || (defined __CROSSWORKS_ARM) || (defined __GNUC__)) && (defined (__ARM_ARCH_7A__)) +// #define SEGGER_RTT_MEMCPY(pDest, pSrc, NumBytes) SEGGER_memcpy((pDest), (pSrc), (NumBytes)) +//#endif + +// +// Target is not allowed to perform other RTT operations while string still has not been stored completely. +// Otherwise we would probably end up with a mixed string in the buffer. +// If using RTT from within interrupts, multiple tasks or multi processors, define the SEGGER_RTT_LOCK() and SEGGER_RTT_UNLOCK() function here. +// +// SEGGER_RTT_MAX_INTERRUPT_PRIORITY can be used in the sample lock routines on Cortex-M3/4. +// Make sure to mask all interrupts which can send RTT data, i.e. generate SystemView events, or cause task switches. +// When high-priority interrupts must not be masked while sending RTT data, SEGGER_RTT_MAX_INTERRUPT_PRIORITY needs to be adjusted accordingly. +// (Higher priority = lower priority number) +// Default value for embOS: 128u +// Default configuration in FreeRTOS: configMAX_SYSCALL_INTERRUPT_PRIORITY: ( configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY << (8 - configPRIO_BITS) ) +// In case of doubt mask all interrupts: 1 << (8 - BASEPRI_PRIO_BITS) i.e. 1 << 5 when 3 bits are implemented in NVIC +// or define SEGGER_RTT_LOCK() to completely disable interrupts. +// +#ifndef SEGGER_RTT_MAX_INTERRUPT_PRIORITY + #define SEGGER_RTT_MAX_INTERRUPT_PRIORITY (0x20) // Interrupt priority to lock on SEGGER_RTT_LOCK on Cortex-M3/4 (Default: 0x20) +#endif + +/********************************************************************* +* +* RTT lock configuration for SEGGER Embedded Studio, +* Rowley CrossStudio and GCC +*/ +#if ((defined(__SES_ARM) || defined(__SES_RISCV) || defined(__CROSSWORKS_ARM) || defined(__GNUC__) || defined(__clang__)) && !defined (__CC_ARM) && !defined(WIN32)) + #if (defined(__ARM_ARCH_6M__) || defined(__ARM_ARCH_8M_BASE__)) + #define SEGGER_RTT_LOCK() { \ + unsigned int _SEGGER_RTT__LockState; \ + __asm volatile ("mrs %0, primask \n\t" \ + "movs r1, #1 \n\t" \ + "msr primask, r1 \n\t" \ + : "=r" (_SEGGER_RTT__LockState) \ + : \ + : "r1", "cc" \ + ); + + #define SEGGER_RTT_UNLOCK() __asm volatile ("msr primask, %0 \n\t" \ + : \ + : "r" (_SEGGER_RTT__LockState) \ + : \ + ); \ + } + #elif (defined(__ARM_ARCH_7M__) || defined(__ARM_ARCH_7EM__) || defined(__ARM_ARCH_8M_MAIN__)) + #ifndef SEGGER_RTT_MAX_INTERRUPT_PRIORITY + #define SEGGER_RTT_MAX_INTERRUPT_PRIORITY (0x20) + #endif + #define SEGGER_RTT_LOCK() { \ + unsigned int _SEGGER_RTT__LockState; \ + __asm volatile ("mrs %0, basepri \n\t" \ + "mov r1, %1 \n\t" \ + "msr basepri, r1 \n\t" \ + : "=r" (_SEGGER_RTT__LockState) \ + : "i"(SEGGER_RTT_MAX_INTERRUPT_PRIORITY) \ + : "r1", "cc" \ + ); + + #define SEGGER_RTT_UNLOCK() __asm volatile ("msr basepri, %0 \n\t" \ + : \ + : "r" (_SEGGER_RTT__LockState) \ + : \ + ); \ + } + + #elif (defined(__ARM_ARCH_7A__) || defined(__ARM_ARCH_7R__)) + #define SEGGER_RTT_LOCK() { \ + unsigned int _SEGGER_RTT__LockState; \ + __asm volatile ("mrs r1, CPSR \n\t" \ + "mov %0, r1 \n\t" \ + "orr r1, r1, #0xC0 \n\t" \ + "msr CPSR_c, r1 \n\t" \ + : "=r" (_SEGGER_RTT__LockState) \ + : \ + : "r1", "cc" \ + ); + + #define SEGGER_RTT_UNLOCK() __asm volatile ("mov r0, %0 \n\t" \ + "mrs r1, CPSR \n\t" \ + "bic r1, r1, #0xC0 \n\t" \ + "and r0, r0, #0xC0 \n\t" \ + "orr r1, r1, r0 \n\t" \ + "msr CPSR_c, r1 \n\t" \ + : \ + : "r" (_SEGGER_RTT__LockState) \ + : "r0", "r1", "cc" \ + ); \ + } + #elif defined(__riscv) || defined(__riscv_xlen) + #define SEGGER_RTT_LOCK() { \ + unsigned int _SEGGER_RTT__LockState; \ + __asm volatile ("csrr %0, mstatus \n\t" \ + "csrci mstatus, 8 \n\t" \ + "andi %0, %0, 8 \n\t" \ + : "=r" (_SEGGER_RTT__LockState) \ + : \ + : \ + ); + + #define SEGGER_RTT_UNLOCK() __asm volatile ("csrr a1, mstatus \n\t" \ + "or %0, %0, a1 \n\t" \ + "csrs mstatus, %0 \n\t" \ + : \ + : "r" (_SEGGER_RTT__LockState) \ + : "a1" \ + ); \ + } + #else + #define SEGGER_RTT_LOCK() + #define SEGGER_RTT_UNLOCK() + #endif +#endif + +/********************************************************************* +* +* RTT lock configuration for IAR EWARM +*/ +#ifdef __ICCARM__ + #if (defined (__ARM6M__) && (__CORE__ == __ARM6M__)) || \ + (defined (__ARM8M_BASELINE__) && (__CORE__ == __ARM8M_BASELINE__)) + #define SEGGER_RTT_LOCK() { \ + unsigned int _SEGGER_RTT__LockState; \ + _SEGGER_RTT__LockState = __get_PRIMASK(); \ + __set_PRIMASK(1); + + #define SEGGER_RTT_UNLOCK() __set_PRIMASK(_SEGGER_RTT__LockState); \ + } + #elif (defined (__ARM7EM__) && (__CORE__ == __ARM7EM__)) || \ + (defined (__ARM7M__) && (__CORE__ == __ARM7M__)) || \ + (defined (__ARM8M_MAINLINE__) && (__CORE__ == __ARM8M_MAINLINE__)) || \ + (defined (__ARM8M_MAINLINE__) && (__CORE__ == __ARM8M_MAINLINE__)) + #ifndef SEGGER_RTT_MAX_INTERRUPT_PRIORITY + #define SEGGER_RTT_MAX_INTERRUPT_PRIORITY (0x20) + #endif + #define SEGGER_RTT_LOCK() { \ + unsigned int _SEGGER_RTT__LockState; \ + _SEGGER_RTT__LockState = __get_BASEPRI(); \ + __set_BASEPRI(SEGGER_RTT_MAX_INTERRUPT_PRIORITY); + + #define SEGGER_RTT_UNLOCK() __set_BASEPRI(_SEGGER_RTT__LockState); \ + } + #elif (defined (__ARM7A__) && (__CORE__ == __ARM7A__)) || \ + (defined (__ARM7R__) && (__CORE__ == __ARM7R__)) + #define SEGGER_RTT_LOCK() { \ + unsigned int _SEGGER_RTT__LockState; \ + __asm volatile ("mrs r1, CPSR \n\t" \ + "mov %0, r1 \n\t" \ + "orr r1, r1, #0xC0 \n\t" \ + "msr CPSR_c, r1 \n\t" \ + : "=r" (_SEGGER_RTT__LockState) \ + : \ + : "r1", "cc" \ + ); + + #define SEGGER_RTT_UNLOCK() __asm volatile ("mov r0, %0 \n\t" \ + "mrs r1, CPSR \n\t" \ + "bic r1, r1, #0xC0 \n\t" \ + "and r0, r0, #0xC0 \n\t" \ + "orr r1, r1, r0 \n\t" \ + "msr CPSR_c, r1 \n\t" \ + : \ + : "r" (_SEGGER_RTT__LockState) \ + : "r0", "r1", "cc" \ + ); \ + } + #endif +#endif + +/********************************************************************* +* +* RTT lock configuration for IAR RX +*/ +#ifdef __ICCRX__ + #define SEGGER_RTT_LOCK() { \ + unsigned long _SEGGER_RTT__LockState; \ + _SEGGER_RTT__LockState = __get_interrupt_state(); \ + __disable_interrupt(); + + #define SEGGER_RTT_UNLOCK() __set_interrupt_state(_SEGGER_RTT__LockState); \ + } +#endif + +/********************************************************************* +* +* RTT lock configuration for IAR RL78 +*/ +#ifdef __ICCRL78__ + #define SEGGER_RTT_LOCK() { \ + __istate_t _SEGGER_RTT__LockState; \ + _SEGGER_RTT__LockState = __get_interrupt_state(); \ + __disable_interrupt(); + + #define SEGGER_RTT_UNLOCK() __set_interrupt_state(_SEGGER_RTT__LockState); \ + } +#endif + +/********************************************************************* +* +* RTT lock configuration for KEIL ARM +*/ +#ifdef __CC_ARM + #if (defined __TARGET_ARCH_6S_M) + #define SEGGER_RTT_LOCK() { \ + unsigned int _SEGGER_RTT__LockState; \ + register unsigned char _SEGGER_RTT__PRIMASK __asm( "primask"); \ + _SEGGER_RTT__LockState = _SEGGER_RTT__PRIMASK; \ + _SEGGER_RTT__PRIMASK = 1u; \ + __schedule_barrier(); + + #define SEGGER_RTT_UNLOCK() _SEGGER_RTT__PRIMASK = _SEGGER_RTT__LockState; \ + __schedule_barrier(); \ + } + #elif (defined(__TARGET_ARCH_7_M) || defined(__TARGET_ARCH_7E_M)) + #ifndef SEGGER_RTT_MAX_INTERRUPT_PRIORITY + #define SEGGER_RTT_MAX_INTERRUPT_PRIORITY (0x20) + #endif + #define SEGGER_RTT_LOCK() { \ + unsigned int _SEGGER_RTT__LockState; \ + register unsigned char BASEPRI __asm( "basepri"); \ + _SEGGER_RTT__LockState = BASEPRI; \ + BASEPRI = SEGGER_RTT_MAX_INTERRUPT_PRIORITY; \ + __schedule_barrier(); + + #define SEGGER_RTT_UNLOCK() BASEPRI = _SEGGER_RTT__LockState; \ + __schedule_barrier(); \ + } + #endif +#endif + +/********************************************************************* +* +* RTT lock configuration for TI ARM +*/ +#ifdef __TI_ARM__ + #if defined (__TI_ARM_V6M0__) + #define SEGGER_RTT_LOCK() { \ + unsigned int _SEGGER_RTT__LockState; \ + _SEGGER_RTT__LockState = __get_PRIMASK(); \ + __set_PRIMASK(1); + + #define SEGGER_RTT_UNLOCK() __set_PRIMASK(_SEGGER_RTT__LockState); \ + } + #elif (defined (__TI_ARM_V7M3__) || defined (__TI_ARM_V7M4__)) + #ifndef SEGGER_RTT_MAX_INTERRUPT_PRIORITY + #define SEGGER_RTT_MAX_INTERRUPT_PRIORITY (0x20) + #endif + #define SEGGER_RTT_LOCK() { \ + unsigned int _SEGGER_RTT__LockState; \ + _SEGGER_RTT__LockState = _set_interrupt_priority(SEGGER_RTT_MAX_INTERRUPT_PRIORITY); + + #define SEGGER_RTT_UNLOCK() _set_interrupt_priority(_SEGGER_RTT__LockState); \ + } + #endif +#endif + +/********************************************************************* +* +* RTT lock configuration for CCRX +*/ +#ifdef __RX + #include + #define SEGGER_RTT_LOCK() { \ + unsigned long _SEGGER_RTT__LockState; \ + _SEGGER_RTT__LockState = get_psw() & 0x010000; \ + clrpsw_i(); + + #define SEGGER_RTT_UNLOCK() set_psw(get_psw() | _SEGGER_RTT__LockState); \ + } +#endif + +/********************************************************************* +* +* RTT lock configuration for embOS Simulation on Windows +* (Can also be used for generic RTT locking with embOS) +*/ +#if defined(WIN32) || defined(SEGGER_RTT_LOCK_EMBOS) + +void OS_SIM_EnterCriticalSection(void); +void OS_SIM_LeaveCriticalSection(void); + +#define SEGGER_RTT_LOCK() { \ + OS_SIM_EnterCriticalSection(); + +#define SEGGER_RTT_UNLOCK() OS_SIM_LeaveCriticalSection(); \ + } +#endif + +/********************************************************************* +* +* RTT lock configuration fallback +*/ +#ifndef SEGGER_RTT_LOCK + #define SEGGER_RTT_LOCK() // Lock RTT (nestable) (i.e. disable interrupts) +#endif + +#ifndef SEGGER_RTT_UNLOCK + #define SEGGER_RTT_UNLOCK() // Unlock RTT (nestable) (i.e. enable previous interrupt lock state) +#endif + +#endif +/*************************** End of file ****************************/ diff --git a/matter/si91x/siwx917/BRD2605A/config/emlib_core_debug_config.h b/matter/si91x/siwx917/BRD2605A/config/emlib_core_debug_config.h new file mode 100644 index 0000000000..07ee9b9efb --- /dev/null +++ b/matter/si91x/siwx917/BRD2605A/config/emlib_core_debug_config.h @@ -0,0 +1,45 @@ +/***************************************************************************//** + * @file + * @brief emlib_core Configuration + ******************************************************************************* + * # License + * Copyright 2019 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************/ + +#ifndef EM_CORE_DEBUG_CONFIG_H +#define EM_CORE_DEBUG_CONFIG_H + +// <<< Use Configuration Wizard in Context Menu >>> + +// Core Configuration + +// Enables measuring of interrupt disable time for debugging purposes. +// Default: 0 +#define SL_EMLIB_CORE_ENABLE_INTERRUPT_DISABLED_TIMING 0 + +// + +// <<< end of configuration section >>> +#endif // EM_CORE_CONFIG_H diff --git a/matter/si91x/siwx917/BRD2605A/config/nvm3_default_config.h b/matter/si91x/siwx917/BRD2605A/config/nvm3_default_config.h new file mode 100644 index 0000000000..7cd7f1f1e4 --- /dev/null +++ b/matter/si91x/siwx917/BRD2605A/config/nvm3_default_config.h @@ -0,0 +1,62 @@ +/******************************************************************************* +* @file nvm3_default_config.h +* @brief +******************************************************************************* +* # License +* Copyright 2023 Silicon Laboratories Inc. www.silabs.com +******************************************************************************* +* +* The licensor of this software is Silicon Laboratories Inc. Your use of this +* software is governed by the terms of Silicon Labs Master Software License +* Agreement (MSLA) available at +* www.silabs.com/about-us/legal/master-software-license-agreement. This +* software is distributed to you in Source Code format and is governed by the +* sections of the MSLA applicable to Source Code. +* +******************************************************************************/ + +#ifndef NVM3_DEFAULT_CONFIG_H +#define NVM3_DEFAULT_CONFIG_H + +// <<< Use Configuration Wizard in Context Menu >>> + +// NVM3 Default Instance Configuration + +#ifndef NVM3_DEFAULT_CACHE_SIZE +// NVM3 Default Instance Cache Size +// Number of NVM3 objects to cache. To reduce access times this number +// should be equal to or higher than the number of NVM3 objects in the +// default NVM3 instance. +// Default: 200 +#define NVM3_DEFAULT_CACHE_SIZE 200 +#endif + +#ifndef NVM3_DEFAULT_MAX_OBJECT_SIZE +// NVM3 Default Instance Max Object Size +// Max NVM3 object size that can be stored. +// Default: 254 +#define NVM3_DEFAULT_MAX_OBJECT_SIZE 254 +#endif + +#ifndef NVM3_DEFAULT_REPACK_HEADROOM +// NVM3 Default Instance User Repack Headroom +// Headroom determining how many bytes below the forced repack limit the user +// repack limit should be placed. The default is 0, which means the user and +// forced repack limits are equal. +// Default: 0 +#define NVM3_DEFAULT_REPACK_HEADROOM 0 +#endif + +#ifndef NVM3_DEFAULT_NVM_SIZE +// NVM3 Default Instance Size +// Size of the NVM3 storage region in flash. This size should be aligned with +// the flash page size of the device. +// Default: 36864 +#define NVM3_DEFAULT_NVM_SIZE 36864 +#endif + +// + +// <<< end of configuration section >>> + +#endif // NVM3_DEFAULT_CONFIG_H diff --git a/matter/si91x/siwx917/BRD2605A/config/pin_config.h b/matter/si91x/siwx917/BRD2605A/config/pin_config.h new file mode 100644 index 0000000000..2bbc8c59c3 --- /dev/null +++ b/matter/si91x/siwx917/BRD2605A/config/pin_config.h @@ -0,0 +1,140 @@ +#ifndef PIN_CONFIG_H +#define PIN_CONFIG_H + +// $[USART0] +// [USART0]$ + +// $[UART1] +// [UART1]$ + +// $[ULP_UART] +// [ULP_UART]$ + +// $[I2C0] +// [I2C0]$ + +// $[I2C1] +// [I2C1]$ + +// $[ULP_I2C] +// [ULP_I2C]$ + +// $[SSI_MASTER] +// [SSI_MASTER]$ + +// $[SSI_SLAVE] +// [SSI_SLAVE]$ + +// $[ULP_SPI] +// [ULP_SPI]$ + +// $[GSPI_MASTER] +// [GSPI_MASTER]$ + +// $[I2S0] +// [I2S0]$ + +// $[ULP_I2S] +// [ULP_I2S]$ + +// $[SCT] +// [SCT]$ + +// $[SIO] +// [SIO]$ + +// $[PWM] +// [PWM]$ + +// $[PWM_CH0] +// [PWM_CH0]$ + +// $[PWM_CH1] +// [PWM_CH1]$ + +// $[PWM_CH2] +// [PWM_CH2]$ + +// $[PWM_CH3] +// [PWM_CH3]$ + +// $[ADC_CH1] +// [ADC_CH1]$ + +// $[ADC_CH2] +// [ADC_CH2]$ + +// $[ADC_CH3] +// [ADC_CH3]$ + +// $[ADC_CH4] +// [ADC_CH4]$ + +// $[ADC_CH5] +// [ADC_CH5]$ + +// $[ADC_CH6] +// [ADC_CH6]$ + +// $[ADC_CH7] +// [ADC_CH7]$ + +// $[ADC_CH8] +// [ADC_CH8]$ + +// $[ADC_CH9] +// [ADC_CH9]$ + +// $[ADC_CH10] +// [ADC_CH10]$ + +// $[ADC_CH11] +// [ADC_CH11]$ + +// $[ADC_CH12] +// [ADC_CH12]$ + +// $[ADC_CH13] +// [ADC_CH13]$ + +// $[ADC_CH14] +// [ADC_CH14]$ + +// $[ADC_CH15] +// [ADC_CH15]$ + +// $[ADC_CH16] +// [ADC_CH16]$ + +// $[ADC_CH17] +// [ADC_CH17]$ + +// $[ADC_CH18] +// [ADC_CH18]$ + +// $[ADC_CH19] +// [ADC_CH19]$ + +// $[COMP1] +// [COMP1]$ + +// $[COMP2] +// [COMP2]$ + +// $[DAC0] +// [DAC0]$ + +// $[DAC1] +// [DAC1]$ + +// $[CUSTOM_PIN_NAME] +#ifndef _PORT +#define _PORT 0 +#endif +#ifndef _PIN +#define _PIN 6 +#endif + +// [CUSTOM_PIN_NAME]$ + +#endif // PIN_CONFIG_H diff --git a/matter/si91x/siwx917/BRD2605A/config/sl_board_configuration.h b/matter/si91x/siwx917/BRD2605A/config/sl_board_configuration.h new file mode 100644 index 0000000000..635fe5f8a2 --- /dev/null +++ b/matter/si91x/siwx917/BRD2605A/config/sl_board_configuration.h @@ -0,0 +1,23 @@ +/******************************************************************************* +* @file sl_board_configuration.h +* @brief +******************************************************************************* +* # License +* Copyright 2023 Silicon Laboratories Inc. www.silabs.com +******************************************************************************* +* +* The licensor of this software is Silicon Laboratories Inc. Your use of this +* software is governed by the terms of Silicon Labs Master Software License +* Agreement (MSLA) available at +* www.silabs.com/about-us/legal/master-software-license-agreement. This +* software is distributed to you in Source Code format and is governed by the +* sections of the MSLA applicable to Source Code. +* +******************************************************************************/ + +#pragma once + +#include + +#define DEFAULT_UART NULL +#define DEFAULT_UART_PIN_CONFIG NULL diff --git a/matter/si91x/siwx917/BRD2605A/config/sl_board_control.h b/matter/si91x/siwx917/BRD2605A/config/sl_board_control.h new file mode 100644 index 0000000000..8b85d7553a --- /dev/null +++ b/matter/si91x/siwx917/BRD2605A/config/sl_board_control.h @@ -0,0 +1,22 @@ +/******************************************************************************* +* @file sl_board_control.h +* @brief +******************************************************************************* +* # License +* Copyright 2023 Silicon Laboratories Inc. www.silabs.com +******************************************************************************* +* +* The licensor of this software is Silicon Laboratories Inc. Your use of this +* software is governed by the terms of Silicon Labs Master Software License +* Agreement (MSLA) available at +* www.silabs.com/about-us/legal/master-software-license-agreement. This +* software is distributed to you in Source Code format and is governed by the +* sections of the MSLA applicable to Source Code. +* +******************************************************************************/ + +#pragma once + +#include "sl_status.h" + +sl_status_t sl_board_enable_vcom(void); diff --git a/matter/si91x/siwx917/BRD2605A/config/sl_core_config.h b/matter/si91x/siwx917/BRD2605A/config/sl_core_config.h new file mode 100644 index 0000000000..27b173d2eb --- /dev/null +++ b/matter/si91x/siwx917/BRD2605A/config/sl_core_config.h @@ -0,0 +1,44 @@ +/***************************************************************************//** + * @file + * @brief sl_core Configuration + ******************************************************************************* + * # License + * Copyright 2023 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************/ + +#ifndef SL_CORE_CONFIG_H +#define SL_CORE_CONFIG_H + +// <<< Use Configuration Wizard in Context Menu >>> + +// Core Abstraction Configuration + +// Enables measurement of interrupt masking time for debugging purposes. +// Default: 0 +#define SL_CORE_DEBUG_INTERRUPTS_MASKED_TIMING 0 +// + +// <<< end of configuration section >>> +#endif // SL_CORE_CONFIG_H diff --git a/matter/si91x/siwx917/BRD2605A/config/sl_mbedtls_config.h b/matter/si91x/siwx917/BRD2605A/config/sl_mbedtls_config.h new file mode 100644 index 0000000000..39b51496fd --- /dev/null +++ b/matter/si91x/siwx917/BRD2605A/config/sl_mbedtls_config.h @@ -0,0 +1,118 @@ +#ifndef SL_MBEDTLS_CONFIG_H +#define SL_MBEDTLS_CONFIG_H + +// ----------------------------------------------------------------------------- +// User exposed config options + +// <<< Use Configuration Wizard in Context Menu >>> + +// TLS/DTLS configuration + +// Complete list of ciphersuites to use, in order of preference. +// Default: MBEDTLS_TLS_ECJPAKE_WITH_AES_128_CCM_8 +// Complete list of ciphersuites to use, in order of preference. +// The value of this configuration should be updated for the application needs. +#define MBEDTLS_SSL_CIPHERSUITES MBEDTLS_TLS_ECJPAKE_WITH_AES_128_CCM_8 + +// Maximum TLS/DTLS fragment length in bytes (input). +// Default: 768 +// The size configured here determines the size of the internal I/O +// buffer used in mbedTLS when receiving data. +#define SL_MBEDTLS_SSL_IN_CONTENT_LEN 768 + +// Maximum TLS/DTLS fragment length in bytes (output). +// Default: 768 +// The size configured here determines the size of the internal I/O +// buffer used in mbedTLS when sending data. +#define SL_MBEDTLS_SSL_OUT_CONTENT_LEN 768 + +// Enable support for RFC 6066 max_fragment_length extension in SSL. +// Default: 1 +// Enable support for RFC 6066 max_fragment_length extension in SSL. +#define SL_MBEDTLS_SSL_MAX_FRAGMENT_LENGTH 1 + +// Enable support for exporting key block and master secret. +// Default: 1 +// Enable support for exporting key block and master secret. +// This is required for certain users of TLS, e.g. EAP-TLS. +#define SL_MBEDTLS_SSL_EXPORT_KEYS 1 + +// Enable the PSK based ciphersuite modes in SSL / TLS. +// Default: 0 +// Enable the PSK based ciphersuite modes in SSL / TLS. +#define SL_MBEDTLS_KEY_EXCHANGE_PSK_ENABLED 0 + +// Enable the ECDHE-PSK based ciphersuite modes in SSL / TLS. +// Default: 0 +// Enable the ECDHE-PSK based ciphersuite modes in SSL / TLS. +#define SL_MBEDTLS_KEY_EXCHANGE_ECDHE_PSK_ENABLED 0 + +// Enable the ECDHE-ECDSA based ciphersuite modes in SSL / TLS. +// Default: 0 +// Enable the ECDHE-ECDSA based ciphersuite modes in SSL / TLS. +#define SL_MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED 0 + +// Enable the ECDHE-RSA based ciphersuite modes in SSL / TLS. +// Default: 0 +// Enable the ECDHE-RSA based ciphersuite modes in SSL / TLS. +#define SL_MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED 0 + +// Enable the ECDH-ECDSA based ciphersuite modes in SSL / TLS. +// Default: 0 +// Enable the ECDH-ECDSA based ciphersuite modes in SSL / TLS. +#define SL_MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA_ENABLED 0 + +// Enable parsing of the compressed curves. +// Default: 0 +// Enable parsing of the compressed curves. +#define SL_MBEDTLS_ECP_ENABLE_COMPRESSED_CURVE_PARSING 0 + +// + +// RSA configuration + +// Disable use of the Chinese Remainder Theorem for RSA. +// Default: 0 +// Disable use of the Chinese Remainder Theorem for RSA private key +// computations. +#define SL_MBEDTLS_RSA_NO_CRT 0 + +// + +// Miscellaneous configuration + +// Enable Silicon Labs' Mbed TLS- and PSA Crypto drivers. +// Default: 1 +// Enable drivers for hardware acceleration (Mbed TLS and PSA Crypto) and +// secure key handling (PSA Crypto). +#define SL_MBEDTLS_DRIVERS_ENABLED 1 + +// + +// <<< end of configuration section >>> + +// ----------------------------------------------------------------------------- +// Sub-files + +#if defined(SLI_MBEDTLS_CONFIG_AUTOGEN_OVERRIDE_FILE) + #include SLI_MBEDTLS_CONFIG_AUTOGEN_OVERRIDE_FILE +#else + #include "sli_mbedtls_config_autogen.h" +#endif + +#include "sli_mbedtls_omnipresent.h" + +#if SL_MBEDTLS_DRIVERS_ENABLED + #include "sli_mbedtls_acceleration.h" +#endif + +#include "sl_mbedtls_device_config.h" + +// Include transformation logic to apply CMSIS-config configuration options to +// the correct Mbed TLS / PSA Crypto options. +#include "sli_mbedtls_config_transform_autogen.h" + +// Included for backward compatibility reasons. +#include "mbedtls/build_info.h" + +#endif // SL_MBEDTLS_CONFIG_H diff --git a/matter/si91x/siwx917/BRD2605A/config/sl_mbedtls_device_config.h b/matter/si91x/siwx917/BRD2605A/config/sl_mbedtls_device_config.h new file mode 100644 index 0000000000..fd0858c964 --- /dev/null +++ b/matter/si91x/siwx917/BRD2605A/config/sl_mbedtls_device_config.h @@ -0,0 +1,70 @@ +#ifndef SL_MBEDTLS_DEVICE_CONFIG_H +#define SL_MBEDTLS_DEVICE_CONFIG_H + +// ----------------------------------------------------------------------------- +// User exposed config options + +// <<< Use Configuration Wizard in Context Menu >>> + +// Secure Engine (SE) version configuration + +// Support SE firmware versions older +// than 1.2.2 <0-1> Enable software fallback for ECDH and ECC public key +// validation on xG21 devices running SE firmware versions lower than 1.2.2. +// +// Due to other stability concerns, it is strongly recommended to upgrade +// these devices to the latest firmware revision instead of turning on +// software fallback support. +// +// Not having fallback support will make ECDH operations, as well as PSA +// Crypto public key import, return an error code on affected devices. +// +// Default: 0 +#define SL_SE_SUPPORT_FW_PRIOR_TO_1_2_2 0 + +// Assume an SE firmware version newer +// than 1.2.2 <0-1> For enhanced performance: if it is guaranteed that all +// devices on which this library will run are updated to at least SE +// FW 1.2.2, then turning on this option will remove certain fallback +// checks, thereby reducing the amount of processing required for ECDH and +// public key verification operations. Default: 0 +#define SL_SE_ASSUME_FW_AT_LEAST_1_2_2 0 + +// Assume an SE firmware +// version that is unaffected by Ed25519 errata <0-1> For minimal code size +// and performance savings: if it is guaranteed that none of the devices +// running this library has SE FWs in the range [1.2.2, 1.2.8], then +// enabling this option will disable runtime version checks. Default: 0 +#define SL_SE_ASSUME_FW_UNAFFECTED_BY_ED25519_ERRATA 0 + +// + +// <<< end of configuration section >>> + +// ----------------------------------------------------------------------------- +// Additional SE version related logic (DO NOT MODIFY) + +// SL_SE_ASSUME_FW_AT_LEAST_1_2_10 is no longer in use, however, it is kept here +// for backwards compatibility. */ +#if defined(SL_SE_ASSUME_FW_AT_LEAST_1_2_10) +#undef SL_SE_ASSUME_FW_AT_LEAST_1_2_2 +#define SL_SE_ASSUME_FW_AT_LEAST_1_2_2 1 +#undef SL_SE_ASSUME_FW_UNAFFECTED_BY_ED25519_ERRATA +#define SL_SE_ASSUME_FW_UNAFFECTED_BY_ED25519_ERRATA 1 +#endif + +// SLI_SE_SUPPORT_FW_PRIOR_TO_1_2_2 is no longer in use, however, it is kept +// here for backwards compatibility. */ +#if defined(SLI_SE_SUPPORT_FW_PRIOR_TO_1_2_2) +#undef SL_SE_SUPPORT_FW_PRIOR_TO_1_2_2 +#define SL_SE_SUPPORT_FW_PRIOR_TO_1_2_2 1 +#endif + +// SLI_SE_ASSUME_FW_AT_LEAST_1_2_2 is no longer in use, however, it is kept +// here for backwards compatibility. */ +#if defined(SLI_SE_ASSUME_FW_AT_LEAST_1_2_2) +#undef SL_SE_ASSUME_FW_AT_LEAST_1_2_2 +#define SL_SE_ASSUME_FW_AT_LEAST_1_2_2 1 +#endif + +#endif // SL_MBEDTLS_DEVICE_CONFIG_H diff --git a/matter/si91x/siwx917/BRD2605A/config/sl_memory_manager_config.h b/matter/si91x/siwx917/BRD2605A/config/sl_memory_manager_config.h new file mode 100644 index 0000000000..7e4b056778 --- /dev/null +++ b/matter/si91x/siwx917/BRD2605A/config/sl_memory_manager_config.h @@ -0,0 +1,49 @@ +/***************************************************************************//** + * @file + * @brief Memory Heap Allocator configuration file. + ******************************************************************************* + * # License + * Copyright 2024 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************/ + +// <<< Use Configuration Wizard in Context Menu >>> + +#ifndef SL_MEMORY_MANAGER_CONFIG_H +#define SL_MEMORY_MANAGER_CONFIG_H + +// Memory Manager Configuration + +// Minimum block allocation size +// <32-128:8> +// Minimum block allocation size to avoid creating a block too small while splitting up an allocated block. +// Size expressed in bytes and can only be a multiple of 8 bytes for the proper data alignment management done by the dynamic allocator malloc() function. +// Default: 32 +#define SL_MEMORY_MANAGER_BLOCK_ALLOCATION_MIN_SIZE (32) + +// + +// <<< end of configuration section >>> + +#endif /* SL_MEMORY_MANAGER_CONFIG_H */ diff --git a/matter/si91x/siwx917/BRD2605A/config/sl_memory_manager_region_config.h b/matter/si91x/siwx917/BRD2605A/config/sl_memory_manager_region_config.h new file mode 100644 index 0000000000..ba02fdd8f3 --- /dev/null +++ b/matter/si91x/siwx917/BRD2605A/config/sl_memory_manager_region_config.h @@ -0,0 +1,49 @@ +/***************************************************************************//** + * @file + * @brief Memory Heap and stack size configuration file. + ******************************************************************************* + * # License + * Copyright 2024 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************/ + +// <<< Use Configuration Wizard in Context Menu >>> + +#ifndef SL_MEMORY_MANAGER_REGION_CONFIG_H +#define SL_MEMORY_MANAGER_REGION_CONFIG_H + +// Memory configuration + +// Stack size for the application. +// Default: 4096 +// The stack size configured here will be used by the stack that the +// application uses when coming out of a reset. +#ifndef SL_STACK_SIZE +#define SL_STACK_SIZE 4096 +#endif +// + +// <<< end of configuration section >>> + +#endif /* SL_MEMORY_MANAGER_REGION_CONFIG_H */ diff --git a/matter/si91x/siwx917/BRD2605A/config/sl_net_default_values.h b/matter/si91x/siwx917/BRD2605A/config/sl_net_default_values.h new file mode 100644 index 0000000000..ffe3767f49 --- /dev/null +++ b/matter/si91x/siwx917/BRD2605A/config/sl_net_default_values.h @@ -0,0 +1,149 @@ +/******************************************************************************* +* @file sl_net_default_values.h +* @brief +******************************************************************************* +* # License +* Copyright 2023 Silicon Laboratories Inc. www.silabs.com +******************************************************************************* +* +* The licensor of this software is Silicon Laboratories Inc. Your use of this +* software is governed by the terms of Silicon Labs Master Software License +* Agreement (MSLA) available at +* www.silabs.com/about-us/legal/master-software-license-agreement. This +* software is distributed to you in Source Code format and is governed by the +* sections of the MSLA applicable to Source Code. +* +******************************************************************************/ + +#pragma once + +#include "sl_net_wifi_types.h" + +#if defined(__GNUC__) +// Ignore warning of unused variables. It is expected that some or all of these are unused +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-variable" +#endif + +#ifdef SLI_SI91X_ENABLE_IPV6 +#define REQUIRED_IP_TYPE SL_IPV6 +#else +#define REQUIRED_IP_TYPE SL_IPV4 +#endif + +#ifndef DEFAULT_WIFI_CLIENT_PROFILE_SSID +#define DEFAULT_WIFI_CLIENT_PROFILE_SSID "YOUR_AP_SSID" +#endif + +#ifndef DEFAULT_WIFI_CLIENT_CREDENTIAL +#define DEFAULT_WIFI_CLIENT_CREDENTIAL "YOUR_AP_PASSPHRASE" +#endif + +#ifndef DEFAULT_WIFI_AP_PROFILE_SSID +#define DEFAULT_WIFI_AP_PROFILE_SSID "MY_AP_SSID" +#endif + +#ifndef DEFAULT_WIFI_AP_CREDENTIAL +#define DEFAULT_WIFI_AP_CREDENTIAL "MY_AP_PASSPHRASE" +#endif + +#ifndef DEFAULT_WIFI_CLIENT_SECURITY_TYPE +#define DEFAULT_WIFI_CLIENT_SECURITY_TYPE SL_WIFI_WPA2 +#endif + +#ifndef DEFAULT_WIFI_CLIENT_ENCRYPTION_TYPE +#define DEFAULT_WIFI_CLIENT_ENCRYPTION_TYPE SL_WIFI_DEFAULT_ENCRYPTION +#endif + +//! IP address of the module +//! E.g: 0x0A0AA8C0 == 192.168.10.10 +#ifndef DEFAULT_WIFI_MODULE_IP_ADDRESS +#define DEFAULT_WIFI_MODULE_IP_ADDRESS 0x0A0AA8C0 +#endif + +//! IP address of netmask +//! E.g: 0x00FFFFFF == 255.255.255.0 +#ifndef DEFAULT_WIFI_SN_MASK_ADDRESS +#define DEFAULT_WIFI_SN_MASK_ADDRESS 0x00FFFFFF +#endif + +//! IP address of Gateway +//! E.g: 0x0A0AA8C0 == 192.168.10.10 +#ifndef DEFAULT_WIFI_GATEWAY_ADDRESS +#define DEFAULT_WIFI_GATEWAY_ADDRESS 0x0A0AA8C0 +#endif + +#define DEFAULT_WIFI_CLIENT_PROFILE \ + (sl_net_wifi_client_profile_t) \ + { \ + .config = { \ + .ssid.value = DEFAULT_WIFI_CLIENT_PROFILE_SSID, \ + .ssid.length = sizeof(DEFAULT_WIFI_CLIENT_PROFILE_SSID)-1, \ + .channel.channel = SL_WIFI_AUTO_CHANNEL, \ + .channel.band = SL_WIFI_AUTO_BAND, \ + .channel.bandwidth = SL_WIFI_AUTO_BANDWIDTH, \ + .channel_bitmap.channel_bitmap_2_4 = SL_WIFI_DEFAULT_CHANNEL_BITMAP, \ + .bssid = {{0}}, \ + .bss_type = SL_WIFI_BSS_TYPE_INFRASTRUCTURE, \ + .security = DEFAULT_WIFI_CLIENT_SECURITY_TYPE, \ + .encryption = DEFAULT_WIFI_CLIENT_ENCRYPTION_TYPE, \ + .client_options = 0, \ + .credential_id = SL_NET_DEFAULT_WIFI_CLIENT_CREDENTIAL_ID, \ + }, \ + .ip = { \ + .mode = SL_IP_MANAGEMENT_DHCP, \ + .type = REQUIRED_IP_TYPE, \ + .host_name = NULL, \ + .ip = {{{0}}}, \ + } \ + } + +#define DEFAULT_WIFI_ACCESS_POINT_PROFILE \ + (sl_net_wifi_ap_profile_t) \ + { \ + .config = { \ + .ssid.value = DEFAULT_WIFI_AP_PROFILE_SSID, \ + .ssid.length = sizeof(DEFAULT_WIFI_AP_PROFILE_SSID)-1, \ + .channel.channel = SL_WIFI_AUTO_CHANNEL, \ + .channel.band = SL_WIFI_AUTO_BAND, \ + .channel.bandwidth = SL_WIFI_AUTO_BANDWIDTH, \ + .security = SL_WIFI_WPA2, \ + .encryption = SL_WIFI_CCMP_ENCRYPTION, \ + .rate_protocol = SL_WIFI_RATE_PROTOCOL_AUTO, \ + .options = 0, \ + .credential_id = SL_NET_DEFAULT_WIFI_AP_CREDENTIAL_ID, \ + .keepalive_type = SL_SI91X_AP_NULL_BASED_KEEP_ALIVE, \ + .beacon_interval = 100, \ + .client_idle_timeout = 0xFF, \ + .dtim_beacon_count = 3, \ + .maximum_clients = 3, \ + .beacon_stop = 0, \ + .tdi_flags =SL_WIFI_TDI_NONE, \ + .is_11n_enabled = 1, \ + }, \ + .ip = { \ + .mode = SL_IP_MANAGEMENT_STATIC_IP, \ + .type = SL_IPV4, \ + .host_name = NULL, \ + .ip = { \ + .v4.ip_address.value = DEFAULT_WIFI_MODULE_IP_ADDRESS, \ + .v4.gateway.value = DEFAULT_WIFI_GATEWAY_ADDRESS, \ + .v4.netmask.value = DEFAULT_WIFI_SN_MASK_ADDRESS \ + }, \ + } \ + } + +static sl_net_wifi_psk_credential_entry_t default_wifi_client_credential = { + .type = SL_NET_WIFI_PSK, + .data_length = sizeof(DEFAULT_WIFI_CLIENT_CREDENTIAL) - 1, + .data = DEFAULT_WIFI_CLIENT_CREDENTIAL +}; + +static sl_net_wifi_psk_credential_entry_t default_wifi_ap_credential = { .type = SL_NET_WIFI_PSK, + .data_length = + sizeof(DEFAULT_WIFI_AP_CREDENTIAL) - 1, + .data = DEFAULT_WIFI_AP_CREDENTIAL }; +#if defined(__GNUC__) +// Restore GCC diagnostics +#pragma GCC diagnostic pop +#endif diff --git a/matter/si91x/siwx917/BRD2605A/config/sl_si91x_button_btn0_config.h b/matter/si91x/siwx917/BRD2605A/config/sl_si91x_button_btn0_config.h new file mode 100644 index 0000000000..dac1086d80 --- /dev/null +++ b/matter/si91x/siwx917/BRD2605A/config/sl_si91x_button_btn0_config.h @@ -0,0 +1,28 @@ +/***************************************************************************/ /** + * @file sl_si91x_button_config.h + * @brief Button Driver Configuration + ******************************************************************************* + * # License + * Copyright 2023 Silicon Laboratories Inc. www.silabs.com + *******************************************************************************/ + +#ifndef SL_SI91X_BUTTON_BTN0_CONFIG_H +#define SL_SI91X_BUTTON_BTN0_CONFIG_H + +#include "sl_si91x_button.h" + +// <<< Use Configuration Wizard in Context Menu >>> + +// Button Interrupt Configuration +// High level interrupt +// Low level interrupt +// High level and low level interrupt +// Rise edge interrupt +// Fall edge interrupt +// Rise edge and fall edge interrupt +// Default: RISE_EDGE_AND_FALL_EDGE_INTERRUPT +#define SL_BUTTON_CONFIG_BTN0_INTR RISE_EDGE_AND_FALL_EDGE_INTERRUPT + +// <<< end of configuration section >>> + +#endif // SL_SI91X_BUTTON_BTN0_CONFIG_H diff --git a/matter/si91x/siwx917/BRD2605A/config/sl_si91x_button_btn1_config.h b/matter/si91x/siwx917/BRD2605A/config/sl_si91x_button_btn1_config.h new file mode 100644 index 0000000000..5f1a9a9a3e --- /dev/null +++ b/matter/si91x/siwx917/BRD2605A/config/sl_si91x_button_btn1_config.h @@ -0,0 +1,28 @@ +/***************************************************************************/ /** + * @file sl_si91x_button_config.h + * @brief Button Driver Configuration + ******************************************************************************* + * # License + * Copyright 2023 Silicon Laboratories Inc. www.silabs.com + *******************************************************************************/ + +#ifndef SL_SI91X_BUTTON_BTN1_CONFIG_H +#define SL_SI91X_BUTTON_BTN1_CONFIG_H + +#include "sl_si91x_button.h" + +// <<< Use Configuration Wizard in Context Menu >>> + +// Button Interrupt Configuration +// High level interrupt +// Low level interrupt +// High level and low level interrupt +// Rise edge interrupt +// Fall edge interrupt +// Rise edge and fall edge interrupt +// Default: RISE_EDGE_AND_FALL_EDGE_INTERRUPT +#define SL_BUTTON_CONFIG_BTN1_INTR RISE_EDGE_AND_FALL_EDGE_INTERRUPT + +// <<< end of configuration section >>> + +#endif // SL_SI91X_BUTTON_BTN1_CONFIG_H diff --git a/matter/si91x/siwx917/BRD2605A/config/sl_si91x_button_pin_config.h b/matter/si91x/siwx917/BRD2605A/config/sl_si91x_button_pin_config.h new file mode 100644 index 0000000000..b0121118bb --- /dev/null +++ b/matter/si91x/siwx917/BRD2605A/config/sl_si91x_button_pin_config.h @@ -0,0 +1,25 @@ +/***************************************************************************/ /** + * @file sl_si91x_button_config.h + * @brief Button Driver Configuration + ******************************************************************************* + * # License + * Copyright 2023 Silicon Laboratories Inc. www.silabs.com + *******************************************************************************/ + +#ifndef SL_SI91X_BUTTON_PIN_CONFIG_H +#define SL_SI91X_BUTTON_PIN_CONFIG_H + +#include "RTE_Device_917.h" + +#define SL_SI91x_BUTTON_COUNT (2) + +#define SL_BUTTON_BTN0_PIN RTE_BUTTON0_PIN +#define SL_BUTTON_BTN0_PORT RTE_BUTTON0_PORT +#define SL_BUTTON_BTN0_NUMBER RTE_BUTTON0_NUMBER + +#define SL_BUTTON_BTN1_PIN RTE_BUTTON1_PIN +#define SL_BUTTON_BTN1_PORT RTE_BUTTON1_PORT +#define SL_BUTTON_BTN1_NUMBER RTE_BUTTON1_NUMBER +#define SL_BUTTON_BTN1_PAD RTE_BUTTON1_PAD + +#endif // SL_SI91X_BUTTON_PIN_CONFIG_H diff --git a/matter/si91x/siwx917/BRD2605A/config/sl_si91x_dma_config.h b/matter/si91x/siwx917/BRD2605A/config/sl_si91x_dma_config.h new file mode 100644 index 0000000000..109df2599c --- /dev/null +++ b/matter/si91x/siwx917/BRD2605A/config/sl_si91x_dma_config.h @@ -0,0 +1,52 @@ +/***************************************************************************/ /** + * @file + * @brief SL USART Config. + ******************************************************************************* + * # License + * Copyright 2023 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************/ + +#ifndef SL_SI91X_DMA_CONFIG_H +#define SL_SI91X_DMA_CONFIG_H + +// <<< Use Configuration Wizard in Context Menu >>> +#ifdef __cplusplus +extern "C" { +#endif + +// DMA instance 0 channel count <1-32> +// Default: 32 +#define SL_DMA0_CHANNEL_COUNT 32 + +// ULP DMA instance channel count <1-12> +// Default: 12 +#define SL_ULP_DMA_CHANNEL_COUNT 12 + +// <<< end of configuration section >>> + +#ifdef __cplusplus +} +#endif +#endif //SL_SI91X_DMA_CONFIG_H diff --git a/matter/si91x/siwx917/BRD2605A/config/sl_si91x_led_config.h b/matter/si91x/siwx917/BRD2605A/config/sl_si91x_led_config.h new file mode 100644 index 0000000000..36d57e22d2 --- /dev/null +++ b/matter/si91x/siwx917/BRD2605A/config/sl_si91x_led_config.h @@ -0,0 +1,36 @@ +/***************************************************************************/ /** + * @file RTE_led_config.h + * @brief Led Driver Configuration + ******************************************************************************* + * # License + * Copyright 2023 Silicon Laboratories Inc. www.silabs.com + *******************************************************************************/ + +#ifndef SL_SI91X_LED_CONFIG_H +#define SL_SI91X_LED_CONFIG_H + +#include "RTE_Device_917.h" + +#define SL_SI91x_LED_COUNT 1 + +#ifndef SI917_DEVKIT + +#define SL_LED_LED0_PIN RTE_LED0_PIN +#define SL_LED_LED0_PORT RTE_LED0_PORT +#define SL_LED_LED0_NUMBER RTE_LED0_NUMBER + +#define SL_LED_LED1_PIN RTE_LED1_PIN +#define SL_LED_LED1_PORT RTE_LED1_PORT +#define SL_LED_LED1_NUMBER RTE_LED1_NUMBER +#define SL_LED_LED1_PAD RTE_LED1_PAD + +#else + +#define SL_LED_LEDB_PIN RTE_LEDB_PIN +#define SL_LED_LEDB_PORT RTE_LEDB_PORT +#define SL_LED_LEDB_NUMBER RTE_LEDB_NUMBER +#define SL_LED_LEDB_PAD RTE_LEDB_PAD + +#endif + +#endif // SL_SI91X_LED_CONFIG_H diff --git a/matter/si91x/siwx917/BRD2605A/config/sl_si91x_power_manager_config_3.h b/matter/si91x/siwx917/BRD2605A/config/sl_si91x_power_manager_config_3.h new file mode 100644 index 0000000000..3becf17434 --- /dev/null +++ b/matter/si91x/siwx917/BRD2605A/config/sl_si91x_power_manager_config_3.h @@ -0,0 +1,358 @@ +/***************************************************************************/ /** + * @file sl_si91x_power_manager_config_3.h + * @brief Power Manager Configuration NWP Basic and MCU Advance RAM Configuration + ******************************************************************************* + * # License + * Copyright 2023 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************/ + +#ifndef SL_SI91X_POWER_MANAGER_CONFIG_3_H +#define SL_SI91X_POWER_MANAGER_CONFIG_3_H + +#ifdef __cplusplus +extern "C" { +#endif + +#include "sl_si91x_power_manager.h" + +// <<< Use Configuration Wizard in Context Menu >>> + +// Peripheral Configuration + +// High Power Peripherals +// M4 DEBUG +// Default: 1 +#define SL_HP_M4_DEBUG_PERIPHERAL 1 + +// QSPI +// Default: 1 +#define SL_HP_QSPI_PERIPHERAL 1 + +// RPDMA +// Default: 1 +#define SL_HP_RPDMA_PERIPHERAL 1 + +// SDIO SPI +// Default: 1 +#define SL_HP_SDIO_SPI_PERIPHERAL 1 +// + +// Low Power Peripherals +// ULP AUX +// Default: 1 +#define SL_ULP_AUX_PERIPHERAL 1 + +// ULP CAPACITIVE TOUCH +// Default: 1 +#define SL_ULP_CAP_PERIPHERAL 1 + +// ULP FIM +// Default: 1 +#define SL_ULP_FIM_PERIPHERAL 1 + +// ULP I2C +// Default: 1 +#define SL_ULP_I2C_PERIPHERAL 1 + +// ULP I2S +// Default: 1 +#define SL_ULP_I2S_PERIPHERAL 1 + +// ULP IR +// Default: 1 +#define SL_ULP_IR_PERIPHERAL 1 + +// ULP SSI +// Default: 1 +#define SL_ULP_SSI_PERIPHERAL 1 + +// ULP UART +// Default: 1 +#define SL_ULP_UART_PERIPHERAL 1 + +// ULP UDMA +// Default: 1 +#define SL_ULP_UDMA_PERIPHERAL 1 +// + +// Ultra Low Power Peripherals +// MCU STORE 1 +// Default: 1 +#define SL_UULP_MCU_STORE1_PERIPHERAL 1 + +// MCU STORE 2 +// Default: 1 +#define SL_UULP_MCU_STORE2_PERIPHERAL 1 + +// MCU STORE 3 +// Default: 1 +#define SL_UULP_MCU_STORE3_PERIPHERAL 1 + +// RTC (CALENDAR) +// Default: 1 +#define SL_UULP_RTC_PERIPHERAL 1 + +// TIME PERIOD +// Default: 1 +#define SL_UULP_TIME_PERIOD_PERIPHERAL 1 + +// UPS +// Default: 1 +#define SL_UULP_UPS_PERIPHERAL 1 + +// UTS +// Default: 1 +#define SL_UULP_UTS_PERIPHERAL 1 + +// WATCHDOG TIMER +// Default: 1 +#define SL_UULP_WDT_PERIPHERAL 1 +// + +// + +// RAM Configuration + +// Configure RAM Banks using Size +#define SL_RAM_RETENTION_USING_SIZE 1 + +#define SL_LP_RAM_RETENTION_USING_SIZE_BANK_1 4 +#define SL_LP_RAM_RETENTION_USING_SIZE_BANK_2 8 +#define SL_LP_RAM_RETENTION_USING_SIZE_BANK_3 12 +#define SL_LP_RAM_RETENTION_USING_SIZE_BANK_4 16 +#define SL_LP_RAM_RETENTION_USING_SIZE_BANK_5 32 +#define SL_LP_RAM_RETENTION_USING_SIZE_BANK_6 64 +#define SL_LP_RAM_RETENTION_USING_SIZE_BANK_7 128 +#define SL_LP_RAM_RETENTION_USING_SIZE_BANK_8 192 +#define SL_LP_RAM_RETENTION_USING_SIZE_BANK_9 256 +#define SL_LP_RAM_RETENTION_USING_SIZE_BANK_10 320 +// Low Power Ram Retention Size (in KB) +// 4 KB +// 8 KB +// 12 KB +// 16 KB +// 32 KB +// 64 KB +// 128 KB +// 192 KB +// 256 KB +// 320 KB +// Selection of LP RAM Retention Size +#define SL_LP_RAM_RETENTION_SIZE SL_LP_RAM_RETENTION_USING_SIZE_BANK_10 + +#define SL_ULP_RAM_RETENTION_USING_SIZE_BANK_1 2 +#define SL_ULP_RAM_RETENTION_USING_SIZE_BANK_2 4 +// Ultra Low Power Ram Retention Size (in KB) +// 2 KB +// 4 KB +// Selection of ULP RAM Retention Size +#define SL_ULP_RAM_RETENTION_SIZE SL_ULP_RAM_RETENTION_USING_SIZE_BANK_2 +// + +// Configure RAM Banks using Bank Number +#define SL_RAM_RETENTION_USING_NUMBER 0 +// LOW POWER RAM BANK 1 +// Default: 1 +#define SL_LP_RAM_BANK1 1 + +// LOW POWER RAM BANK 2 +// Default: 1 +#define SL_LP_RAM_BANK2 1 + +// LOW POWER RAM BANK 3 +// Default: 1 +#define SL_LP_RAM_BANK3 1 + +// LOW POWER RAM BANK 4 +// Default: 1 +#define SL_LP_RAM_BANK4 1 + +// LOW POWER RAM BANK 5 +// Default: 1 +#define SL_LP_RAM_BANK5 1 + +// LOW POWER RAM BANK 6 +// Default: 1 +#define SL_LP_RAM_BANK6 1 + +// LOW POWER RAM BANK 7 +// Default: 1 +#define SL_LP_RAM_BANK7 1 + +// LOW POWER RAM BANK 8 +// Default: 1 +#define SL_LP_RAM_BANK8 1 + +// LOW POWER RAM BANK 9 +// Default: 1 +#define SL_LP_RAM_BANK9 1 + +// LOW POWER RAM BANK 10 +// Default: 1 +#define SL_LP_RAM_BANK10 1 + +// ULTRA LOW POWER RAM BANK 2 +// Default: 1 +#define SL_ULP_RAM_BANK2 1 + +// ULTRA LOW POWER RAM BANK 3 +// Default: 1 +#define SL_ULP_RAM_BANK3 1 +// + +// + +// <<< end of configuration section >>> + +sl_power_peripheral_t peripheral_config = { + .m4ss_peripheral = (0 +#if (SL_HP_M4_DEBUG_PERIPHERAL == 0) + | SL_SI91X_POWER_MANAGER_M4SS_PG_M4_DEBUG +#endif +#if (SL_HP_RPDMA_PERIPHERAL == 0) + | SL_SI91X_POWER_MANAGER_M4SS_PG_RPDMA +#endif +#if (SL_HP_QSPI_PERIPHERAL == 0) + | SL_SI91X_POWER_MANAGER_M4SS_PG_QSPI +#endif +#if (SL_HP_SDIO_SPI_PERIPHERAL == 0) + | SL_SI91X_POWER_MANAGER_M4SS_PG_SDIO_SPI +#endif + ), + .ulpss_peripheral = (0 +#if (SL_ULP_AUX_PERIPHERAL == 0) + | SL_SI91X_POWER_MANAGER_ULPSS_PG_AUX +#endif +#if (SL_ULP_CAP_PERIPHERAL == 0) + | SL_SI91X_POWER_MANAGER_ULPSS_PG_CAP +#endif +#if (SL_ULP_FIM_PERIPHERAL == 0) + | SL_SI91X_POWER_MANAGER_ULPSS_PG_FIM +#endif +#if (SL_ULP_I2C_PERIPHERAL == 0) + | SL_SI91X_POWER_MANAGER_ULPSS_PG_I2C +#endif +#if (SL_ULP_I2S_PERIPHERAL == 0) + | SL_SI91X_POWER_MANAGER_ULPSS_PG_I2S +#endif +#if (SL_ULP_IR_PERIPHERAL == 0) + | SL_SI91X_POWER_MANAGER_ULPSS_PG_IR +#endif +#if (SL_ULP_SSI_PERIPHERAL == 0) + | SL_SI91X_POWER_MANAGER_ULPSS_PG_SSI +#endif +#if (SL_ULP_UART_PERIPHERAL == 0) + | SL_SI91X_POWER_MANAGER_ULPSS_PG_UART +#endif +#if (SL_ULP_UDMA_PERIPHERAL == 0) + | SL_SI91X_POWER_MANAGER_ULPSS_PG_UDMA +#endif + ), + .npss_peripheral = (0 +#if (SL_UULP_MCU_STORE1_PERIPHERAL == 0) + | SL_SI91X_POWER_MANAGER_NPSS_PG_MCUSTORE1 +#endif +#if (SL_UULP_MCU_STORE2_PERIPHERAL == 0) + | SL_SI91X_POWER_MANAGER_NPSS_PG_MCUSTORE2 +#endif +#if (SL_UULP_MCU_STORE3_PERIPHERAL == 0) + | SL_SI91X_POWER_MANAGER_NPSS_PG_MCUSTORE3 +#endif +#if (SL_UULP_RTC_PERIPHERAL == 0) + | SL_SI91X_POWER_MANAGER_NPSS_PG_MCURTC +#endif +#if (SL_UULP_TIME_PERIOD_PERIPHERAL == 0) + | SL_SI91X_POWER_MANAGER_NPSS_PG_TIMEPERIOD +#endif +#if (SL_UULP_UPS_PERIPHERAL == 0) + | SL_SI91X_POWER_MANAGER_NPSS_PG_MCUPS +#endif +#if (SL_UULP_UTS_PERIPHERAL == 0) + | SL_SI91X_POWER_MANAGER_NPSS_PG_MCUTS +#endif +#if (SL_UULP_WDT_PERIPHERAL == 0) + | SL_SI91X_POWER_MANAGER_NPSS_PG_MCUWDT +#endif + ), +}; + +sl_power_ram_retention_config_t ram_configuration = { +#if (SL_RAM_RETENTION_USING_SIZE == 1) + .configure_ram_banks = false, + .m4ss_ram_size_kb = SL_LP_RAM_RETENTION_SIZE, + .ulpss_ram_size_kb = SL_ULP_RAM_RETENTION_SIZE, +#else + .configure_ram_banks = true, + .m4ss_ram_banks = (0 +#if (SL_LP_RAM_BANK1 == 0) + | SL_SI91X_POWER_MANAGER_M4SS_RAM_BANK_1 +#endif +#if (SL_LP_RAM_BANK2 == 0) + | SL_SI91X_POWER_MANAGER_M4SS_RAM_BANK_2 +#endif +#if (SL_LP_RAM_BANK3 == 0) + | SL_SI91X_POWER_MANAGER_M4SS_RAM_BANK_3 +#endif +#if (SL_LP_RAM_BANK3 == 0) + | SL_SI91X_POWER_MANAGER_M4SS_RAM_BANK_3 +#endif +#if (SL_LP_RAM_BANK4 == 0) + | SL_SI91X_POWER_MANAGER_M4SS_RAM_BANK_4 +#endif +#if (SL_LP_RAM_BANK5 == 0) + | SL_SI91X_POWER_MANAGER_M4SS_RAM_BANK_5 +#endif +#if (SL_LP_RAM_BANK6 == 0) + | SL_SI91X_POWER_MANAGER_M4SS_RAM_BANK_6 +#endif +#if (SL_LP_RAM_BANK7 == 0) + | SL_SI91X_POWER_MANAGER_M4SS_RAM_BANK_7 +#endif +#if (SL_LP_RAM_BANK8 == 0) + | SL_SI91X_POWER_MANAGER_M4SS_RAM_BANK_8 +#endif +#if (SL_LP_RAM_BANK9 == 0) + | SL_SI91X_POWER_MANAGER_M4SS_RAM_BANK_9 +#endif +#if (SL_LP_RAM_BANK10 == 0) + | SL_SI91X_POWER_MANAGER_M4SS_RAM_BANK_10 +#endif + ), + .ulpss_ram_banks = (0 +#if (SL_ULP_RAM_BANK2 == 0) + | SL_SI91X_POWER_MANAGER_ULPSS_RAM_BANK_2 +#endif +#if (SL_ULP_RAM_BANK3 == 0) + | SL_SI91X_POWER_MANAGER_ULPSS_RAM_BANK_3 +#endif + ), +#endif +}; + +#ifdef __cplusplus +} +#endif + +#endif // SL_SI91X_POWER_MANAGER_CONFIG_3_H diff --git a/matter/si91x/siwx917/BRD2605A/config/sl_si91x_power_manager_wakeup_source_config.h b/matter/si91x/siwx917/BRD2605A/config/sl_si91x_power_manager_wakeup_source_config.h new file mode 100644 index 0000000000..9512dd807a --- /dev/null +++ b/matter/si91x/siwx917/BRD2605A/config/sl_si91x_power_manager_wakeup_source_config.h @@ -0,0 +1,96 @@ +/***************************************************************************/ /** + * @file sl_si91x_power_manager_wakeup_source_config.h + * @brief Power Manager Wakeup Source Configuration + ******************************************************************************* + * # License + * Copyright 2023 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************/ + +#ifndef SL_SI91X_POWER_MANAGER_WAKEUP_SOURCE_CONFIG_H +#define SL_SI91X_POWER_MANAGER_WAKEUP_SOURCE_CONFIG_H + +#ifdef __cplusplus +extern "C" { +#endif + +// <<< Use Configuration Wizard in Context Menu >>> + +// Calendar Wakeup +#define SL_ENABLE_CALENDAR_WAKEUP_SOURCE 0 + +// Enable Second Wakeup Source +// Default: 0 +#define ENABLE_SECOND 0 + +// Enable Alarm Wakeup Source +// Default: 1 +#define ENABLE_ALARM 0 + +// Alarm Time (in milliseconds) +// Default: 5000 +#define ALARM_TIME_MSEC 5000 + +// + +// GPIO Wakeup +#define SL_ENABLE_GPIO_WAKEUP_SOURCE 0 + +// Enable NPSS GPIO 0 +// Default: 0 +#define ENABLE_NPSS_GPIO_0 0 + +// Enable NPSS GPIO 1 +// Default: 0 +#define ENABLE_NPSS_GPIO_1 0 + +// Enable NPSS GPIO 2 +// Default: 0 +#define ENABLE_NPSS_GPIO_2 0 + +// Enable NPSS GPIO 3 +// Default: 0 +#define ENABLE_NPSS_GPIO_3 0 +// + +// Deep Sleep Timer Wakeup +#define SL_ENABLE_DST_WAKEUP_SOURCE 0 + +// Sleep Time (in microseconds) <10000-4294967295> +// Default: 10000 +#define DST_WAKEUP_TIME 10000 + +// + +// Wireless Wakeup +#define SL_ENABLE_WIRELESS_WAKEUP_SOURCE 0 +// + +// <<< end of configuration section >>> + +#ifdef __cplusplus +} +#endif + +#endif // SL_SI91X_POWER_MANAGER_WAKEUP_SOURCE_CONFIG_H diff --git a/matter/si91x/siwx917/BRD2605A/config/sl_si91x_stack_size_config.h b/matter/si91x/siwx917/BRD2605A/config/sl_si91x_stack_size_config.h new file mode 100644 index 0000000000..c369cf7a7a --- /dev/null +++ b/matter/si91x/siwx917/BRD2605A/config/sl_si91x_stack_size_config.h @@ -0,0 +1,35 @@ +/******************************************************************************* +* @file sl_si91x_stack_size_config.h +* @brief +******************************************************************************* +* # License +* Copyright 2023 Silicon Laboratories Inc. www.silabs.com +******************************************************************************* +* +* The licensor of this software is Silicon Laboratories Inc. Your use of this +* software is governed by the terms of Silicon Labs Master Software License +* Agreement (MSLA) available at +* www.silabs.com/about-us/legal/master-software-license-agreement. This +* software is distributed to you in Source Code format and is governed by the +* sections of the MSLA applicable to Source Code. +* +******************************************************************************/ + +#ifndef __SL_SI91X_STACK_SIZE_CONFIG_H_ +#define __SL_SI91X_STACK_SIZE_CONFIG_H_ + +// <<< Use Configuration Wizard in Context Menu >>> +// Memory configuration + +// Stack size for the application. +// Default: 12288 +// The stack size configured here will be used by the stack that the +// application uses when coming out of a reset. +#ifndef SL_STACK_SIZE +#define SL_STACK_SIZE 12288 +#endif + +// +// <<< end of configuration section >>> + +#endif // __SL_SI91X_STACK_SIZE_CONFIG_H_ diff --git a/matter/si91x/siwx917/BRD2605A/config/sl_si91x_ulp_timer_common_config.h b/matter/si91x/siwx917/BRD2605A/config/sl_si91x_ulp_timer_common_config.h new file mode 100644 index 0000000000..761d50ed93 --- /dev/null +++ b/matter/si91x/siwx917/BRD2605A/config/sl_si91x_ulp_timer_common_config.h @@ -0,0 +1,84 @@ +/***************************************************************************/ /** + * @file sl_si91x_ulp_timer_common_config.h + * @brief ULP Timer common configuration file. + ******************************************************************************* + * # License + * Copyright 2023 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************/ + +#ifndef SL_SI91X_ULP_TIMER_COMMON_CONFIG_H +#define SL_SI91X_ULP_TIMER_COMMON_CONFIG_H + +#ifdef __cplusplus +extern "C" { +#endif + +#include "sl_si91x_ulp_timer.h" +/******************************************************************************/ +/******************** ADC Peripheral CommonConfiguration **********************/ + +// <<< Use Configuration Wizard in Context Menu >>> +// ULP Timer Clock Configuration + +// Clock Type +// Static (auto select) +// Dynamic +// Selection of the Timer CLK Type. +#define SL_ULP_TIMER_CLK_TYPE SL_ULP_TIMER_CLK_TYPE_STATIC + +// Sync to ULPSS PCLK +// Enable or disable sync to ULPSS pclock. +// Default: 0 +#define SL_ULP_TIMER_SYNC_TO_ULPSS_PCLK 0 + +// Wait for switching timer clock +// 1 : Enable waiting for switching timer clk & 0 : Skip waiting for switching timer clk. +// Default: 0 +#define SL_ULP_TIMER_SKIP_SWITCH_TIME 0 + +// clock source +// Ref clock +// 32KHZ_RO +// 32KHZ_RC +// 32KHZ_XTAL +// 32MHZ_RC (auto select) +// 20MHZ_RO +// Selection of the Clock source +#define SL_ULP_TIMER_CLK_INPUT_SOURCE ULP_TIMER_32MHZ_RC_CLK_SRC //default timer clock input source is ref clock + +// +// <<< end of configuration section >>> + +ulp_timer_clk_src_config_t sl_timer_clk_handle = { + .ulp_timer_clk_type = SL_ULP_TIMER_CLK_TYPE, + .ulp_timer_sync_to_ulpss_pclk = SL_ULP_TIMER_SYNC_TO_ULPSS_PCLK, + .ulp_timer_clk_input_src = SL_ULP_TIMER_CLK_INPUT_SOURCE, + .ulp_timer_skip_switch_time = SL_ULP_TIMER_SKIP_SWITCH_TIME, +}; + +#ifdef __cplusplus +} +#endif // SL_ULP_TIMER +#endif /* SL_SI91X_ULP_TIMER_COMMON_CONFIG_H */ diff --git a/matter/si91x/siwx917/BRD2605A/config/sl_si91x_ulp_timer_init_timer0_config.h b/matter/si91x/siwx917/BRD2605A/config/sl_si91x_ulp_timer_init_timer0_config.h new file mode 100644 index 0000000000..09d1badb50 --- /dev/null +++ b/matter/si91x/siwx917/BRD2605A/config/sl_si91x_ulp_timer_init_timer0_config.h @@ -0,0 +1,67 @@ +/***************************************************************************/ /** + * @file sl_si91x_ulp_timer_init_timer0_config.h + * @brief ULP Timer timer0 configuration file. + ******************************************************************************* + * # License + * Copyright 2023 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************/ + +#ifndef SL_SI91X_ULP_TIMER_TIMER0_CONFIG_H +#define SL_SI91X_ULP_TIMER_TIMER0_CONFIG_H + +// <<< Use Configuration Wizard in Context Menu >>> +#ifdef __cplusplus +extern "C" { +#endif + +#include "sl_si91x_ulp_timer.h" +/******************************************************************************/ +/******************************* ULP-Timer clock Configuration **************************/ +// timer0 Configuration + +// Timer type +// Down Counter (auto select) +// 1 Micro-Sec +// 256-Micro-Sec +// Selection of the Timer type +#define SL_ULP_TIMER_TIMER0_TYPE ULP_TIMER_TYP_DEFAULT + +// Timer mode +// One-shot +// Periodic (auto select) +// Selection of the Timer mode +#define SL_ULP_TIMER_TIMER0_MODE ULP_TIMER_MODE_PERIODIC + +// Timer direction +// Down (auto select) +// Up +// Selection of the Timer direction +#define SL_ULP_TIMER_TIMER0_DIRECTION DOWN_COUNTER + +// End timer0 Configuration +/******************************************************************************/ +// <<< end of configuration section >>> + +#endif /* SL_SI91X_ULP_TIMER_TIMER0_CONFIG_H */ diff --git a/matter/si91x/siwx917/BRD2605A/config/sl_si91x_ulp_uart_common_config.h b/matter/si91x/siwx917/BRD2605A/config/sl_si91x_ulp_uart_common_config.h new file mode 100644 index 0000000000..921e7a507c --- /dev/null +++ b/matter/si91x/siwx917/BRD2605A/config/sl_si91x_ulp_uart_common_config.h @@ -0,0 +1,43 @@ +/***************************************************************************/ /** + * @file sl_si91x_ulp_uart_common_config.h + * @brief SL SI91X ULP UART Common Config. + ******************************************************************************* + * # License + * Copyright 2023 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************/ + +#ifndef SL_SI91X_ULP_UART_COMMON_CONFIG_H +#define SL_SI91X_ULP_UART_COMMON_CONFIG_H + +// <<< Use Configuration Wizard in Context Menu >>> +// DMA Configuration + +// ULP UART DMA +// Default: 1 +#define SL_ULPUART_DMA_CONFIG_ENABLE 0 + +// +// <<< end of configuration section >>> +#endif // SL_SI91X_ULP_UART_COMMON_CONFIG_H diff --git a/matter/si91x/siwx917/BRD2605A/config/sl_si91x_ulp_uart_config.h b/matter/si91x/siwx917/BRD2605A/config/sl_si91x_ulp_uart_config.h new file mode 100644 index 0000000000..8bd20f97e9 --- /dev/null +++ b/matter/si91x/siwx917/BRD2605A/config/sl_si91x_ulp_uart_config.h @@ -0,0 +1,104 @@ +/***************************************************************************/ /** + * @file sl_si91x_ulp_uart_config.h + * @brief SL ULP UART Config. + ******************************************************************************* + * # License + * Copyright 2023 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************/ + +#ifndef SL_SI91X_ULP_UART_CONFIG_H +#define SL_SI91X_ULP_UART_CONFIG_H + +#ifdef __cplusplus +extern "C" { +#endif + +#include "sl_si91x_usart.h" + +// <<< Use Configuration Wizard in Context Menu >>> + +// ULP UART UC Configuration +// Enable: Peripheral configuration is taken straight from the configuration set in the universal configuration (UC). +// Disable: If the application demands it to be modified during runtime, use the sl_si91x_uart_set_configuration API to modify the peripheral configuration. +// Default: 1 +#define ULP_UART_UC 1 +#define ULPUART_MODULE 2 + +// UART Configuration +#define ENABLE 1 +#define DISABLE 0 + +#if (ULP_UART_UC) +// Baud Rate (Baud/Second) <300-7372800> +// Default: 115200 +#define SL_ULP_UART_BAUDRATE 115200 + +// Parity +// No Parity +// Even +// Odd +// Default: SL_USART_NO_PARITY +#define SL_ULP_UART_PARITY SL_USART_NO_PARITY + +// Stop Bits +// 1 +// 1.5 +// 2 +// Default: USART_STOP_BITS_1 +#define SL_ULP_UART_STOP_BITS SL_USART_STOP_BITS_1 + +// Data Width +// 5 +// 6 +// 7 +// 8 +// Default: USART_DATA_BITS_8 +#define SL_ULP_UART_DATA_BITS SL_USART_DATA_BITS_8 + +// Flow control +// None +// Default: USART_FLOW_CONTROL_NONE +#define SL_ULP_UART_FLOW_CONTROL_TYPE SL_USART_FLOW_CONTROL_NONE +#endif + +// ULP_UART Configuration +// + +#ifdef __cplusplus +} +#endif +// <<< end of configuration section >>> + +#if (ULP_UART_UC) +sl_si91x_usart_control_config_t ulp_uart_configuration = { .baudrate = SL_ULP_UART_BAUDRATE, + .mode = SL_USART_MODE_ASYNCHRONOUS, + .parity = SL_ULP_UART_PARITY, + .stopbits = SL_ULP_UART_STOP_BITS, + .hwflowcontrol = SL_ULP_UART_FLOW_CONTROL_TYPE, + .databits = SL_ULP_UART_DATA_BITS, + .usart_module = ULPUART_MODULE }; + +#endif //ULP_UART_UC +#endif //SL_SI91X_UART_CONFIG_H diff --git a/matter/si91x/siwx917/BRD2605A/config/sl_sleeptimer_config.h b/matter/si91x/siwx917/BRD2605A/config/sl_sleeptimer_config.h new file mode 100644 index 0000000000..8344ef5f11 --- /dev/null +++ b/matter/si91x/siwx917/BRD2605A/config/sl_sleeptimer_config.h @@ -0,0 +1,82 @@ +/***************************************************************************//** + * @file + * @brief Sleep Timer configuration file. + ******************************************************************************* + * # License + * Copyright 2020 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * SPDX-License-Identifier: Zlib + * + * The licensor of this software is Silicon Laboratories Inc. + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + * + ******************************************************************************/ + +// <<< Use Configuration Wizard in Context Menu >>> + +#ifndef SL_SLEEPTIMER_CONFIG_H +#define SL_SLEEPTIMER_CONFIG_H + +#define SL_SLEEPTIMER_PERIPHERAL_DEFAULT 0 +#define SL_SLEEPTIMER_PERIPHERAL_RTCC 1 +#define SL_SLEEPTIMER_PERIPHERAL_PRORTC 2 +#define SL_SLEEPTIMER_PERIPHERAL_RTC 3 +#define SL_SLEEPTIMER_PERIPHERAL_SYSRTC 4 +#define SL_SLEEPTIMER_PERIPHERAL_BURTC 5 +#define SL_SLEEPTIMER_PERIPHERAL_WTIMER 6 +#define SL_SLEEPTIMER_PERIPHERAL_TIMER 7 + +// Timer Peripheral Used by Sleeptimer +// Default (auto select) +// RTCC +// Radio internal RTC (PRORTC) +// RTC +// SYSRTC +// Back-Up RTC (BURTC) +// WTIMER +// TIMER +// Selection of the Timer Peripheral Used by the Sleeptimer +#define SL_SLEEPTIMER_PERIPHERAL SL_SLEEPTIMER_PERIPHERAL_DEFAULT + +// TIMER/WTIMER Instance Used by Sleeptimer (not applicable for other peripherals) +// Make sure TIMER instance size is 32bits. Check datasheet for 32bits TIMERs. +// Default: 0 +#define SL_SLEEPTIMER_TIMER_INSTANCE 0 + +// Enable wallclock functionality +// Enable or disable wallclock functionalities (get_time, get_date, etc). +// Default: 0 +#define SL_SLEEPTIMER_WALLCLOCK_CONFIG 0 + +// Timer frequency divider (not applicable for WTIMER/TIMER) +// WTIMER/TIMER peripherals are always prescaled to 1024. +// Default: 1 +#define SL_SLEEPTIMER_FREQ_DIVIDER 1 + +// If Radio internal RTC (PRORTC) HAL is used, determines if it owns the IRQ handler. Enable, if no wireless stack is used. +// Default: 0 +#define SL_SLEEPTIMER_PRORTC_HAL_OWNS_IRQ_HANDLER 0 + +// Enable DEBUGRUN functionality on hardware RTC. +// Default: 0 +#define SL_SLEEPTIMER_DEBUGRUN 0 + +#endif /* SLEEPTIMER_CONFIG_H */ + +// <<< end of configuration section >>> diff --git a/matter/si91x/siwx917/BRD2605A/support/hal/rsi_hal_mcu_m4.c b/matter/si91x/siwx917/BRD2605A/support/hal/rsi_hal_mcu_m4.c new file mode 100644 index 0000000000..cf5c8c0202 --- /dev/null +++ b/matter/si91x/siwx917/BRD2605A/support/hal/rsi_hal_mcu_m4.c @@ -0,0 +1,82 @@ +/* + * + * Copyright (c) 2022 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "rsi_debug.h" +#include "rsi_pll.h" +#include "rsi_rom_clks.h" +#include "silabs_utils.h" +#include "sl_si91x_button_pin_config.h" +#include "sli_siwx917_soc.h" + +#define SOC_PLL_REF_FREQUENCY 40000000 // /* PLL input REFERENCE clock 40MHZ */ + +// Note: Change this macro to required PLL frequency in hertz +#define PS4_SOC_FREQ 180000000 /* PLL out clock 180MHz */ +#define SWITCH_QSPI_TO_SOC_PLL +#define ICACHE_DISABLE +#define DEBUG_DISABLE + +/* QSPI clock config params */ +#define INTF_PLL_500_CTRL_VALUE 0xD900 +#define INTF_PLL_CLK 80000000 /* PLL out clock 80 MHz */ + +#define PMU_GOOD_TIME 31 /*Duration in us*/ +#define XTAL_GOOD_TIME 31 /*Duration in us*/ + +/*Pre-fetch and regestring */ +#define ICACHE2_ADDR_TRANSLATE_1_REG *(volatile uint32_t *)(0x20280000 + 0x24) +#define MISC_CFG_SRAM_REDUNDANCY_CTRL *(volatile uint32_t *)(0x46008000 + 0x18) +#define MISC_CONFIG_MISC_CTRL1 *(volatile uint32_t *)(0x46008000 + 0x44) +#define MISC_QUASI_SYNC_MODE *(volatile uint32_t *)(0x46008000 + 0x84) + +void sl_button_on_change(uint8_t btn, uint8_t btnAction); + +int soc_pll_config(void) { + int32_t status = RSI_OK; + + RSI_CLK_M4SocClkConfig(M4CLK, M4_ULPREFCLK, 0); + // Configures the required registers for 180 Mhz clock in PS4 + RSI_PS_PS4SetRegisters(); + // Configure the PLL frequency + // Configure the SOC PLL to 180MHz + RSI_CLK_SetSocPllFreq(M4CLK, PS4_SOC_FREQ, SOC_PLL_REF_FREQUENCY); + // Switch M4 clock to PLL clock for speed operations + RSI_CLK_M4SocClkConfig(M4CLK, M4_SOCPLLCLK, 0); + + SysTick_Config(SystemCoreClock / 1000); + DEBUGINIT(); + +#ifdef SWITCH_QSPI_TO_SOC_PLL + /* program intf pll to 160Mhz */ + SPI_MEM_MAP_PLL(INTF_PLL_500_CTRL_REG9) = INTF_PLL_500_CTRL_VALUE; + status = RSI_CLK_SetIntfPllFreq(M4CLK, INTF_PLL_CLK, SOC_PLL_REF_FREQUENCY); + if (status != RSI_OK) { + SILABS_LOG("Failed to Config Interface PLL Clock, status:%d", status); + } else { + SILABS_LOG("Configured Interface PLL Clock to %d", INTF_PLL_CLK); + } + + RSI_CLK_QspiClkConfig(M4CLK, QSPI_INTFPLLCLK, 0, 0, 1); +#endif /* SWITCH_QSPI_TO_SOC_PLL */ + return 0; +} + +void sl_si91x_button_isr(uint8_t pin, uint8_t state) { + (pin == SL_BUTTON_BTN0_PIN) + ? sl_button_on_change(SL_BUTTON_BTN0_NUMBER, !state) + : sl_button_on_change(SL_BUTTON_BTN1_NUMBER, !state); +} diff --git a/matter/si91x/siwx917/BRD2605A/support/inc/system_si917.h b/matter/si91x/siwx917/BRD2605A/support/inc/system_si917.h new file mode 100644 index 0000000000..d373eb283a --- /dev/null +++ b/matter/si91x/siwx917/BRD2605A/support/inc/system_si917.h @@ -0,0 +1,168 @@ +/* + * + * Copyright (c) 2022 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#ifdef __cplusplus +extern "C" { +#endif + +// system header +#include "si91x_device.h" +// Processor spefic haeders +#include "core_cm4.h" /* Cortex-M4 processor and core peripherals */ +#include + +// CMSIS GCC header +#include "cmsis_gcc.h" + +/******************************************************************************* + * @addtogroup Parts + * @{ + ******************************************************************************/ +/******************************************************************************* + * @addtogroup EFR32 EFR32 + * @{ + ******************************************************************************/ + +/******************************************************************************* + ****************************** TYPEDEFS *********************************** + ******************************************************************************/ + +/* Interrupt vectortable entry */ +typedef union { + void (*VECTOR_TABLE_Type)(void); + void *topOfStack; +} tVectorEntry; + +/******************************************************************************* + ************************** GLOBAL VARIABLES ******************************* + ******************************************************************************/ +//#ifndef CCP_SI917_BRINGUP +extern uint32_t SystemCoreClock; /**< System Clock Frequency (Core Clock) */ +//#endif /* CCP_SI917_BRINGUP */ +extern uint32_t SystemHfrcoFreq; /**< System HFRCO frequency */ + +/******************************************************************************* + ***************************** PROTOTYPES ********************************** + ******************************************************************************/ + +void Reset_Handler(void); /**< Reset Handler */ +void NMI_Handler(void); /**< NMI Handler */ +void HardFault_Handler(void); /**< Hard Fault Handler */ +void MemManage_Handler(void); /**< MPU Fault Handler */ +void BusFault_Handler(void); /**< Bus Fault Handler */ +void UsageFault_Handler(void); /**< Usage Fault Handler */ +void SVC_Handler(void); /**< SVCall Handler */ +void DebugMon_Handler(void); /**< Debug Monitor Handler */ +void PendSV_Handler(void); /**< PendSV Handler */ +void SysTick_Handler(void); /**< SysTick Handler */ + +void EMU_IRQHandler(void); /**< EMU IRQ Handler */ +void FRC_PRI_IRQHandler(void); /**< FRC_PRI IRQ Handler */ +void WDOG0_IRQHandler(void); /**< WDOG0 IRQ Handler */ +void WDOG1_IRQHandler(void); /**< WDOG1 IRQ Handler */ +void FRC_IRQHandler(void); /**< FRC IRQ Handler */ +void MODEM_IRQHandler(void); /**< MODEM IRQ Handler */ +void RAC_SEQ_IRQHandler(void); /**< RAC_SEQ IRQ Handler */ +void RAC_RSM_IRQHandler(void); /**< RAC_RSM IRQ Handler */ +void BUFC_IRQHandler(void); /**< BUFC IRQ Handler */ +void LDMA_IRQHandler(void); /**< LDMA IRQ Handler */ +void GPIO_EVEN_IRQHandler(void); /**< GPIO_EVEN IRQ Handler */ +void TIMER0_IRQHandler(void); /**< TIMER0 IRQ Handler */ +void USART0_RX_IRQHandler(void); /**< USART0_RX IRQ Handler */ +void USART0_TX_IRQHandler(void); /**< USART0_TX IRQ Handler */ +void ACMP0_IRQHandler(void); /**< ACMP0 IRQ Handler */ +void ADC0_IRQHandler(void); /**< ADC0 IRQ Handler */ +void IDAC0_IRQHandler(void); /**< IDAC0 IRQ Handler */ +void I2C0_IRQHandler(void); /**< I2C0 IRQ Handler */ +void GPIO_ODD_IRQHandler(void); /**< GPIO_ODD IRQ Handler */ +void TIMER1_IRQHandler(void); /**< TIMER1 IRQ Handler */ +void USART1_RX_IRQHandler(void); /**< USART1_RX IRQ Handler */ +void USART1_TX_IRQHandler(void); /**< USART1_TX IRQ Handler */ +void LEUART0_IRQHandler(void); /**< LEUART0 IRQ Handler */ +void PCNT0_IRQHandler(void); /**< PCNT0 IRQ Handler */ +void CMU_IRQHandler(void); /**< CMU IRQ Handler */ +void MSC_IRQHandler(void); /**< MSC IRQ Handler */ +void CRYPTO0_IRQHandler(void); /**< CRYPTO IRQ Handler */ +void LETIMER0_IRQHandler(void); /**< LETIMER0 IRQ Handler */ +void AGC_IRQHandler(void); /**< AGC IRQ Handler */ +void PROTIMER_IRQHandler(void); /**< PROTIMER IRQ Handler */ +void RTCC_IRQHandler(void); /**< RTCC IRQ Handler */ +void SYNTH_IRQHandler(void); /**< SYNTH IRQ Handler */ +void CRYOTIMER_IRQHandler(void); /**< CRYOTIMER IRQ Handler */ +void RFSENSE_IRQHandler(void); /**< RFSENSE IRQ Handler */ +void FPUEH_IRQHandler(void); /**< FPUEH IRQ Handler */ +void SMU_IRQHandler(void); /**< SMU IRQ Handler */ +void WTIMER0_IRQHandler(void); /**< WTIMER0 IRQ Handler */ +void WTIMER1_IRQHandler(void); /**< WTIMER1 IRQ Handler */ +void PCNT1_IRQHandler(void); /**< PCNT1 IRQ Handler */ +void PCNT2_IRQHandler(void); /**< PCNT2 IRQ Handler */ +void USART2_RX_IRQHandler(void); /**< USART2_RX IRQ Handler */ +void USART2_TX_IRQHandler(void); /**< USART2_TX IRQ Handler */ +void I2C1_IRQHandler(void); /**< I2C1 IRQ Handler */ +void USART3_RX_IRQHandler(void); /**< USART3_RX IRQ Handler */ +void USART3_TX_IRQHandler(void); /**< USART3_TX IRQ Handler */ +void VDAC0_IRQHandler(void); /**< VDAC0 IRQ Handler */ +void CSEN_IRQHandler(void); /**< CSEN IRQ Handler */ +void LESENSE_IRQHandler(void); /**< LESENSE IRQ Handler */ +void CRYPTO1_IRQHandler(void); /**< CRYPTO1 IRQ Handler */ +void TRNG0_IRQHandler(void); /**< TRNG0 IRQ Handler */ +void SYSCFG_IRQHandler(void); /**< SYSCFG IRQ Handler */ + +uint32_t SystemCoreClockGet(void); + +/******************************************************************************* + * @brief + * Update CMSIS SystemCoreClock variable. + * + * @details + * CMSIS defines a global variable SystemCoreClock + *that shall hold the core frequency in Hz. If the + *core frequency is dynamically changed, the variable + *must be kept updated in order to be CMSIS compliant. + * + * Notice that only if changing the core clock + *frequency through the EFR CMU API, this variable + *will be kept updated. This function is only provided + * for CMSIS compliance and if a user modifies the + *the core clock outside the CMU API. + ******************************************************************************/ +#ifndef CCP_SI917_BRINGUP +static __INLINE void SystemCoreClockUpdate(void) { (void)SystemCoreClockGet(); } +#endif /* CCP_SI917_BRINGUP */ + +uint32_t SystemMaxCoreClockGet(void); + +void SystemInit(void); +uint32_t SystemHFClockGet(void); + +uint32_t SystemHFXOClockGet(void); +void SystemHFXOClockSet(uint32_t freq); + +uint32_t SystemLFRCOClockGet(void); +uint32_t SystemULFRCOClockGet(void); + +uint32_t SystemLFXOClockGet(void); +void SystemLFXOClockSet(uint32_t freq); + +/** @} End of group */ +/** @} End of group Parts */ + +#ifdef __cplusplus +} +#endif diff --git a/matter/si91x/siwx917/BRD2605A/support/src/startup_common_RS1xxxx.c b/matter/si91x/siwx917/BRD2605A/support/src/startup_common_RS1xxxx.c new file mode 100644 index 0000000000..f05122df80 --- /dev/null +++ b/matter/si91x/siwx917/BRD2605A/support/src/startup_common_RS1xxxx.c @@ -0,0 +1,514 @@ +/** + ****************************************************************************** + * @file startup_si91x.c + * @author Coocox + * @version V1.0 + * @date 03/16/2013 + * @brief Cortex M4 Devices Startup code. + * This module performs: + * - Set the initial SP + * - Set the vector table entries with the exceptions ISR address + * - Initialize data and bss + * - Call the application's entry point. + * After Reset the Cortex-M4 processor is in Thread mode, + * priority is Privileged, and the Stack is set to Main. + ******************************************************************************* + */ +// System headers +#include "si91x_device.h" +#include "system_si91x.h" +// Processor specific headers +#include "core_cm4.h" +#include "rsi_ps_ram_func.h" +/*----------Stack Symbols-----------------------------------------------*/ +extern uint32_t __StackTop; +extern uint32_t __co_stackTop; + +/*----------Macro definition--------------------------------------------------*/ +#define WEAK __attribute__((weak)) + +/*----------Declaration of the default fault handlers-------------------------*/ +#ifndef __START +extern void _start(void) + __attribute__((noreturn)); /* Pre Main (C library entry point) */ +#else +extern int __START(void) __attribute__((noreturn)); /* main entry point */ +#endif + +/* System exception vector handler */ +__attribute__((used)) void WEAK Reset_Handler(void); +void WEAK NMI_Handler(void); +void WEAK HardFault_Handler(void); +void WEAK MemManage_Handler(void); +void WEAK BusFault_Handler(void); +void WEAK UsageFault_Handler(void); +void WEAK SVC_Handler(void); +void WEAK DebugMon_Handler(void); +void WEAK PendSV_Handler(void); +void WEAK SysTick_Handler(void); + +/*Boot up functions*/ +void RSI_Default_Reset_Handler(void); +void RSI_Default_WakeUp_Handler(void); +void RSI_PS_RestoreCpuContext(void); + +void WEAK IRQ000_Handler(void); /*!< ULP Processor Interrupt 0 */ +void WEAK IRQ001_Handler(void); /*!< ULP Processor Interrupt 1 */ +void WEAK IRQ002_Handler(void); /*!< ULP Processor Interrupt 2 */ +void WEAK IRQ003_Handler(void); /*!< ULP Processor Interrupt 3 */ +void WEAK IRQ004_Handler(void); /*!< ULP Processor Interrupt 4 */ +void WEAK IRQ005_Handler(void); /*!< ULP Processor Interrupt 5 */ +void WEAK IRQ006_Handler(void); /*!< ULP Processor Interrupt 6 */ +void WEAK IRQ007_Handler(void); /*!< ULP Processor Interrupt 7 */ +void WEAK IRQ008_Handler(void); /*!< ULP Processor Interrupt 8 */ +void WEAK IRQ009_Handler(void); /*!< ULP Processor Interrupt 9 */ +void WEAK IRQ010_Handler(void); /*!< ULP Processor Interrupt 10 */ +void WEAK IRQ011_Handler(void); /*!< ULP Processor Interrupt 11 */ +void WEAK IRQ012_Handler(void); /*!< ULP Processor Interrupt 12 */ +void WEAK IRQ013_Handler(void); /*!< ULP Processor Interrupt 13 */ +void WEAK IRQ014_Handler(void); /*!< ULP Processor Interrupt 14 */ +void WEAK IRQ015_Handler(void); /*!< ULP Processor Interrupt 15 */ +void WEAK IRQ016_Handler(void); /*!< ULP Processor Interrupt 15 */ +void WEAK IRQ017_Handler(void); /*!< ULP Processor Interrupt 17 */ +void WEAK IRQ018_Handler(void); /*!< ULP Processor Interrupt 18 */ +void WEAK IRQ019_Handler(void); /*!< ULP Processor Interrupt 19 */ +void WEAK IRQ020_Handler(void); +/*!< Sleep Sensor Interrupts 0 */ /*WDT*/ +void WEAK IRQ021_Handler(void); /*!< Sleep Sensor Interrupts 1 */ +void WEAK IRQ022_Handler(void); /*!< Sleep Sensor Interrupts 2 */ +void WEAK IRQ023_Handler(void); /*!< Sleep Sensor Interrupts 3 */ +void WEAK IRQ024_Handler(void); /*!< Sleep Sensor Interrupts 4 */ +void WEAK IRQ025_Handler(void); /*!< Sleep Sensor Interrupts 5 */ +void WEAK IRQ026_Handler(void); /*!< Sleep Sensor Interrupts 6 */ +void WEAK IRQ027_Handler(void); /*!< Sleep Sensor Interrupts 7 */ +void WEAK IRQ028_Handler(void); +/*!< Sleep Sensor Interrupts 8 */ /*Alarm*/ +void WEAK IRQ029_Handler(void); +/*!< Sleep Sensor Interrupts 9 */ /*Msec and sec interrupt */ +void WEAK IRQ030_Handler(void); /*!< Reserved */ +void WEAK IRQ031_Handler(void); /*!< M4SS DMA interrupt */ +void WEAK IRQ032_Handler(void); /*!< Reserved */ +void WEAK IRQ033_Handler(void); /*!< M4SS DMA interrupt */ +void WEAK IRQ034_Handler(void); /*!< M4SS SCT interrupt */ +void WEAK HIF1_IRQHandler(void); /*!< HIF Interrupt 1 */ +void WEAK HIF2_IRQHandler(void); /*!< HIF Interrupt 2 */ +void WEAK IRQ037_Handler(void); /*!< SIO Interrupt */ +void WEAK IRQ038_Handler(void); /*!< USART 1 Interrupt */ +void WEAK IRQ039_Handler(void); /*!< Reserved */ +void WEAK IRQ040_Handler(void); /*!< Reserved */ +void WEAK IRQ041_Handler(void); /*!< Reserved */ +void WEAK IRQ042_Handler(void); /*!< I2C Interrupt */ +void WEAK IRQ043_Handler(void); /*!< Reserved */ +void WEAK IRQ044_Handler(void); /*!< SSI Slave Interrupt */ +void WEAK IRQ045_Handler(void); /*!< Reserved */ +void WEAK IRQ046_Handler(void); /*!< GSPI Master 1 Interrupt */ +void WEAK IRQ047_Handler(void); /*!< Reserved */ +void WEAK IRQ048_Handler(void); /*!< MCPWM Interrupt */ +void WEAK IRQ049_Handler(void); /*!< QEI Interrupt */ +void WEAK IRQ050_Handler(void); /*!< GPIO Group Interrupt 0 */ +void WEAK IRQ051_Handler(void); /*!< GPIO Group Interrupt 1 */ +void WEAK IRQ052_Handler(void); /*!< GPIO Pin Interrupt 0 */ +void WEAK IRQ053_Handler(void); /*!< GPIO Pin Interrupt 1 */ +void WEAK IRQ054_Handler(void); /*!< GPIO Pin Interrupt 2 */ +void WEAK IRQ055_Handler(void); /*!< GPIO Pin Interrupt 3 */ +void WEAK IRQ056_Handler(void); /*!< GPIO Pin Interrupt 4 */ +void WEAK IRQ057_Handler(void); /*!< GPIO Pin Interrupt 5 */ +void WEAK IRQ058_Handler(void); /*!< GPIO Pin Interrupt 6 */ +void WEAK IRQ059_Handler(void); /*!< GPIO Pin Interrupt 7 */ +void WEAK IRQ060_Handler(void); /*!< QSPI Interrupt */ +void WEAK IRQ061_Handler(void); /*!< I2C 2 Interrupt */ +void WEAK IRQ062_Handler(void); /*!< Ethernet Interrupt */ +void WEAK IRQ063_Handler(void); /*!< Reserved */ +void WEAK IRQ064_Handler(void); /*!< I2S master Interrupt */ +void WEAK IRQ065_Handler(void); /*!< Reserved */ +void WEAK IRQ066_Handler(void); /*!< Can 1 Interrupt */ +void WEAK IRQ067_Handler(void); /*!< Reserved */ +void WEAK IRQ068_Handler(void); /*!< SDMEM Interrupt */ +void WEAK IRQ069_Handler(void); /*!< PLL clock ind Interrupt */ +void WEAK IRQ070_Handler(void); /*!< Reserved */ +void WEAK IRQ071_Handler(void); /*!< CCI system Interrupt Out */ +void WEAK IRQ072_Handler(void); /*!< FPU exception */ +void WEAK IRQ073_Handler(void); /*!< USB INTR */ +void WEAK IRQ074_Handler(void); /*!< TASS_P2P_INTR */ +void WEAK IRQ075_Handler(void); /*!< WLAN Band1 intr0 */ +void WEAK IRQ076_Handler(void); /*!< WLAN Band1 intr1 */ +void WEAK IRQ077_Handler(void); /*!< Reserved */ +void WEAK IRQ078_Handler(void); /*!< Reserved */ +void WEAK IRQ079_Handler(void); /*!< BT intr */ +void WEAK IRQ080_Handler(void); /*!< ZB intr */ +void WEAK IRQ081_Handler(void); /*!< Reserved */ +void WEAK IRQ082_Handler(void); /*!< Modem disabled mode trigger intr */ +void WEAK IRQ083_Handler(void); /*!< gpio intr */ +void WEAK IRQ084_Handler(void); /*!< uart intr */ +void WEAK IRQ085_Handler(void); /*!< watch dog level intr */ +void WEAK IRQ086_Handler(void); /*!< ULP Sleep sensor interrupt */ +void WEAK IRQ087_Handler(void); /*!< ECDH intr */ +void WEAK IRQ088_Handler(void); /*!< DH intr */ +void WEAK IRQ089_Handler(void); /*!< QSPI intr */ +void WEAK IRQ090_Handler(void); /*!< ULP processor interrupt TASS */ +void WEAK IRQ091_Handler(void); /*!< Sys Tick Timer */ +void WEAK IRQ092_Handler(void); /*!< Real Timer interrupt */ +void WEAK IRQ093_Handler(void); /*!< PLL lock interrupt */ +void WEAK IRQ094_Handler(void); /*!< Reserved */ +void WEAK IRQ095_Handler(void); /*!< UART2 Interrupt */ +void WEAK IRQ096_Handler(void); /*!< I2S Interrupt */ +void WEAK IRQ097_Handler(void); /*!< I2C Interrupt */ +void WEAK IRQ098_Handler(void); /*!< RESERVED */ + +/*----------Symbols defined in linker script----------------------------------*/ +extern unsigned long _sidata; /*!< Start address for the initialization + values of the .data section. */ +extern unsigned long _sdata; /*!< Start address for the .data section */ +extern unsigned long _edata; /*!< End address for the .data section */ +extern unsigned long _sbss; /*!< Start address for the .bss section */ +extern unsigned long _ebss; /*!< End address for the .bss section */ +extern void _eram; /*!< End address for ram */ +extern uint32_t __etext; +extern unsigned long __StackTop; + +/*----------Function prototypes-----------------------------------------------*/ +extern int main(void); /*!< The entry point for the application */ +void Default_Reset_Handler(void); /*!< Default reset handler */ +static void Default_Handler(void); /*!< Default exception handler */ +/** + *@brief The minimal vector table for a Cortex M4. Note that the proper + *constructs must be placed on this to ensure that it ends up at physical + *address 0x00000000. + */ +__attribute__((used, + section(".isr_vector"))) void (*const g_pfnVectors[])(void) = { + /*----------------------------------Core + Exceptions---------------------------------- */ + + (void *)&__StackTop, /*!< The initial stack pointer (0x00) */ + (void *)0x300001, /*!< Reset Handler */ + NMI_Handler, /*!< NMI Handler */ + HardFault_Handler, /*!< Hard Fault Handler */ + MemManage_Handler, /*!< MPU Fault Handler */ + BusFault_Handler, /*!< Bus Fault Handler */ + UsageFault_Handler, /*!< Usage Fault Handler */ + 0, /*!< Reserved */ + 0, /*!< Reserved */ + 0, /*!< Reserved */ + 0, /*!< Reserved */ + SVC_Handler, /*!< SVCall Handler */ + DebugMon_Handler, /*!< Debug Monitor Handler */ + 0, /*!< Reserved */ + PendSV_Handler, /*!< PendSV Handler */ + SysTick_Handler, /*!< SysTick Handler */ + + IRQ000_Handler, // 0: VAD interrupt + IRQ001_Handler, // 1: ULP Processor Interrupt1 + IRQ002_Handler, // 2: ULP Processor Interrupt2 + IRQ003_Handler, // 3: ULP Processor Interrupt3 + IRQ004_Handler, // 4: ULP Processor Interrupt4 + IRQ005_Handler, // 5: ULP Processor Interrupt5 + IRQ006_Handler, // 6: ULP Processor Interrupt6 + IRQ007_Handler, // 7: ULP Processor Interrupt7 + IRQ008_Handler, // 8: ULP Processor Interrupt8 + IRQ009_Handler, // 9: ULP Processor Interrupt8 + IRQ010_Handler, // 10: ULP Processor Interrupt8 + IRQ011_Handler, // 11: ULP Processor Interrupt8 + IRQ012_Handler, // 12: ULP Processor Interrupt8 + IRQ013_Handler, // 13: ULP Processor Interrupt8 + IRQ014_Handler, // 14: ULP Processor Interrupt8 + IRQ015_Handler, // 15: ULP Processor Interrupt8 + IRQ016_Handler, // 16: ULP Processor Interrupt8 + IRQ017_Handler, // 17: ULP Processor Interrupt8 + IRQ018_Handler, // 18: ULP Processor Interrupt8 + IRQ019_Handler, // 19: ULP Processor Interrupt8 + IRQ020_Handler, // 20: Sleep Sensor Interrupts 0 + IRQ021_Handler, // 21: Sleep Sensor Interrupts 1 + IRQ022_Handler, // 22: Sleep Sensor Interrupts 2 + IRQ023_Handler, // 23: Sleep Sensor Interrupts 3 + IRQ024_Handler, // 24: Sleep Sensor Interrupts 4 + IRQ025_Handler, // 25: Sleep Sensor Interrupts 5 + IRQ026_Handler, // 26: Sleep Sensor Interrupts 6 + IRQ027_Handler, // 27: Sleep Sensor Interrupts 7 + IRQ028_Handler, // 28: Sleep Sensor Interrupts 8 + IRQ029_Handler, // 29: Sleep Sensor Interrupts 9 + (void *)&__co_stackTop, // 30: Reserved + IRQ031_Handler, // 31: RPDMA interrupt + RSI_Default_Reset_Handler, // 32: Reserved + IRQ033_Handler, // 33: UDMA interrupt + IRQ034_Handler, // 34: SCT interrupt + HIF1_IRQHandler, // 35: HIF Interrupt1 + HIF2_IRQHandler, // 36: HIF Interrupt2 + IRQ037_Handler, // 37: SIO Interrupt + IRQ038_Handler, // 38: USART 1 Interrupt + IRQ039_Handler, // 39: USART 2 Interrupt + RSI_PS_RestoreCpuContext, // 40: USART 3 Interrupt + IRQ041_Handler, // 41: GPIO WAKEUP INTERRUPT + IRQ042_Handler, // 42: I2C Interrupt + (void *)0x10AD10AD, // 43: Reserved + IRQ044_Handler, // 44: SSI Slave Interrupt + 0, // 45: Reserved + IRQ046_Handler, // 46: GSPI Master 1 Interrupt + IRQ047_Handler, // 47: Reserved + IRQ048_Handler, // 48: MCPWM Interrupt + IRQ049_Handler, // 49: QEI Interrupt + IRQ050_Handler, // 50: GPIO Group Interrupt 0 + IRQ051_Handler, // 51: GPIO Group Interrupt 1 + IRQ052_Handler, // 52: GPIO Pin Interrupt 0 + IRQ053_Handler, // 53: GPIO Pin Interrupt 1 + IRQ054_Handler, // 54: GPIO Pin Interrupt 2 + IRQ055_Handler, // 55: GPIO Pin Interrupt 3 + IRQ056_Handler, // 56: GPIO Pin Interrupt 4 + IRQ057_Handler, // 57: GPIO Pin Interrupt 5 + IRQ058_Handler, // 58: GPIO Pin Interrupt 6 + IRQ059_Handler, // 59: GPIO Pin Interrupt 7 + IRQ060_Handler, // 60: QSPI Interrupt + IRQ061_Handler, // 61: I2C 2 Interrupt + IRQ062_Handler, // 62: Ethernet Interrupt + IRQ063_Handler, // 63: Reserved + IRQ064_Handler, // 64: I2S master Interrupt + 0, // 65: Reserved + IRQ066_Handler, // 66: Can 1 Interrupt + 0, // 67: Reserved + IRQ068_Handler, // 68: SDMEM Interrupt + IRQ069_Handler, // 69: PLL clock ind Interrupt + 0, // 70: Reserved + IRQ071_Handler, // 71: CCI system Interrupt Out + IRQ072_Handler, // 72: FPU exception + IRQ073_Handler, // 73: USB INTR + IRQ074_Handler, // 74: TASS_P2P_INTR + IRQ075_Handler, // 75: WLAN Band1 intr0(TA) + IRQ076_Handler, // 76: WLAN Band1 intr1(TA) + 0, // 77: Reserved(TA) + 0, // 78: Reserved(TA) + IRQ079_Handler, // 79: BT intr(TA) + IRQ080_Handler, // 80: ZB intr(TA) + 0, // 81: Reserved(TA) + IRQ082_Handler, // 82: Modem disabled mode trigger intr(TA) + IRQ083_Handler, // 83: gpio intr(TA) + IRQ084_Handler, // 84: uart intr(TA) + IRQ085_Handler, // 85: watch dog level intr(TA) + IRQ086_Handler, // 86: ULP Sleep sensor interrupt(TA) + IRQ087_Handler, // 87: ECDH intr(TA) + IRQ088_Handler, // 88: DH intr(TA) + IRQ089_Handler, // 89: QSPI intr(TA) + IRQ090_Handler, // 90: ULP processor interrupt TASS(TA) + IRQ091_Handler, // 91: Sys Tick Timer(TA) + IRQ092_Handler, // 92: Real Timer interrupt(TA) + IRQ093_Handler, // 93: PLL lock interrupt(TA) + 0, // 94: Reserved(TA) + IRQ095_Handler, // 95: UART2 Interrupt(TA) + 0, // 96: Reserved(TA) + IRQ097_Handler, // 97: I2C Interrupt(TA) +}; + +/** + * @brief This is the code that gets never called, Dummy handler + * @param None + * @retval None + */ +void Default_Reset_Handler(void) { + /*Generic Default reset handler for CM4 */ + while (1) + ; +} + +/** + * @brief This is the code that gets called when the processor first + * starts execution following a reset event. Only the absolutely + * necessary set is performed, after which the application + * supplied main() routine is called. + */ +volatile unsigned long *pulSrc, *pulDest; + +#ifdef M4_PS2_STATE +__attribute__((section(".reset_handler"))) +#endif +#ifdef EXECUTION_FROM_RAM +__attribute__((section(".ramVector"))) char RAM_VECTOR[sizeof(g_pfnVectors)]; +__attribute__ ((section(".reset_handler"))) +#endif + +void Copy_Table() +{ + uint32_t *pSrc, *pDest; + extern uint32_t __etext; + extern uint32_t __data_start__; + extern uint32_t __data_end__; + pSrc = &__etext; + pDest = &__data_start__; + + for (; pDest < &__data_end__;) { + *pDest++ = *pSrc++; + } +} + +void Zero_Table() { + uint32_t *pDest; + extern uint32_t __bss_start__; + extern uint32_t __bss_end__; + pDest = &__bss_start__; + + for (; pDest < &__bss_end__;) { + *pDest++ = 0UL; + } +} + +void RSI_Default_Reset_Handler(void) { + +#ifdef BOOTLOADER_ENABLE + SystemInit2(); +#endif /* BOOTLOADER_ENABLE */ + +#if defined(__GNUC__) && defined(__START) + Copy_Table(); + Zero_Table(); + __START(); +#else +#if 0 // senthil_ccp + __PROGRAM_START(); /* Enter PreMain (C library entry point) */ +#else + Copy_Table(); + Zero_Table(); + +#ifdef EXECUTION_FROM_RAM + // copying the vector table from flash to ram + memcpy(RAM_VECTOR, (uint32_t *)SCB->VTOR, sizeof(g_pfnVectors)); + // assing the ram vector address to VTOR register + SCB->VTOR = (uint32_t)RAM_VECTOR; +#endif + +#ifndef __NO_SYSTEM_INIT + SystemInit(); /* CMSIS System Initialization */ +#endif + _start(); +#endif +#endif /* __GNUC__ */ +} + +/** + *@brief Provide weak aliases for each Exception handler to the Default_Handler. + * As they are weak aliases, any function with the same name will override + * this definition. + */ +#pragma weak Reset_Handler = Default_Reset_Handler +#pragma weak NMI_Handler = Default_Handler +#pragma weak HardFault_Handler = Default_Handler +#pragma weak MemManage_Handler = Default_Handler +#pragma weak BusFault_Handler = Default_Handler +#pragma weak UsageFault_Handler = Default_Handler +#pragma weak SVC_Handler = Default_Handler +#pragma weak DebugMon_Handler = Default_Handler +#pragma weak PendSV_Handler = Default_Handler +#pragma weak SysTick_Handler = Default_Handler +/*----------------------------------external + * interrupts------------------------------ */ +#pragma weak IRQ000_Handler = Default_Handler +#pragma weak IRQ001_Handler = Default_Handler +#pragma weak IRQ002_Handler = Default_Handler +#pragma weak IRQ003_Handler = Default_Handler +#pragma weak IRQ004_Handler = Default_Handler +#pragma weak IRQ005_Handler = Default_Handler +#pragma weak IRQ006_Handler = Default_Handler +#pragma weak IRQ007_Handler = Default_Handler +#pragma weak IRQ008_Handler = Default_Handler +#pragma weak IRQ009_Handler = Default_Handler +#pragma weak IRQ010_Handler = Default_Handler +#pragma weak IRQ011_Handler = Default_Handler +#pragma weak IRQ012_Handler = Default_Handler +#pragma weak IRQ013_Handler = Default_Handler +#pragma weak IRQ014_Handler = Default_Handler +#pragma weak IRQ015_Handler = Default_Handler +#pragma weak IRQ016_Handler = Default_Handler +#pragma weak IRQ017_Handler = Default_Handler +#pragma weak IRQ018_Handler = Default_Handler +#pragma weak IRQ019_Handler = Default_Handler +#pragma weak IRQ020_Handler = Default_Handler +#pragma weak IRQ021_Handler = Default_Handler +#pragma weak IRQ022_Handler = Default_Handler +#pragma weak IRQ023_Handler = Default_Handler +#pragma weak IRQ024_Handler = Default_Handler +#pragma weak IRQ025_Handler = Default_Handler +#pragma weak IRQ026_Handler = Default_Handler +#pragma weak IRQ027_Handler = Default_Handler +#pragma weak IRQ028_Handler = Default_Handler +#pragma weak IRQ029_Handler = Default_Handler +#pragma weak IRQ030_Handler = Default_Handler +#pragma weak IRQ031_Handler = Default_Handler +#pragma weak IRQ032_Handler = Default_Handler +#pragma weak IRQ033_Handler = Default_Handler +#pragma weak IRQ034_Handler = Default_Handler +#pragma weak HIF1_IRQHandler = Default_Handler +#pragma weak HIF2_IRQHandler = Default_Handler +#pragma weak IRQ037_Handler = Default_Handler +#pragma weak IRQ038_Handler = Default_Handler +#pragma weak IRQ039_Handler = Default_Handler +#pragma weak IRQ040_Handler = Default_Handler +#pragma weak IRQ041_Handler = Default_Handler +#pragma weak IRQ042_Handler = Default_Handler +#pragma weak IRQ043_Handler = Default_Handler +#pragma weak IRQ044_Handler = Default_Handler +#pragma weak IRQ045_Handler = Default_Handler +#pragma weak IRQ046_Handler = Default_Handler +#pragma weak IRQ047_Handler = Default_Handler +#pragma weak IRQ048_Handler = Default_Handler +#pragma weak IRQ049_Handler = Default_Handler +#pragma weak IRQ050_Handler = Default_Handler +#pragma weak IRQ051_Handler = Default_Handler +#pragma weak IRQ052_Handler = Default_Handler +#pragma weak IRQ053_Handler = Default_Handler +#pragma weak IRQ054_Handler = Default_Handler +#pragma weak IRQ055_Handler = Default_Handler +#pragma weak IRQ056_Handler = Default_Handler +#pragma weak IRQ057_Handler = Default_Handler +#pragma weak IRQ058_Handler = Default_Handler +#pragma weak IRQ059_Handler = Default_Handler +#pragma weak IRQ060_Handler = Default_Handler +#pragma weak IRQ061_Handler = Default_Handler +#pragma weak IRQ062_Handler = Default_Handler +#pragma weak IRQ063_Handler = Default_Handler +#pragma weak IRQ064_Handler = Default_Handler +#pragma weak IRQ065_Handler = Default_Handler +#pragma weak IRQ066_Handler = Default_Handler +#pragma weak IRQ067_Handler = Default_Handler +#pragma weak IRQ068_Handler = Default_Handler +#pragma weak IRQ069_Handler = Default_Handler +#pragma weak IRQ070_Handler = Default_Handler +#pragma weak IRQ071_Handler = Default_Handler +#pragma weak IRQ072_Handler = Default_Handler +#pragma weak IRQ073_Handler = Default_Handler +#pragma weak IRQ074_Handler = Default_Handler +#pragma weak IRQ075_Handler = Default_Handler +#pragma weak IRQ076_Handler = Default_Handler +#pragma weak IRQ077_Handler = Default_Handler +#pragma weak IRQ078_Handler = Default_Handler +#pragma weak IRQ079_Handler = Default_Handler +#pragma weak IRQ080_Handler = Default_Handler +#pragma weak IRQ081_Handler = Default_Handler +#pragma weak IRQ082_Handler = Default_Handler +#pragma weak IRQ083_Handler = Default_Handler +#pragma weak IRQ084_Handler = Default_Handler +#pragma weak IRQ085_Handler = Default_Handler +#pragma weak IRQ086_Handler = Default_Handler +#pragma weak IRQ087_Handler = Default_Handler +#pragma weak IRQ088_Handler = Default_Handler +#pragma weak IRQ089_Handler = Default_Handler +#pragma weak IRQ090_Handler = Default_Handler +#pragma weak IRQ091_Handler = Default_Handler +#pragma weak IRQ092_Handler = Default_Handler +#pragma weak IRQ093_Handler = Default_Handler +#pragma weak IRQ094_Handler = Default_Handler +#pragma weak IRQ095_Handler = Default_Handler +#pragma weak IRQ096_Handler = Default_Handler +#pragma weak IRQ097_Handler = Default_Handler +#pragma weak IRQ098_Handler = Default_Handler + +/** + * @brief This is the code that gets called when the processor receives an + * unexpected interrupt. This simply enters an infinite loop, + * preserving the system state for examination by a debugger. + * @param None + * @retval None + */ +static void Default_Handler(void) { + /* Go into an infinite loop. */ + while (1) { + } +} + +/*********************** (C) COPYRIGHT 2009 Coocox ************END OF FILE*****/ diff --git a/matter/si91x/support/hal/rsi_hal_mcu_m4.c b/matter/si91x/support/hal/rsi_hal_mcu_m4.c new file mode 100644 index 0000000000..cf5c8c0202 --- /dev/null +++ b/matter/si91x/support/hal/rsi_hal_mcu_m4.c @@ -0,0 +1,82 @@ +/* + * + * Copyright (c) 2022 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "rsi_debug.h" +#include "rsi_pll.h" +#include "rsi_rom_clks.h" +#include "silabs_utils.h" +#include "sl_si91x_button_pin_config.h" +#include "sli_siwx917_soc.h" + +#define SOC_PLL_REF_FREQUENCY 40000000 // /* PLL input REFERENCE clock 40MHZ */ + +// Note: Change this macro to required PLL frequency in hertz +#define PS4_SOC_FREQ 180000000 /* PLL out clock 180MHz */ +#define SWITCH_QSPI_TO_SOC_PLL +#define ICACHE_DISABLE +#define DEBUG_DISABLE + +/* QSPI clock config params */ +#define INTF_PLL_500_CTRL_VALUE 0xD900 +#define INTF_PLL_CLK 80000000 /* PLL out clock 80 MHz */ + +#define PMU_GOOD_TIME 31 /*Duration in us*/ +#define XTAL_GOOD_TIME 31 /*Duration in us*/ + +/*Pre-fetch and regestring */ +#define ICACHE2_ADDR_TRANSLATE_1_REG *(volatile uint32_t *)(0x20280000 + 0x24) +#define MISC_CFG_SRAM_REDUNDANCY_CTRL *(volatile uint32_t *)(0x46008000 + 0x18) +#define MISC_CONFIG_MISC_CTRL1 *(volatile uint32_t *)(0x46008000 + 0x44) +#define MISC_QUASI_SYNC_MODE *(volatile uint32_t *)(0x46008000 + 0x84) + +void sl_button_on_change(uint8_t btn, uint8_t btnAction); + +int soc_pll_config(void) { + int32_t status = RSI_OK; + + RSI_CLK_M4SocClkConfig(M4CLK, M4_ULPREFCLK, 0); + // Configures the required registers for 180 Mhz clock in PS4 + RSI_PS_PS4SetRegisters(); + // Configure the PLL frequency + // Configure the SOC PLL to 180MHz + RSI_CLK_SetSocPllFreq(M4CLK, PS4_SOC_FREQ, SOC_PLL_REF_FREQUENCY); + // Switch M4 clock to PLL clock for speed operations + RSI_CLK_M4SocClkConfig(M4CLK, M4_SOCPLLCLK, 0); + + SysTick_Config(SystemCoreClock / 1000); + DEBUGINIT(); + +#ifdef SWITCH_QSPI_TO_SOC_PLL + /* program intf pll to 160Mhz */ + SPI_MEM_MAP_PLL(INTF_PLL_500_CTRL_REG9) = INTF_PLL_500_CTRL_VALUE; + status = RSI_CLK_SetIntfPllFreq(M4CLK, INTF_PLL_CLK, SOC_PLL_REF_FREQUENCY); + if (status != RSI_OK) { + SILABS_LOG("Failed to Config Interface PLL Clock, status:%d", status); + } else { + SILABS_LOG("Configured Interface PLL Clock to %d", INTF_PLL_CLK); + } + + RSI_CLK_QspiClkConfig(M4CLK, QSPI_INTFPLLCLK, 0, 0, 1); +#endif /* SWITCH_QSPI_TO_SOC_PLL */ + return 0; +} + +void sl_si91x_button_isr(uint8_t pin, uint8_t state) { + (pin == SL_BUTTON_BTN0_PIN) + ? sl_button_on_change(SL_BUTTON_BTN0_NUMBER, !state) + : sl_button_on_change(SL_BUTTON_BTN1_NUMBER, !state); +} diff --git a/matter/si91x/support/inc/system_si917.h b/matter/si91x/support/inc/system_si917.h new file mode 100644 index 0000000000..d373eb283a --- /dev/null +++ b/matter/si91x/support/inc/system_si917.h @@ -0,0 +1,168 @@ +/* + * + * Copyright (c) 2022 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#ifdef __cplusplus +extern "C" { +#endif + +// system header +#include "si91x_device.h" +// Processor spefic haeders +#include "core_cm4.h" /* Cortex-M4 processor and core peripherals */ +#include + +// CMSIS GCC header +#include "cmsis_gcc.h" + +/******************************************************************************* + * @addtogroup Parts + * @{ + ******************************************************************************/ +/******************************************************************************* + * @addtogroup EFR32 EFR32 + * @{ + ******************************************************************************/ + +/******************************************************************************* + ****************************** TYPEDEFS *********************************** + ******************************************************************************/ + +/* Interrupt vectortable entry */ +typedef union { + void (*VECTOR_TABLE_Type)(void); + void *topOfStack; +} tVectorEntry; + +/******************************************************************************* + ************************** GLOBAL VARIABLES ******************************* + ******************************************************************************/ +//#ifndef CCP_SI917_BRINGUP +extern uint32_t SystemCoreClock; /**< System Clock Frequency (Core Clock) */ +//#endif /* CCP_SI917_BRINGUP */ +extern uint32_t SystemHfrcoFreq; /**< System HFRCO frequency */ + +/******************************************************************************* + ***************************** PROTOTYPES ********************************** + ******************************************************************************/ + +void Reset_Handler(void); /**< Reset Handler */ +void NMI_Handler(void); /**< NMI Handler */ +void HardFault_Handler(void); /**< Hard Fault Handler */ +void MemManage_Handler(void); /**< MPU Fault Handler */ +void BusFault_Handler(void); /**< Bus Fault Handler */ +void UsageFault_Handler(void); /**< Usage Fault Handler */ +void SVC_Handler(void); /**< SVCall Handler */ +void DebugMon_Handler(void); /**< Debug Monitor Handler */ +void PendSV_Handler(void); /**< PendSV Handler */ +void SysTick_Handler(void); /**< SysTick Handler */ + +void EMU_IRQHandler(void); /**< EMU IRQ Handler */ +void FRC_PRI_IRQHandler(void); /**< FRC_PRI IRQ Handler */ +void WDOG0_IRQHandler(void); /**< WDOG0 IRQ Handler */ +void WDOG1_IRQHandler(void); /**< WDOG1 IRQ Handler */ +void FRC_IRQHandler(void); /**< FRC IRQ Handler */ +void MODEM_IRQHandler(void); /**< MODEM IRQ Handler */ +void RAC_SEQ_IRQHandler(void); /**< RAC_SEQ IRQ Handler */ +void RAC_RSM_IRQHandler(void); /**< RAC_RSM IRQ Handler */ +void BUFC_IRQHandler(void); /**< BUFC IRQ Handler */ +void LDMA_IRQHandler(void); /**< LDMA IRQ Handler */ +void GPIO_EVEN_IRQHandler(void); /**< GPIO_EVEN IRQ Handler */ +void TIMER0_IRQHandler(void); /**< TIMER0 IRQ Handler */ +void USART0_RX_IRQHandler(void); /**< USART0_RX IRQ Handler */ +void USART0_TX_IRQHandler(void); /**< USART0_TX IRQ Handler */ +void ACMP0_IRQHandler(void); /**< ACMP0 IRQ Handler */ +void ADC0_IRQHandler(void); /**< ADC0 IRQ Handler */ +void IDAC0_IRQHandler(void); /**< IDAC0 IRQ Handler */ +void I2C0_IRQHandler(void); /**< I2C0 IRQ Handler */ +void GPIO_ODD_IRQHandler(void); /**< GPIO_ODD IRQ Handler */ +void TIMER1_IRQHandler(void); /**< TIMER1 IRQ Handler */ +void USART1_RX_IRQHandler(void); /**< USART1_RX IRQ Handler */ +void USART1_TX_IRQHandler(void); /**< USART1_TX IRQ Handler */ +void LEUART0_IRQHandler(void); /**< LEUART0 IRQ Handler */ +void PCNT0_IRQHandler(void); /**< PCNT0 IRQ Handler */ +void CMU_IRQHandler(void); /**< CMU IRQ Handler */ +void MSC_IRQHandler(void); /**< MSC IRQ Handler */ +void CRYPTO0_IRQHandler(void); /**< CRYPTO IRQ Handler */ +void LETIMER0_IRQHandler(void); /**< LETIMER0 IRQ Handler */ +void AGC_IRQHandler(void); /**< AGC IRQ Handler */ +void PROTIMER_IRQHandler(void); /**< PROTIMER IRQ Handler */ +void RTCC_IRQHandler(void); /**< RTCC IRQ Handler */ +void SYNTH_IRQHandler(void); /**< SYNTH IRQ Handler */ +void CRYOTIMER_IRQHandler(void); /**< CRYOTIMER IRQ Handler */ +void RFSENSE_IRQHandler(void); /**< RFSENSE IRQ Handler */ +void FPUEH_IRQHandler(void); /**< FPUEH IRQ Handler */ +void SMU_IRQHandler(void); /**< SMU IRQ Handler */ +void WTIMER0_IRQHandler(void); /**< WTIMER0 IRQ Handler */ +void WTIMER1_IRQHandler(void); /**< WTIMER1 IRQ Handler */ +void PCNT1_IRQHandler(void); /**< PCNT1 IRQ Handler */ +void PCNT2_IRQHandler(void); /**< PCNT2 IRQ Handler */ +void USART2_RX_IRQHandler(void); /**< USART2_RX IRQ Handler */ +void USART2_TX_IRQHandler(void); /**< USART2_TX IRQ Handler */ +void I2C1_IRQHandler(void); /**< I2C1 IRQ Handler */ +void USART3_RX_IRQHandler(void); /**< USART3_RX IRQ Handler */ +void USART3_TX_IRQHandler(void); /**< USART3_TX IRQ Handler */ +void VDAC0_IRQHandler(void); /**< VDAC0 IRQ Handler */ +void CSEN_IRQHandler(void); /**< CSEN IRQ Handler */ +void LESENSE_IRQHandler(void); /**< LESENSE IRQ Handler */ +void CRYPTO1_IRQHandler(void); /**< CRYPTO1 IRQ Handler */ +void TRNG0_IRQHandler(void); /**< TRNG0 IRQ Handler */ +void SYSCFG_IRQHandler(void); /**< SYSCFG IRQ Handler */ + +uint32_t SystemCoreClockGet(void); + +/******************************************************************************* + * @brief + * Update CMSIS SystemCoreClock variable. + * + * @details + * CMSIS defines a global variable SystemCoreClock + *that shall hold the core frequency in Hz. If the + *core frequency is dynamically changed, the variable + *must be kept updated in order to be CMSIS compliant. + * + * Notice that only if changing the core clock + *frequency through the EFR CMU API, this variable + *will be kept updated. This function is only provided + * for CMSIS compliance and if a user modifies the + *the core clock outside the CMU API. + ******************************************************************************/ +#ifndef CCP_SI917_BRINGUP +static __INLINE void SystemCoreClockUpdate(void) { (void)SystemCoreClockGet(); } +#endif /* CCP_SI917_BRINGUP */ + +uint32_t SystemMaxCoreClockGet(void); + +void SystemInit(void); +uint32_t SystemHFClockGet(void); + +uint32_t SystemHFXOClockGet(void); +void SystemHFXOClockSet(uint32_t freq); + +uint32_t SystemLFRCOClockGet(void); +uint32_t SystemULFRCOClockGet(void); + +uint32_t SystemLFXOClockGet(void); +void SystemLFXOClockSet(uint32_t freq); + +/** @} End of group */ +/** @} End of group Parts */ + +#ifdef __cplusplus +} +#endif diff --git a/matter/si91x/support/src/startup_common_RS1xxxx.c b/matter/si91x/support/src/startup_common_RS1xxxx.c new file mode 100644 index 0000000000..f05122df80 --- /dev/null +++ b/matter/si91x/support/src/startup_common_RS1xxxx.c @@ -0,0 +1,514 @@ +/** + ****************************************************************************** + * @file startup_si91x.c + * @author Coocox + * @version V1.0 + * @date 03/16/2013 + * @brief Cortex M4 Devices Startup code. + * This module performs: + * - Set the initial SP + * - Set the vector table entries with the exceptions ISR address + * - Initialize data and bss + * - Call the application's entry point. + * After Reset the Cortex-M4 processor is in Thread mode, + * priority is Privileged, and the Stack is set to Main. + ******************************************************************************* + */ +// System headers +#include "si91x_device.h" +#include "system_si91x.h" +// Processor specific headers +#include "core_cm4.h" +#include "rsi_ps_ram_func.h" +/*----------Stack Symbols-----------------------------------------------*/ +extern uint32_t __StackTop; +extern uint32_t __co_stackTop; + +/*----------Macro definition--------------------------------------------------*/ +#define WEAK __attribute__((weak)) + +/*----------Declaration of the default fault handlers-------------------------*/ +#ifndef __START +extern void _start(void) + __attribute__((noreturn)); /* Pre Main (C library entry point) */ +#else +extern int __START(void) __attribute__((noreturn)); /* main entry point */ +#endif + +/* System exception vector handler */ +__attribute__((used)) void WEAK Reset_Handler(void); +void WEAK NMI_Handler(void); +void WEAK HardFault_Handler(void); +void WEAK MemManage_Handler(void); +void WEAK BusFault_Handler(void); +void WEAK UsageFault_Handler(void); +void WEAK SVC_Handler(void); +void WEAK DebugMon_Handler(void); +void WEAK PendSV_Handler(void); +void WEAK SysTick_Handler(void); + +/*Boot up functions*/ +void RSI_Default_Reset_Handler(void); +void RSI_Default_WakeUp_Handler(void); +void RSI_PS_RestoreCpuContext(void); + +void WEAK IRQ000_Handler(void); /*!< ULP Processor Interrupt 0 */ +void WEAK IRQ001_Handler(void); /*!< ULP Processor Interrupt 1 */ +void WEAK IRQ002_Handler(void); /*!< ULP Processor Interrupt 2 */ +void WEAK IRQ003_Handler(void); /*!< ULP Processor Interrupt 3 */ +void WEAK IRQ004_Handler(void); /*!< ULP Processor Interrupt 4 */ +void WEAK IRQ005_Handler(void); /*!< ULP Processor Interrupt 5 */ +void WEAK IRQ006_Handler(void); /*!< ULP Processor Interrupt 6 */ +void WEAK IRQ007_Handler(void); /*!< ULP Processor Interrupt 7 */ +void WEAK IRQ008_Handler(void); /*!< ULP Processor Interrupt 8 */ +void WEAK IRQ009_Handler(void); /*!< ULP Processor Interrupt 9 */ +void WEAK IRQ010_Handler(void); /*!< ULP Processor Interrupt 10 */ +void WEAK IRQ011_Handler(void); /*!< ULP Processor Interrupt 11 */ +void WEAK IRQ012_Handler(void); /*!< ULP Processor Interrupt 12 */ +void WEAK IRQ013_Handler(void); /*!< ULP Processor Interrupt 13 */ +void WEAK IRQ014_Handler(void); /*!< ULP Processor Interrupt 14 */ +void WEAK IRQ015_Handler(void); /*!< ULP Processor Interrupt 15 */ +void WEAK IRQ016_Handler(void); /*!< ULP Processor Interrupt 15 */ +void WEAK IRQ017_Handler(void); /*!< ULP Processor Interrupt 17 */ +void WEAK IRQ018_Handler(void); /*!< ULP Processor Interrupt 18 */ +void WEAK IRQ019_Handler(void); /*!< ULP Processor Interrupt 19 */ +void WEAK IRQ020_Handler(void); +/*!< Sleep Sensor Interrupts 0 */ /*WDT*/ +void WEAK IRQ021_Handler(void); /*!< Sleep Sensor Interrupts 1 */ +void WEAK IRQ022_Handler(void); /*!< Sleep Sensor Interrupts 2 */ +void WEAK IRQ023_Handler(void); /*!< Sleep Sensor Interrupts 3 */ +void WEAK IRQ024_Handler(void); /*!< Sleep Sensor Interrupts 4 */ +void WEAK IRQ025_Handler(void); /*!< Sleep Sensor Interrupts 5 */ +void WEAK IRQ026_Handler(void); /*!< Sleep Sensor Interrupts 6 */ +void WEAK IRQ027_Handler(void); /*!< Sleep Sensor Interrupts 7 */ +void WEAK IRQ028_Handler(void); +/*!< Sleep Sensor Interrupts 8 */ /*Alarm*/ +void WEAK IRQ029_Handler(void); +/*!< Sleep Sensor Interrupts 9 */ /*Msec and sec interrupt */ +void WEAK IRQ030_Handler(void); /*!< Reserved */ +void WEAK IRQ031_Handler(void); /*!< M4SS DMA interrupt */ +void WEAK IRQ032_Handler(void); /*!< Reserved */ +void WEAK IRQ033_Handler(void); /*!< M4SS DMA interrupt */ +void WEAK IRQ034_Handler(void); /*!< M4SS SCT interrupt */ +void WEAK HIF1_IRQHandler(void); /*!< HIF Interrupt 1 */ +void WEAK HIF2_IRQHandler(void); /*!< HIF Interrupt 2 */ +void WEAK IRQ037_Handler(void); /*!< SIO Interrupt */ +void WEAK IRQ038_Handler(void); /*!< USART 1 Interrupt */ +void WEAK IRQ039_Handler(void); /*!< Reserved */ +void WEAK IRQ040_Handler(void); /*!< Reserved */ +void WEAK IRQ041_Handler(void); /*!< Reserved */ +void WEAK IRQ042_Handler(void); /*!< I2C Interrupt */ +void WEAK IRQ043_Handler(void); /*!< Reserved */ +void WEAK IRQ044_Handler(void); /*!< SSI Slave Interrupt */ +void WEAK IRQ045_Handler(void); /*!< Reserved */ +void WEAK IRQ046_Handler(void); /*!< GSPI Master 1 Interrupt */ +void WEAK IRQ047_Handler(void); /*!< Reserved */ +void WEAK IRQ048_Handler(void); /*!< MCPWM Interrupt */ +void WEAK IRQ049_Handler(void); /*!< QEI Interrupt */ +void WEAK IRQ050_Handler(void); /*!< GPIO Group Interrupt 0 */ +void WEAK IRQ051_Handler(void); /*!< GPIO Group Interrupt 1 */ +void WEAK IRQ052_Handler(void); /*!< GPIO Pin Interrupt 0 */ +void WEAK IRQ053_Handler(void); /*!< GPIO Pin Interrupt 1 */ +void WEAK IRQ054_Handler(void); /*!< GPIO Pin Interrupt 2 */ +void WEAK IRQ055_Handler(void); /*!< GPIO Pin Interrupt 3 */ +void WEAK IRQ056_Handler(void); /*!< GPIO Pin Interrupt 4 */ +void WEAK IRQ057_Handler(void); /*!< GPIO Pin Interrupt 5 */ +void WEAK IRQ058_Handler(void); /*!< GPIO Pin Interrupt 6 */ +void WEAK IRQ059_Handler(void); /*!< GPIO Pin Interrupt 7 */ +void WEAK IRQ060_Handler(void); /*!< QSPI Interrupt */ +void WEAK IRQ061_Handler(void); /*!< I2C 2 Interrupt */ +void WEAK IRQ062_Handler(void); /*!< Ethernet Interrupt */ +void WEAK IRQ063_Handler(void); /*!< Reserved */ +void WEAK IRQ064_Handler(void); /*!< I2S master Interrupt */ +void WEAK IRQ065_Handler(void); /*!< Reserved */ +void WEAK IRQ066_Handler(void); /*!< Can 1 Interrupt */ +void WEAK IRQ067_Handler(void); /*!< Reserved */ +void WEAK IRQ068_Handler(void); /*!< SDMEM Interrupt */ +void WEAK IRQ069_Handler(void); /*!< PLL clock ind Interrupt */ +void WEAK IRQ070_Handler(void); /*!< Reserved */ +void WEAK IRQ071_Handler(void); /*!< CCI system Interrupt Out */ +void WEAK IRQ072_Handler(void); /*!< FPU exception */ +void WEAK IRQ073_Handler(void); /*!< USB INTR */ +void WEAK IRQ074_Handler(void); /*!< TASS_P2P_INTR */ +void WEAK IRQ075_Handler(void); /*!< WLAN Band1 intr0 */ +void WEAK IRQ076_Handler(void); /*!< WLAN Band1 intr1 */ +void WEAK IRQ077_Handler(void); /*!< Reserved */ +void WEAK IRQ078_Handler(void); /*!< Reserved */ +void WEAK IRQ079_Handler(void); /*!< BT intr */ +void WEAK IRQ080_Handler(void); /*!< ZB intr */ +void WEAK IRQ081_Handler(void); /*!< Reserved */ +void WEAK IRQ082_Handler(void); /*!< Modem disabled mode trigger intr */ +void WEAK IRQ083_Handler(void); /*!< gpio intr */ +void WEAK IRQ084_Handler(void); /*!< uart intr */ +void WEAK IRQ085_Handler(void); /*!< watch dog level intr */ +void WEAK IRQ086_Handler(void); /*!< ULP Sleep sensor interrupt */ +void WEAK IRQ087_Handler(void); /*!< ECDH intr */ +void WEAK IRQ088_Handler(void); /*!< DH intr */ +void WEAK IRQ089_Handler(void); /*!< QSPI intr */ +void WEAK IRQ090_Handler(void); /*!< ULP processor interrupt TASS */ +void WEAK IRQ091_Handler(void); /*!< Sys Tick Timer */ +void WEAK IRQ092_Handler(void); /*!< Real Timer interrupt */ +void WEAK IRQ093_Handler(void); /*!< PLL lock interrupt */ +void WEAK IRQ094_Handler(void); /*!< Reserved */ +void WEAK IRQ095_Handler(void); /*!< UART2 Interrupt */ +void WEAK IRQ096_Handler(void); /*!< I2S Interrupt */ +void WEAK IRQ097_Handler(void); /*!< I2C Interrupt */ +void WEAK IRQ098_Handler(void); /*!< RESERVED */ + +/*----------Symbols defined in linker script----------------------------------*/ +extern unsigned long _sidata; /*!< Start address for the initialization + values of the .data section. */ +extern unsigned long _sdata; /*!< Start address for the .data section */ +extern unsigned long _edata; /*!< End address for the .data section */ +extern unsigned long _sbss; /*!< Start address for the .bss section */ +extern unsigned long _ebss; /*!< End address for the .bss section */ +extern void _eram; /*!< End address for ram */ +extern uint32_t __etext; +extern unsigned long __StackTop; + +/*----------Function prototypes-----------------------------------------------*/ +extern int main(void); /*!< The entry point for the application */ +void Default_Reset_Handler(void); /*!< Default reset handler */ +static void Default_Handler(void); /*!< Default exception handler */ +/** + *@brief The minimal vector table for a Cortex M4. Note that the proper + *constructs must be placed on this to ensure that it ends up at physical + *address 0x00000000. + */ +__attribute__((used, + section(".isr_vector"))) void (*const g_pfnVectors[])(void) = { + /*----------------------------------Core + Exceptions---------------------------------- */ + + (void *)&__StackTop, /*!< The initial stack pointer (0x00) */ + (void *)0x300001, /*!< Reset Handler */ + NMI_Handler, /*!< NMI Handler */ + HardFault_Handler, /*!< Hard Fault Handler */ + MemManage_Handler, /*!< MPU Fault Handler */ + BusFault_Handler, /*!< Bus Fault Handler */ + UsageFault_Handler, /*!< Usage Fault Handler */ + 0, /*!< Reserved */ + 0, /*!< Reserved */ + 0, /*!< Reserved */ + 0, /*!< Reserved */ + SVC_Handler, /*!< SVCall Handler */ + DebugMon_Handler, /*!< Debug Monitor Handler */ + 0, /*!< Reserved */ + PendSV_Handler, /*!< PendSV Handler */ + SysTick_Handler, /*!< SysTick Handler */ + + IRQ000_Handler, // 0: VAD interrupt + IRQ001_Handler, // 1: ULP Processor Interrupt1 + IRQ002_Handler, // 2: ULP Processor Interrupt2 + IRQ003_Handler, // 3: ULP Processor Interrupt3 + IRQ004_Handler, // 4: ULP Processor Interrupt4 + IRQ005_Handler, // 5: ULP Processor Interrupt5 + IRQ006_Handler, // 6: ULP Processor Interrupt6 + IRQ007_Handler, // 7: ULP Processor Interrupt7 + IRQ008_Handler, // 8: ULP Processor Interrupt8 + IRQ009_Handler, // 9: ULP Processor Interrupt8 + IRQ010_Handler, // 10: ULP Processor Interrupt8 + IRQ011_Handler, // 11: ULP Processor Interrupt8 + IRQ012_Handler, // 12: ULP Processor Interrupt8 + IRQ013_Handler, // 13: ULP Processor Interrupt8 + IRQ014_Handler, // 14: ULP Processor Interrupt8 + IRQ015_Handler, // 15: ULP Processor Interrupt8 + IRQ016_Handler, // 16: ULP Processor Interrupt8 + IRQ017_Handler, // 17: ULP Processor Interrupt8 + IRQ018_Handler, // 18: ULP Processor Interrupt8 + IRQ019_Handler, // 19: ULP Processor Interrupt8 + IRQ020_Handler, // 20: Sleep Sensor Interrupts 0 + IRQ021_Handler, // 21: Sleep Sensor Interrupts 1 + IRQ022_Handler, // 22: Sleep Sensor Interrupts 2 + IRQ023_Handler, // 23: Sleep Sensor Interrupts 3 + IRQ024_Handler, // 24: Sleep Sensor Interrupts 4 + IRQ025_Handler, // 25: Sleep Sensor Interrupts 5 + IRQ026_Handler, // 26: Sleep Sensor Interrupts 6 + IRQ027_Handler, // 27: Sleep Sensor Interrupts 7 + IRQ028_Handler, // 28: Sleep Sensor Interrupts 8 + IRQ029_Handler, // 29: Sleep Sensor Interrupts 9 + (void *)&__co_stackTop, // 30: Reserved + IRQ031_Handler, // 31: RPDMA interrupt + RSI_Default_Reset_Handler, // 32: Reserved + IRQ033_Handler, // 33: UDMA interrupt + IRQ034_Handler, // 34: SCT interrupt + HIF1_IRQHandler, // 35: HIF Interrupt1 + HIF2_IRQHandler, // 36: HIF Interrupt2 + IRQ037_Handler, // 37: SIO Interrupt + IRQ038_Handler, // 38: USART 1 Interrupt + IRQ039_Handler, // 39: USART 2 Interrupt + RSI_PS_RestoreCpuContext, // 40: USART 3 Interrupt + IRQ041_Handler, // 41: GPIO WAKEUP INTERRUPT + IRQ042_Handler, // 42: I2C Interrupt + (void *)0x10AD10AD, // 43: Reserved + IRQ044_Handler, // 44: SSI Slave Interrupt + 0, // 45: Reserved + IRQ046_Handler, // 46: GSPI Master 1 Interrupt + IRQ047_Handler, // 47: Reserved + IRQ048_Handler, // 48: MCPWM Interrupt + IRQ049_Handler, // 49: QEI Interrupt + IRQ050_Handler, // 50: GPIO Group Interrupt 0 + IRQ051_Handler, // 51: GPIO Group Interrupt 1 + IRQ052_Handler, // 52: GPIO Pin Interrupt 0 + IRQ053_Handler, // 53: GPIO Pin Interrupt 1 + IRQ054_Handler, // 54: GPIO Pin Interrupt 2 + IRQ055_Handler, // 55: GPIO Pin Interrupt 3 + IRQ056_Handler, // 56: GPIO Pin Interrupt 4 + IRQ057_Handler, // 57: GPIO Pin Interrupt 5 + IRQ058_Handler, // 58: GPIO Pin Interrupt 6 + IRQ059_Handler, // 59: GPIO Pin Interrupt 7 + IRQ060_Handler, // 60: QSPI Interrupt + IRQ061_Handler, // 61: I2C 2 Interrupt + IRQ062_Handler, // 62: Ethernet Interrupt + IRQ063_Handler, // 63: Reserved + IRQ064_Handler, // 64: I2S master Interrupt + 0, // 65: Reserved + IRQ066_Handler, // 66: Can 1 Interrupt + 0, // 67: Reserved + IRQ068_Handler, // 68: SDMEM Interrupt + IRQ069_Handler, // 69: PLL clock ind Interrupt + 0, // 70: Reserved + IRQ071_Handler, // 71: CCI system Interrupt Out + IRQ072_Handler, // 72: FPU exception + IRQ073_Handler, // 73: USB INTR + IRQ074_Handler, // 74: TASS_P2P_INTR + IRQ075_Handler, // 75: WLAN Band1 intr0(TA) + IRQ076_Handler, // 76: WLAN Band1 intr1(TA) + 0, // 77: Reserved(TA) + 0, // 78: Reserved(TA) + IRQ079_Handler, // 79: BT intr(TA) + IRQ080_Handler, // 80: ZB intr(TA) + 0, // 81: Reserved(TA) + IRQ082_Handler, // 82: Modem disabled mode trigger intr(TA) + IRQ083_Handler, // 83: gpio intr(TA) + IRQ084_Handler, // 84: uart intr(TA) + IRQ085_Handler, // 85: watch dog level intr(TA) + IRQ086_Handler, // 86: ULP Sleep sensor interrupt(TA) + IRQ087_Handler, // 87: ECDH intr(TA) + IRQ088_Handler, // 88: DH intr(TA) + IRQ089_Handler, // 89: QSPI intr(TA) + IRQ090_Handler, // 90: ULP processor interrupt TASS(TA) + IRQ091_Handler, // 91: Sys Tick Timer(TA) + IRQ092_Handler, // 92: Real Timer interrupt(TA) + IRQ093_Handler, // 93: PLL lock interrupt(TA) + 0, // 94: Reserved(TA) + IRQ095_Handler, // 95: UART2 Interrupt(TA) + 0, // 96: Reserved(TA) + IRQ097_Handler, // 97: I2C Interrupt(TA) +}; + +/** + * @brief This is the code that gets never called, Dummy handler + * @param None + * @retval None + */ +void Default_Reset_Handler(void) { + /*Generic Default reset handler for CM4 */ + while (1) + ; +} + +/** + * @brief This is the code that gets called when the processor first + * starts execution following a reset event. Only the absolutely + * necessary set is performed, after which the application + * supplied main() routine is called. + */ +volatile unsigned long *pulSrc, *pulDest; + +#ifdef M4_PS2_STATE +__attribute__((section(".reset_handler"))) +#endif +#ifdef EXECUTION_FROM_RAM +__attribute__((section(".ramVector"))) char RAM_VECTOR[sizeof(g_pfnVectors)]; +__attribute__ ((section(".reset_handler"))) +#endif + +void Copy_Table() +{ + uint32_t *pSrc, *pDest; + extern uint32_t __etext; + extern uint32_t __data_start__; + extern uint32_t __data_end__; + pSrc = &__etext; + pDest = &__data_start__; + + for (; pDest < &__data_end__;) { + *pDest++ = *pSrc++; + } +} + +void Zero_Table() { + uint32_t *pDest; + extern uint32_t __bss_start__; + extern uint32_t __bss_end__; + pDest = &__bss_start__; + + for (; pDest < &__bss_end__;) { + *pDest++ = 0UL; + } +} + +void RSI_Default_Reset_Handler(void) { + +#ifdef BOOTLOADER_ENABLE + SystemInit2(); +#endif /* BOOTLOADER_ENABLE */ + +#if defined(__GNUC__) && defined(__START) + Copy_Table(); + Zero_Table(); + __START(); +#else +#if 0 // senthil_ccp + __PROGRAM_START(); /* Enter PreMain (C library entry point) */ +#else + Copy_Table(); + Zero_Table(); + +#ifdef EXECUTION_FROM_RAM + // copying the vector table from flash to ram + memcpy(RAM_VECTOR, (uint32_t *)SCB->VTOR, sizeof(g_pfnVectors)); + // assing the ram vector address to VTOR register + SCB->VTOR = (uint32_t)RAM_VECTOR; +#endif + +#ifndef __NO_SYSTEM_INIT + SystemInit(); /* CMSIS System Initialization */ +#endif + _start(); +#endif +#endif /* __GNUC__ */ +} + +/** + *@brief Provide weak aliases for each Exception handler to the Default_Handler. + * As they are weak aliases, any function with the same name will override + * this definition. + */ +#pragma weak Reset_Handler = Default_Reset_Handler +#pragma weak NMI_Handler = Default_Handler +#pragma weak HardFault_Handler = Default_Handler +#pragma weak MemManage_Handler = Default_Handler +#pragma weak BusFault_Handler = Default_Handler +#pragma weak UsageFault_Handler = Default_Handler +#pragma weak SVC_Handler = Default_Handler +#pragma weak DebugMon_Handler = Default_Handler +#pragma weak PendSV_Handler = Default_Handler +#pragma weak SysTick_Handler = Default_Handler +/*----------------------------------external + * interrupts------------------------------ */ +#pragma weak IRQ000_Handler = Default_Handler +#pragma weak IRQ001_Handler = Default_Handler +#pragma weak IRQ002_Handler = Default_Handler +#pragma weak IRQ003_Handler = Default_Handler +#pragma weak IRQ004_Handler = Default_Handler +#pragma weak IRQ005_Handler = Default_Handler +#pragma weak IRQ006_Handler = Default_Handler +#pragma weak IRQ007_Handler = Default_Handler +#pragma weak IRQ008_Handler = Default_Handler +#pragma weak IRQ009_Handler = Default_Handler +#pragma weak IRQ010_Handler = Default_Handler +#pragma weak IRQ011_Handler = Default_Handler +#pragma weak IRQ012_Handler = Default_Handler +#pragma weak IRQ013_Handler = Default_Handler +#pragma weak IRQ014_Handler = Default_Handler +#pragma weak IRQ015_Handler = Default_Handler +#pragma weak IRQ016_Handler = Default_Handler +#pragma weak IRQ017_Handler = Default_Handler +#pragma weak IRQ018_Handler = Default_Handler +#pragma weak IRQ019_Handler = Default_Handler +#pragma weak IRQ020_Handler = Default_Handler +#pragma weak IRQ021_Handler = Default_Handler +#pragma weak IRQ022_Handler = Default_Handler +#pragma weak IRQ023_Handler = Default_Handler +#pragma weak IRQ024_Handler = Default_Handler +#pragma weak IRQ025_Handler = Default_Handler +#pragma weak IRQ026_Handler = Default_Handler +#pragma weak IRQ027_Handler = Default_Handler +#pragma weak IRQ028_Handler = Default_Handler +#pragma weak IRQ029_Handler = Default_Handler +#pragma weak IRQ030_Handler = Default_Handler +#pragma weak IRQ031_Handler = Default_Handler +#pragma weak IRQ032_Handler = Default_Handler +#pragma weak IRQ033_Handler = Default_Handler +#pragma weak IRQ034_Handler = Default_Handler +#pragma weak HIF1_IRQHandler = Default_Handler +#pragma weak HIF2_IRQHandler = Default_Handler +#pragma weak IRQ037_Handler = Default_Handler +#pragma weak IRQ038_Handler = Default_Handler +#pragma weak IRQ039_Handler = Default_Handler +#pragma weak IRQ040_Handler = Default_Handler +#pragma weak IRQ041_Handler = Default_Handler +#pragma weak IRQ042_Handler = Default_Handler +#pragma weak IRQ043_Handler = Default_Handler +#pragma weak IRQ044_Handler = Default_Handler +#pragma weak IRQ045_Handler = Default_Handler +#pragma weak IRQ046_Handler = Default_Handler +#pragma weak IRQ047_Handler = Default_Handler +#pragma weak IRQ048_Handler = Default_Handler +#pragma weak IRQ049_Handler = Default_Handler +#pragma weak IRQ050_Handler = Default_Handler +#pragma weak IRQ051_Handler = Default_Handler +#pragma weak IRQ052_Handler = Default_Handler +#pragma weak IRQ053_Handler = Default_Handler +#pragma weak IRQ054_Handler = Default_Handler +#pragma weak IRQ055_Handler = Default_Handler +#pragma weak IRQ056_Handler = Default_Handler +#pragma weak IRQ057_Handler = Default_Handler +#pragma weak IRQ058_Handler = Default_Handler +#pragma weak IRQ059_Handler = Default_Handler +#pragma weak IRQ060_Handler = Default_Handler +#pragma weak IRQ061_Handler = Default_Handler +#pragma weak IRQ062_Handler = Default_Handler +#pragma weak IRQ063_Handler = Default_Handler +#pragma weak IRQ064_Handler = Default_Handler +#pragma weak IRQ065_Handler = Default_Handler +#pragma weak IRQ066_Handler = Default_Handler +#pragma weak IRQ067_Handler = Default_Handler +#pragma weak IRQ068_Handler = Default_Handler +#pragma weak IRQ069_Handler = Default_Handler +#pragma weak IRQ070_Handler = Default_Handler +#pragma weak IRQ071_Handler = Default_Handler +#pragma weak IRQ072_Handler = Default_Handler +#pragma weak IRQ073_Handler = Default_Handler +#pragma weak IRQ074_Handler = Default_Handler +#pragma weak IRQ075_Handler = Default_Handler +#pragma weak IRQ076_Handler = Default_Handler +#pragma weak IRQ077_Handler = Default_Handler +#pragma weak IRQ078_Handler = Default_Handler +#pragma weak IRQ079_Handler = Default_Handler +#pragma weak IRQ080_Handler = Default_Handler +#pragma weak IRQ081_Handler = Default_Handler +#pragma weak IRQ082_Handler = Default_Handler +#pragma weak IRQ083_Handler = Default_Handler +#pragma weak IRQ084_Handler = Default_Handler +#pragma weak IRQ085_Handler = Default_Handler +#pragma weak IRQ086_Handler = Default_Handler +#pragma weak IRQ087_Handler = Default_Handler +#pragma weak IRQ088_Handler = Default_Handler +#pragma weak IRQ089_Handler = Default_Handler +#pragma weak IRQ090_Handler = Default_Handler +#pragma weak IRQ091_Handler = Default_Handler +#pragma weak IRQ092_Handler = Default_Handler +#pragma weak IRQ093_Handler = Default_Handler +#pragma weak IRQ094_Handler = Default_Handler +#pragma weak IRQ095_Handler = Default_Handler +#pragma weak IRQ096_Handler = Default_Handler +#pragma weak IRQ097_Handler = Default_Handler +#pragma weak IRQ098_Handler = Default_Handler + +/** + * @brief This is the code that gets called when the processor receives an + * unexpected interrupt. This simply enters an infinite loop, + * preserving the system state for examination by a debugger. + * @param None + * @retval None + */ +static void Default_Handler(void) { + /* Go into an infinite loop. */ + while (1) { + } +} + +/*********************** (C) COPYRIGHT 2009 Coocox ************END OF FILE*****/