Skip to content

Commit

Permalink
Using SLI_SI91X_MCU_INTERFACE instead of SIWX_917
Browse files Browse the repository at this point in the history
  • Loading branch information
lpbeliveau-silabs committed Mar 11, 2024
1 parent 045bfd7 commit e6a5e01
Show file tree
Hide file tree
Showing 17 changed files with 508 additions and 508 deletions.
14 changes: 7 additions & 7 deletions examples/platform/silabs/FreeRTOSConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ extern "C" {

#include <stdint.h>

#ifdef SLI_917_SOC
#ifdef SLI_SI91X_MCU_INTERFACE
#include "si91x_device.h"
extern uint32_t SystemCoreClock;
#else // For EFR32
Expand Down Expand Up @@ -169,23 +169,23 @@ extern uint32_t SystemCoreClock;
#define configTIMER_QUEUE_LENGTH (10)
#define configTIMER_TASK_STACK_DEPTH (1024)

#ifdef SLI_917_SOC
#ifdef SLI_SI91X_MCU_INTERFACE
#ifdef __NVIC_PRIO_BITS
#undef __NVIC_PRIO_BITS
#endif
#define configPRIO_BITS 6 /* 6 priority levels. */
#endif // SLI_917_SOC
#endif // SLI_SI91X_MCU_INTERFACE

/* Interrupt priorities used by the kernel port layer itself. These are generic
to all Cortex-M ports, and do not rely on any particular library functions. */
#define configKERNEL_INTERRUPT_PRIORITY (255)
/* !!!! configMAX_SYSCALL_INTERRUPT_PRIORITY must not be set to zero !!!!
See http://www.FreeRTOS.org/RTOS-Cortex-M3-M4.html. */
#ifdef SLI_917_SOC
#ifdef SLI_SI91X_MCU_INTERFACE
#define configMAX_SYSCALL_INTERRUPT_PRIORITY 20
#else
#define configMAX_SYSCALL_INTERRUPT_PRIORITY 48
#endif // SLI_917_SOC
#endif // SLI_SI91X_MCU_INTERFACE

#define configENABLE_FPU 0
#define configENABLE_MPU 0
Expand Down Expand Up @@ -232,11 +232,11 @@ See http://www.FreeRTOS.org/RTOS-Cortex-M3-M4.html. */
#ifndef configTOTAL_HEAP_SIZE
#ifdef SL_WIFI
#ifdef DIC_ENABLE
#ifdef SLI_917_SOC
#ifdef SLI_SI91X_MCU_INTERFACE
#define configTOTAL_HEAP_SIZE ((size_t) ((75 + EXTRA_HEAP_k) * 1024))
#else
#define configTOTAL_HEAP_SIZE ((size_t) ((68 + EXTRA_HEAP_k) * 1024))
#endif // SLI_917_SOC
#endif // SLI_SI91X_MCU_INTERFACE
#else
#define configTOTAL_HEAP_SIZE ((size_t) ((42 + EXTRA_HEAP_k) * 1024))
#endif // DIC
Expand Down
14 changes: 7 additions & 7 deletions examples/platform/silabs/MatterConfig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@
#include "MemMonitoring.h"
#endif

#ifdef SLI_917_SOC
#ifdef SLI_SI91X_MCU_INTERFACE
#include "wfx_rsi.h"
#endif /* SLI_917_SOC */
#endif /* SLI_SI91X_MCU_INTERFACE */

using namespace ::chip;
using namespace ::chip::Inet;
Expand All @@ -53,7 +53,7 @@ using namespace ::chip::DeviceLayer;
#include <crypto/CHIPCryptoPAL.h>
// If building with the EFR32-provided crypto backend, we can use the
// opaque keystore
#if CHIP_CRYPTO_PLATFORM && !(defined(SLI_917_SOC))
#if CHIP_CRYPTO_PLATFORM && !(defined(SLI_SI91X_MCU_INTERFACE))
#include <platform/silabs/efr32/Efr32PsaOperationalKeystore.h>
static chip::DeviceLayer::Internal::Efr32PsaOperationalKeystore gOperationalKeystore;
#endif
Expand Down Expand Up @@ -229,7 +229,7 @@ CHIP_ERROR SilabsMatterConfig::InitMatter(const char * appName)
initParams.testEventTriggerDelegate = &sTestEventTriggerDelegate;
#endif // SILABS_TEST_EVENT_TRIGGER_ENABLED

#if CHIP_CRYPTO_PLATFORM && !(defined(SLI_917_SOC))
#if CHIP_CRYPTO_PLATFORM && !(defined(SLI_SI91X_MCU_INTERFACE))
// When building with EFR32 crypto, use the opaque key store
// instead of the default (insecure) one.
gOperationalKeystore.Init();
Expand Down Expand Up @@ -289,13 +289,13 @@ CHIP_ERROR SilabsMatterConfig::InitWiFi(void)
#endif // SL_WFX_USE_SECURE_LINK
#endif /* WF200_WIFI */

#ifdef SLI_917_SOC
#ifdef SLI_SI91X_MCU_INTERFACE
sl_status_t status;
if ((status = wfx_wifi_rsi_init()) != SL_STATUS_OK)
{
ReturnErrorOnFailure((CHIP_ERROR) status);
}
#endif // SLI_917_SOC
#endif // SLI_SI91X_MCU_INTERFACE

return CHIP_NO_ERROR;
}
Expand All @@ -306,7 +306,7 @@ CHIP_ERROR SilabsMatterConfig::InitWiFi(void)
// ================================================================================
extern "C" void vApplicationIdleHook(void)
{
#if SLI_917_SOC && CHIP_CONFIG_ENABLE_ICD_SERVER
#if SLI_SI91X_MCU_INTERFACE && CHIP_CONFIG_ENABLE_ICD_SERVER
sl_wfx_host_si91x_sleep_wakeup();
#endif
}
4 changes: 2 additions & 2 deletions examples/platform/silabs/OTAConfig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#include "silabs_utils.h"
#include <app/server/Server.h>

#ifndef SLI_917_SOC
#ifndef SLI_SI91X_MCU_INTERFACE

#include "application_properties.h"

Expand Down Expand Up @@ -75,7 +75,7 @@ __attribute__((used)) ApplicationProperties_t sl_app_properties = {
.longTokenSectionAddress = NULL,
};
#endif // SL_CATALOG_GECKO_BOOTLOADER_INTERFACE_PRESENT
#endif // SLI_917_SOC
#endif // SLI_SI91X_MCU_INTERFACE

// Global OTA objects
chip::DefaultOTARequestor gRequestorCore;
Expand Down
12 changes: 6 additions & 6 deletions examples/platform/silabs/SiWx917/SiWx917/sl_wifi_if.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@

#include "ble_config.h"

#if SL_ICD_ENABLED && SLI_917_SOC
#if SL_ICD_ENABLED && SLI_SI91X_MCU_INTERFACE
#include "rsi_rom_power_save.h"
#include "sl_si91x_button_pin_config.h"
#include "sl_si91x_driver.h"
Expand All @@ -50,7 +50,7 @@
// TODO: should be removed once we are getting the press interrupt for button 0 with sleep
#define BUTTON_PRESSED 1
bool btn0_pressed = false;
#endif // SL_ICD_ENABLED && SLI_917_SOC
#endif // SL_ICD_ENABLED && SLI_SI91X_MCU_INTERFACE

#include "dhcp_client.h"
#include "sl_wifi.h"
Expand All @@ -63,10 +63,10 @@ bool btn0_pressed = false;
#define ADV_MULTIPROBE 1
#define ADV_SCAN_PERIODICITY 10

#if SLI_917_SOC
#if SLI_SI91X_MCU_INTERFACE
#include "sl_si91x_trng.h"
#define TRNGKEY_SIZE 4
#endif // SLI_917_SOC
#endif // SLI_SI91X_MCU_INTERFACE

struct wfx_rsi wfx_rsi;

Expand Down Expand Up @@ -215,7 +215,7 @@ sl_status_t join_callback_handler(sl_wifi_event_t event, char * result, uint32_t

#if SL_ICD_ENABLED

#if SLI_917_SOC
#if SLI_SI91X_MCU_INTERFACE
/******************************************************************
* @fn sl_wfx_host_si91x_sleep_wakeup()
* @brief
Expand Down Expand Up @@ -250,7 +250,7 @@ void sl_wfx_host_si91x_sleep_wakeup()
}
}
}
#endif // SLI_917_SOC
#endif // SLI_SI91X_MCU_INTERFACE

/******************************************************************
* @fn wfx_rsi_power_save()
Expand Down
2 changes: 1 addition & 1 deletion examples/platform/silabs/SilabsDeviceAttestationCreds.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ class DeviceAttestationCredsSilabs : public DeviceAttestationCredentialsProvider
if (SilabsConfig::ConfigValueExists(SilabsConfig::kConfigKey_Creds_KeyId))
{
// Provisioned DAC key
#ifdef SLI_917_SOC
#ifdef SLI_SI91X_MCU_INTERFACE
return CHIP_ERROR_NOT_IMPLEMENTED;
#else
uint32_t key_id = SILABS_CREDENTIALS_DAC_KEY_ID;
Expand Down
8 changes: 4 additions & 4 deletions examples/platform/silabs/display/demo-ui.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@
#include "glib.h"
#include "sl_component_catalog.h"
#include "sl_memlcd.h"
#if SL_WIFI && !SLI_917_SOC
#if SL_WIFI && !SLI_SI91X_MCU_INTERFACE
#include "spi_multiplex.h"
#endif // SL_WIFI && !SLI_917_SOC
#endif // SL_WIFI && !SLI_SI91X_MCU_INTERFACE
#include <stdio.h>
#include <string.h>

Expand Down Expand Up @@ -106,9 +106,9 @@ void demoUIInit(GLIB_Context_t * context)
sl_status_t updateDisplay(void)
{
sl_status_t status = SL_STATUS_OK;
#if SLI_917_SOC && SL_ICD_ENABLED && DISPLAY_ENABLED
#if SLI_SI91X_MCU_INTERFACE && SL_ICD_ENABLED && DISPLAY_ENABLED
sl_memlcd_post_wakeup_init();
#endif // SLI_917_SOC && SL_ICD_ENABLED && DISPLAY_ENABLED
#endif // SLI_SI91X_MCU_INTERFACE && SL_ICD_ENABLED && DISPLAY_ENABLED
#if SL_LCDCTRL_MUX
status = sl_wfx_host_pre_lcd_spi_transfer();
if (status != SL_STATUS_OK)
Expand Down
4 changes: 2 additions & 2 deletions examples/platform/silabs/display/lcd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
#include "dmd.h"
#include "glib.h"

#if (SLI_917_SOC)
#if (SLI_SI91X_MCU_INTERFACE)
#include "rsi_chip.h"
#endif

Expand Down Expand Up @@ -66,7 +66,7 @@ CHIP_ERROR SilabsLCD::Init(uint8_t * name, bool initialState)
}

/* Enable the memory lcd */
#if (SLI_917_SOC)
#if (SLI_SI91X_MCU_INTERFACE)
RSI_NPSSGPIO_InputBufferEn(SL_BOARD_ENABLE_DISPLAY_PIN, 1U);
RSI_NPSSGPIO_SetPinMux(SL_BOARD_ENABLE_DISPLAY_PIN, 0);
RSI_NPSSGPIO_SetDir(SL_BOARD_ENABLE_DISPLAY_PIN, 0);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
#include "wfx_host_events.h"
#include "wfx_rsi.h"

#if (SLI_917_SOC | EXP_BOARD)
#if (SLI_SI91X_MCU_INTERFACE | EXP_BOARD)
#include "sl_board_configuration.h"

#include "sl_rsi_utility.h"
Expand All @@ -61,7 +61,7 @@ void rsi_gpio_irq_cb(uint8_t irqnum)
{
if (irqnum != SL_WFX_HOST_PINOUT_SPI_IRQ)
return;
#if (SLI_917_SOC | EXP_BOARD)
#if (SLI_SI91X_MCU_INTERFACE | EXP_BOARD)
sl_si91x_host_set_bus_event(NCP_HOST_BUS_RX_EVENT);
#else
GPIO_IntClear(1 << SL_WFX_HOST_PINOUT_SPI_IRQ);
Expand Down
2 changes: 1 addition & 1 deletion examples/thermostat/silabs/src/ThermostatUI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
#include "glib.h"
#include "lcd.h"

#if SL_WIFI && !defined(SLI_917_SOC)
#if SL_WIFI && !defined(SLI_SI91X_MCU_INTERFACE)
// Only needed for wifi NCP devices
#include "spi_multiplex.h"
#endif // SL_WIFI
Expand Down
4 changes: 2 additions & 2 deletions src/platform/silabs/KeyValueStoreManagerImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -164,15 +164,15 @@ void KeyValueStoreManagerImpl::ScheduleKeyMapSave(void)
During commissioning, the key map will be modified multiples times subsequently.
Commit the key map in nvm once it as stabilized.
*/
#if SLI_917_SOC && CHIP_CONFIG_ENABLE_ICD_SERVER
#if SLI_SI91X_MCU_INTERFACE && CHIP_CONFIG_ENABLE_ICD_SERVER
// TODO: Remove this when RTC timer is added MATTER-2705
SilabsConfig::WriteConfigValueBin(SilabsConfig::kConfigKey_KvsStringKeyMap, reinterpret_cast<const uint8_t *>(mKvsKeyMap),
sizeof(mKvsKeyMap));
#else
SystemLayer().StartTimer(
std::chrono::duration_cast<System::Clock::Timeout>(System::Clock::Seconds32(SILABS_KVS_SAVE_DELAY_SECONDS)),
KeyValueStoreManagerImpl::OnScheduledKeyMapSave, NULL);
#endif // defined(SLI_917_SOC) && CHIP_CONFIG_ENABLE_ICD_SERVER
#endif // defined(SLI_SI91X_MCU_INTERFACE) && CHIP_CONFIG_ENABLE_ICD_SERVER
}

CHIP_ERROR KeyValueStoreManagerImpl::_Get(const char * key, void * value, size_t value_size, size_t * read_bytes_size,
Expand Down
8 changes: 4 additions & 4 deletions src/platform/silabs/SilabsConfig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
#include <nvm3_hal_flash.h>
#include <nvm3_lock.h>

#ifndef SLI_917_SOC // 917soc/wifi-sdk implements the same nvm3 lock/unlock mechanism and it currently can't be overide.
#ifndef SLI_SI91X_MCU_INTERFACE // 917soc/wifi-sdk implements the same nvm3 lock/unlock mechanism and it currently can't be overide.
#include <FreeRTOS.h>
#include <semphr.h>
// Substitute the GSDK weak nvm3_lockBegin and nvm3_lockEnd
Expand All @@ -58,7 +58,7 @@ void nvm3_lockEnd(void)
VerifyOrDie(nvm3_Sem != NULL);
xSemaphoreGive(nvm3_Sem);
}
#endif // !SLI_917_SOC
#endif // !SLI_SI91X_MCU_INTERFACE

namespace chip {
namespace DeviceLayer {
Expand All @@ -78,9 +78,9 @@ CHIP_ERROR SilabsConfig::Init()

void SilabsConfig::DeInit()
{
#ifndef SLI_917_SOC
#ifndef SLI_SI91X_MCU_INTERFACE
vSemaphoreDelete(nvm3_Sem);
#endif // !SLI_917_SOC
#endif // !SLI_SI91X_MCU_INTERFACE
nvm3_close(nvm3_defaultHandle);
}

Expand Down
18 changes: 9 additions & 9 deletions src/platform/silabs/efr32/wifi/ethernetif.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
#include "FreeRTOS.h"
#include "event_groups.h"
#include "task.h"
#if (SLI_917_SOC | EXP_BOARD)
#if (SLI_SI91X_MCU_INTERFACE | EXP_BOARD)
#ifdef __cplusplus
extern "C" {
#endif
Expand All @@ -46,7 +46,7 @@ extern "C" {
#ifdef __cplusplus
}
#endif
#endif // (SLI_917_SOC | EXP_BOARD)
#endif // (SLI_SI91X_MCU_INTERFACE | EXP_BOARD)
#endif // WF200_WIFI

#include "wfx_host_events.h"
Expand Down Expand Up @@ -349,7 +349,7 @@ static SemaphoreHandle_t ethout_sem;
******************************************************************************/
static err_t low_level_output(struct netif * netif, struct pbuf * p)
{
#if (SLI_917_SOC | EXP_BOARD)
#if (SLI_SI91X_MCU_INTERFACE | EXP_BOARD)
sl_wifi_buffer_t * buffer;
sl_si91x_packet_t * packet;
sl_status_t status = SL_STATUS_OK;
Expand Down Expand Up @@ -385,26 +385,26 @@ static err_t low_level_output(struct netif * netif, struct pbuf * p)
return ERR_IF;
}
/* Confirm if packet is allocated */
#if (SLI_917_SOC | EXP_BOARD)
#if (SLI_SI91X_MCU_INTERFACE | EXP_BOARD)
status = sl_si91x_allocate_command_buffer(&buffer, (void **) &packet, sizeof(sl_si91x_packet_t) + framelength,
SL_WIFI_ALLOCATE_COMMAND_BUFFER_WAIT_TIME_MS);
VERIFY_STATUS_AND_RETURN(status);
if (packet == NULL)
#else // RS9116
packet = wfx_rsi_alloc_pkt();
if (!packet)
#endif // SLI_917_SOC
#endif // SLI_SI91X_MCU_INTERFACE
{
SILABS_LOG("EN-RSI:No buf");
xSemaphoreGive(ethout_sem);
#if (SLI_917_SOC | EXP_BOARD)
#if (SLI_SI91X_MCU_INTERFACE | EXP_BOARD)
return SL_STATUS_ALLOCATION_FAILED;
}
memset(packet->desc, 0, sizeof(packet->desc));
#else // RS9116
return ERR_IF;
}
#endif // SLI_917_SOC
#endif // SLI_SI91X_MCU_INTERFACE
#ifdef WIFI_DEBUG_ENABLED
uint8_t * b = (uint8_t *) p->payload;
SILABS_LOG("EN-RSI: Out [%02x:%02x:%02x:%02x:%02x:%02x][%02x:%02x:%02x:%02x:%02x:%02x]type=%02x%02x", b[0], b[1], b[2], b[3],
Expand All @@ -428,7 +428,7 @@ static err_t low_level_output(struct netif * netif, struct pbuf * p)
/* forward the generated packet to RSI to
* send the data over wifi network
*/
#if (SLI_917_SOC | EXP_BOARD)
#if (SLI_SI91X_MCU_INTERFACE | EXP_BOARD)
packet->length = framelength & 0xFFF;
packet->command = RSI_SEND_RAW_DATA;
if (sl_si91x_driver_send_data_packet(SI91X_WLAN_CMD_QUEUE, buffer, 1000))
Expand All @@ -452,7 +452,7 @@ static err_t low_level_output(struct netif * netif, struct pbuf * p)
return ERR_OK;
}

#if (SLI_917_SOC | EXP_BOARD)
#if (SLI_SI91X_MCU_INTERFACE | EXP_BOARD)
/*****************************************************************************
* @fn void sl_si91x_host_process_data_frame(uint8_t *buf, int len)
* @brief
Expand Down
Loading

0 comments on commit e6a5e01

Please sign in to comment.