Skip to content

Commit

Permalink
WiSeConnect 3 SDK release: v3.1.2
Browse files Browse the repository at this point in the history
  • Loading branch information
wifi-ci-agent committed Jan 17, 2024
1 parent a63c4cd commit f24a693
Show file tree
Hide file tree
Showing 426 changed files with 9,670 additions and 3,729 deletions.
1 change: 0 additions & 1 deletion components/board/silabs/config/brd4180b/FreeRTOSConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,6 @@
// <i> Enable Threadsafe Errno support.
// <i> Default: 0
#define configUSE_POSIX_ERRNO 0

//------------- <<< end of configuration section >>> ---------------------------

/* Defines needed by FreeRTOS to implement CMSIS RTOS2 API. Do not change! */
Expand Down
1 change: 1 addition & 0 deletions components/common/inc/sl_additional_status.h
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,7 @@
#define SL_STATUS_SI91X_MQTT_ERROR_BAD_USERNAME_PASSWORD \
((sl_status_t)0x10084) ///< The data in the user name or password is malformed.
#define SL_STATUS_SI91X_MQTT_ERROR_NOT_AUTHORIZED ((sl_status_t)0x10085) ///< The Client is not authorized to connect.
#define SL_STATUS_SI91X_SA_QUERY_TIMEOUT ((sl_status_t)0x10086) ///< Disconnection due to SA Query Timeout.
#define SL_STATUS_SI91X_DUPLICATE_ENTRY_EXISTS_IN_DNS_SERVER_TABLE \
((sl_status_t)0x100AF) ///< Duplicate entry exists in DNS server table.
#define SL_STATUS_SI91X_NO_MEM_AVAILABLE ((sl_status_t)0x100B1) ///< Memory error: No memory available.
Expand Down
4 changes: 1 addition & 3 deletions components/console/console_minimal_uart_plugin.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,7 @@
* Macros
******************************************************/

#ifndef SLI_SI91X_MCU_INTERFACE
#define sl_uart_print(a, b) printf(b)
#endif

/******************************************************
* Constants
Expand Down Expand Up @@ -300,7 +298,7 @@ static void print_command_database(const console_database_t *database, const cha
sl_uart_print(DEFAULT_UART, command->description);
}
sl_uart_print(DEFAULT_UART, "\r\n");
for (int b = 0; b < temp->length; b++) {
for (uint32_t b = 0; b < temp->length; b++) {
sl_uart_print(DEFAULT_UART, " - ");
sl_uart_print(DEFAULT_UART, temp->entries[b].key);
sl_uart_print(DEFAULT_UART, " : ");
Expand Down
2 changes: 2 additions & 0 deletions components/console/variables/console_variables.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#include <stddef.h>
#include <stdio.h>
#include <string.h>
#include "sl_constants.h"

/******************************************************
* Macros
Expand Down Expand Up @@ -321,6 +322,7 @@ sl_status_t console_variable_set(console_args_t *arguments)

sl_status_t console_variable_list(console_args_t *arguments)
{
UNUSED_PARAMETER(arguments);
if (console_variable_table_size == 0) {
printf("No variables available\n");
return SL_STATUS_OK;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,14 @@ void fpuInit(void);

extern void set_scdc(uint32 Deepsleep);

#ifdef SLI_SI91X_MCU_ENABLE_PSRAM_FEATURE
#include "sl_si91x_psram_config.h"
#ifdef PSRAM_HALF_SLEEP_SUPPORTED
extern void sl_si91x_psram_sleep(void);
extern void sl_si91x_psram_wakeup(void);
#endif
#endif

uint32_t nvic_enable[MAX_NVIC_REGS] = { 0 };
uint8_t nvic_ip_reg[MAX_IPS] = { 0 };
uint8_t scs_shp_reg[MAX_SHP] = { 0 };
Expand Down Expand Up @@ -388,7 +396,6 @@ rsi_error_t RSI_PS_EnterDeepSleep(SLEEP_TYPE_T sleepType, uint8_t lf_clk_mode)
set_scdc(SL_SCDC_SLEEP);

#ifdef SLI_SI91X_MCU_ENABLE_PSRAM_FEATURE
#include "sl_si91x_psram_config.h"
#if (defined INTERNAL_LDO_FOR_PSRAM)
RSI_PS_M4ssPeriPowerUp(M4SS_PWRGATE_ULP_EFUSE_PERI);
if (sleepType == SLEEP_WITH_RETENTION) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ void Board_UARTPutSTR(uint8_t *ptr);
uint8_t Board_UARTGetChar(void);
void Board_UARTPutChar(uint8_t ch);

#ifndef IOSTREAM_USART
#ifdef DEBUG_UART
#define DEBUGINIT() Board_Debug_Init()
#define DEBUGOUT(...) printf(__VA_ARGS__)
Expand All @@ -43,6 +44,10 @@ void Board_UARTPutChar(uint8_t ch);
#define DEBUGSTR(str)
#define DEBUGIN()
#endif
#else
#define DEBUGINIT()
#define DEBUGOUT(...) printf(__VA_ARGS__)
#endif

#ifdef __cplusplus
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#include "rsi_ccp_common.h"

void ARM_UART_SignalEvent(uint32_t event);

extern void cache_uart_rx_data(const char character);
#ifdef SLI_SI91X_MCU_CONFIG_RADIO_BOARD_BASE_VER
#define M4_UART1_INSTANCE 0U //!Select m4 uart1 for prints
#if ((defined(ULP_MODE_EXECUTION)) || (defined(SLI_SI91X_MCU_CONFIG_RADIO_BOARD_VER2)))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,4 @@ provides:
- name: sl_si70xx
requires:
- name: sl_i2c
- name: sl_gpio
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,6 @@ extern "C" {
#define SI7020_ADDR 0X40 ///< I2C device address for Si7020
#define SI7021_ADDR 0x40 ///< I2C device address for Si7021
#define I2C_BASE I2C2 ///< I2C2 base
#define RX_LEN 2 ///< Read buffer length 2 bytes
#define TX_LEN 2 ///< Write buffer length 2 bytes
#define RD_BUF 6 ///< Read buffer length 6 bytes
#define WR_BUF 1 ///< Write buffer length 1 byte

/*******************************************************************************
******************************** ENUMS ************************************
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@
/*******************************************************************************
*************************** Defines / Macros ******************************
******************************************************************************/
#define RX_LEN 2 ///< Read buffer length 2 bytes
#define TX_LEN 2 ///< Write buffer length 2 bytes
#define RD_BUF 6 ///< Read buffer length 6 bytes
#define WR_BUF 1 ///< Write buffer length 1 byte

/*******************************************************************************
***********************  Local function Prototypes ***************************
Expand Down Expand Up @@ -105,10 +109,8 @@ sl_status_t sl_si91x_si70xx_start_no_hold_measure_rh_or_temp(sl_i2c_instance_t i
uint32_t *data)
{
sl_status_t status;
uint8_t read_buffer_size = RX_LEN;
uint8_t write_buffer_size = WR_BUF;
uint8_t i2c_read_data[read_buffer_size];
uint8_t i2c_write_data[write_buffer_size];
uint8_t i2c_read_data[RX_LEN] = { 0 };
uint8_t i2c_write_data[WR_BUF] = { 0 };
uint8_t cmd;
// Validate invalid parameters
if ((i2c_instance >= SL_I2C_LAST) || (type >= SL_LAST_MEASUREMENT)) {
Expand All @@ -124,18 +126,28 @@ sl_status_t sl_si91x_si70xx_start_no_hold_measure_rh_or_temp(sl_i2c_instance_t i
}
i2c_write_data[0] = cmd;
// Send no hold master mode command to sensor
status = sl_i2c_driver_send_data_blocking(i2c_instance, addr, i2c_write_data, write_buffer_size);
status = sl_i2c_driver_send_data_blocking(i2c_instance, addr, i2c_write_data, WR_BUF);
if (status != SL_STATUS_OK) {
return status;
}
wait_till_i2c_gets_idle(I2C_BASE);
// Receive no hold master mode response from sensor
status = sl_i2c_driver_receive_data_blocking(i2c_instance, addr, i2c_read_data, read_buffer_size);
if (status != SL_STATUS_OK) {
return status;

while (*data == 0) {
// Receive no hold master mode response from sensor
status = sl_i2c_driver_receive_data_blocking(i2c_instance, addr, i2c_read_data, RX_LEN);
if (status != SL_STATUS_OK) {
return status;
}
wait_till_i2c_gets_idle(I2C_BASE);
*data = (uint32_t)((i2c_read_data[0] << 8) | (i2c_read_data[1]));
}
if (i2c_write_data[0] == SL_HUMIDITY_NHM) {
// Convert relative humidity measurement to percent relative humidity
*data = (uint32_t)si70xx_get_percent_relative_humidity(*data);
} else {
// Convert temperature measurement to temperature in degrees Celcius
*data = (int32_t)si70xx_get_celcius_temperature(*data);
}
wait_till_i2c_gets_idle(I2C_BASE);
*data = (uint32_t)((i2c_read_data[0] << 8) | (i2c_read_data[1]));
return SL_STATUS_OK;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ sl_status_t sl_si91x_joystick_get_position(sl_joystick_state_t state, sl_joystic
sample_data = (((float)adc_value / (float)ADC_MAX_OP_VALUE) * vref_value);
sample_data = (sample_data * DIVISION_MULTIPLIER);
// determine which direction pad was pressed
if ((sample_data <= JOYSTICK_MV_C + JOYSTICK_MV_ERROR)) {
if ((sample_data >= JOYSTICK_MV_C - JOYSTICK_MV_ERROR) && (sample_data <= JOYSTICK_MV_C + JOYSTICK_MV_ERROR)) {
joystick_direction = SL_JOYSTICK_C;
} else if ((sample_data >= JOYSTICK_MV_N - JOYSTICK_MV_ERROR)
&& (sample_data <= JOYSTICK_MV_N + JOYSTICK_MV_ERROR)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ extern "C" {
#endif

/*==============================================*/
/**
/**
* @fn RSI_DRIVER_VERSION_M4 RSI_GPDMA_GetVersion(void)
* @brief This API is used to get version information of the driver implementation
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1279,7 +1279,6 @@ rsi_error_t RSI_SIO_I2cRead(volatile SIO_Type *pstcSio,
uint8_t *u8Data,
uint16_t u16Len)
{

uint32_t u32Enable = 0, u32Sdat = 0, u32Slav = 0;
volatile uint32_t u32RecvDat = 0;
int cnt;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@
#endif
#ifdef SL_SI91X_USART_DMA
#include "sl_si91x_dma.h"
#define DMA_INSTANCE 0
sl_dma_init_t dma_init;
#define UART_DMA_INSTANCE 0
#define ULP_UART_DMA_INSTANCE 1
#endif

/*****************************************************************************
Expand Down Expand Up @@ -404,8 +406,11 @@ int32_t USART_Initialize(ARM_USART_SignalEvent_t cb_event,
if (usart->dma_tx || usart->dma_rx) {
if ((usart->pREGS == UART0) || (usart->pREGS == USART0) || (usart->pREGS == UART1) || (usart->pREGS == ULP_UART)) {
#ifdef SL_SI91X_USART_DMA
sl_dma_init_t dma_init;
dma_init.dma_number = DMA_INSTANCE;
if (usart->pREGS == ULP_UART) {
dma_init.dma_number = ULP_UART_DMA_INSTANCE;
} else {
dma_init.dma_number = UART_DMA_INSTANCE;
}
if (sl_si91x_dma_init(&dma_init)) {
return ARM_DRIVER_ERROR;
}
Expand Down Expand Up @@ -449,7 +454,7 @@ int32_t USART_Uninitialize(USART_RESOURCES *usart, UDMA_RESOURCES *udma)
if ((usart->pREGS == UART0) || (usart->pREGS == USART0) || (usart->pREGS == UART1) || (usart->pREGS == ULP_UART)) {
//unintialise dma
#ifdef SL_SI91X_USART_DMA
if (sl_si91x_dma_deinit(DMA_INSTANCE)) {
if (sl_si91x_dma_deinit(dma_init.dma_number)) {
return ARM_DRIVER_ERROR;
}
#else
Expand Down Expand Up @@ -494,7 +499,7 @@ int32_t USART_PowerControl(ARM_POWER_STATE state,
if ((usart->pREGS == UART0) || (usart->pREGS == USART0) || (usart->pREGS == UART1)
|| (usart->pREGS == ULP_UART)) {
#ifdef SL_SI91X_USART_DMA
if (sl_si91x_dma_channel_disable(DMA_INSTANCE, usart->dma_tx->channel + 1)) {
if (sl_si91x_dma_channel_disable(dma_init.dma_number, usart->dma_tx->channel + 1)) {
return ARM_DRIVER_ERROR;
}
#else
Expand All @@ -509,7 +514,7 @@ int32_t USART_PowerControl(ARM_POWER_STATE state,
if ((usart->pREGS == UART0) || (usart->pREGS == USART0) || (usart->pREGS == UART1)
|| (usart->pREGS == ULP_UART)) {
#ifdef SL_SI91X_USART_DMA
if (sl_si91x_dma_channel_disable(DMA_INSTANCE, usart->dma_rx->channel + 1)) {
if (sl_si91x_dma_channel_disable(dma_init.dma_number, usart->dma_rx->channel + 1)) {
return ARM_DRIVER_ERROR;
}
#else
Expand Down Expand Up @@ -677,16 +682,16 @@ int32_t USART_Send_Data(const void *data,
dma_transfer_tx.signal = chnl_cfg.periAck;

//Allocate DMA channel for Tx
status = sl_si91x_dma_allocate_channel(DMA_INSTANCE, &channel, channel_priority);
status = sl_si91x_dma_allocate_channel(dma_init.dma_number, &channel, channel_priority);
if (status && (status != SL_STATUS_DMA_CHANNEL_ALLOCATED)) {
return ARM_DRIVER_ERROR;
}
//Register transfer complete and error callback
if (sl_si91x_dma_register_callbacks(DMA_INSTANCE, channel, &usart_tx_callback)) {
if (sl_si91x_dma_register_callbacks(dma_init.dma_number, channel, &usart_tx_callback)) {
return ARM_DRIVER_ERROR;
}
//Configure the channel for DMA transfer
if (sl_si91x_dma_transfer(DMA_INSTANCE, channel, &dma_transfer_tx)) {
if (sl_si91x_dma_transfer(dma_init.dma_number, channel, &dma_transfer_tx)) {
return ARM_DRIVER_ERROR;
}
#else
Expand All @@ -705,8 +710,8 @@ int32_t USART_Send_Data(const void *data,
}
#endif
#ifdef SL_SI91X_USART_DMA
sl_si91x_dma_channel_enable(DMA_INSTANCE, usart->dma_tx->channel + 1);
sl_si91x_dma_enable(DMA_INSTANCE);
sl_si91x_dma_channel_enable(dma_init.dma_number, usart->dma_tx->channel + 1);
sl_si91x_dma_enable(dma_init.dma_number);
#else
UDMAx_ChannelEnable(usart->dma_tx->channel, udma, udmaHandle);
UDMAx_DMAEnable(udma, udmaHandle);
Expand Down Expand Up @@ -835,16 +840,16 @@ int32_t USART_Receive_Data(const void *data,
dma_transfer_rx.signal = chnl_cfg.periAck;

//Allocate DMA channel for Rx
status = sl_si91x_dma_allocate_channel(DMA_INSTANCE, &channel, channel_priority);
status = sl_si91x_dma_allocate_channel(dma_init.dma_number, &channel, channel_priority);
if (status && (status != SL_STATUS_DMA_CHANNEL_ALLOCATED)) {
return ARM_DRIVER_ERROR;
}
//Register transfer complete and error callback
if (sl_si91x_dma_register_callbacks(DMA_INSTANCE, channel, &usart_rx_callback)) {
if (sl_si91x_dma_register_callbacks(dma_init.dma_number, channel, &usart_rx_callback)) {
return ARM_DRIVER_ERROR;
}
//Configure the channel for DMA transfer
if (sl_si91x_dma_transfer(DMA_INSTANCE, channel, &dma_transfer_rx)) {
if (sl_si91x_dma_transfer(dma_init.dma_number, channel, &dma_transfer_rx)) {
return ARM_DRIVER_ERROR;
}
#else
Expand All @@ -863,9 +868,9 @@ int32_t USART_Receive_Data(const void *data,
}
#endif
#ifdef SL_SI91X_USART_DMA
sl_si91x_dma_channel_enable(DMA_INSTANCE, usart->dma_rx->channel + 1);
sl_si91x_dma_channel_enable(dma_init.dma_number, usart->dma_rx->channel + 1);
if (usart->sync_mode.en_usart_mode == 0) {
sl_si91x_dma_enable(DMA_INSTANCE);
sl_si91x_dma_enable(dma_init.dma_number);
}
#else
UDMAx_ChannelEnable(usart->dma_rx->channel, udma, udmaHandle);
Expand Down Expand Up @@ -1086,7 +1091,7 @@ int32_t USART_Control(uint32_t control,
if ((usart->pREGS == UART0) || (usart->pREGS == USART0) || (usart->pREGS == UART1)
|| (usart->pREGS == ULP_UART)) {
#ifdef SL_SI91X_USART_DMA
if (sl_si91x_dma_channel_disable(DMA_INSTANCE, usart->dma_tx->channel + 1)) {
if (sl_si91x_dma_channel_disable(dma_init.dma_number, usart->dma_tx->channel + 1)) {
return ARM_DRIVER_ERROR;
}
#else
Expand Down Expand Up @@ -1117,7 +1122,7 @@ int32_t USART_Control(uint32_t control,
if ((usart->pREGS == UART0) || (usart->pREGS == USART0) || (usart->pREGS == UART1)
|| (usart->pREGS == ULP_UART)) {
#ifdef SL_SI91X_USART_DMA
if (sl_si91x_dma_channel_disable(DMA_INSTANCE, usart->dma_tx->channel + 1)) {
if (sl_si91x_dma_channel_disable(dma_init.dma_number, usart->dma_tx->channel + 1)) {
return ARM_DRIVER_ERROR;
}
#else
Expand All @@ -1142,7 +1147,7 @@ int32_t USART_Control(uint32_t control,
if ((usart->pREGS == UART0) || (usart->pREGS == USART0) || (usart->pREGS == UART1)
|| (usart->pREGS == ULP_UART)) {
#ifdef SL_SI91X_USART_DMA
if (sl_si91x_dma_channel_disable(DMA_INSTANCE, usart->dma_tx->channel + 1)) {
if (sl_si91x_dma_channel_disable(dma_init.dma_number, usart->dma_tx->channel + 1)) {
return ARM_DRIVER_ERROR;
}
#else
Expand All @@ -1155,7 +1160,7 @@ int32_t USART_Control(uint32_t control,
if ((usart->pREGS == UART0) || (usart->pREGS == USART0) || (usart->pREGS == UART1)
|| (usart->pREGS == ULP_UART)) {
#ifdef SL_SI91X_USART_DMA
if (sl_si91x_dma_channel_disable(DMA_INSTANCE, usart->dma_rx->channel + 1)) {
if (sl_si91x_dma_channel_disable(dma_init.dma_number, usart->dma_rx->channel + 1)) {
return ARM_DRIVER_ERROR;
}
#else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -199,4 +199,4 @@ STATIC INLINE rsi_error_t RSI_EFUSE_MemMapReadWord(EFUSE_Type *pstcEfuse,

#endif /*__RSI_ROM_EFUSE_H__*/

/* @} end of RSI_EFUSE_DRIVER */
/* @} end of RSI_EFUSE_DRIVER */
Original file line number Diff line number Diff line change
Expand Up @@ -227,9 +227,14 @@ STATIC INLINE void RSI_PS_RetentionSleepConfig(uint32_t stack_address,
{

#ifdef SLI_SI917B0
//!write magic numbers in ulp memory (work around for jtag mode powersave)
(*(volatile uint32_t *)(0x24061F00)) = 0xBEAFBEAF;
(*(volatile uint32_t *)(0x24061FCC)) = 0xBEADBEAD;
//!write magic numbers in retention ram content ulp memory start ,end addresses (work around for jtag mode powersave)
RETEN_RAM_CONTENT_START_LOCATION = 0xBEAFBEAF;
RETEN_RAM_CONTENT_END_LOCATION = 0xBEADBEAD;

//!remove wakeup flash bit in ulpss ram if flash is not required upon wakuep
if (mode == SL_SI91X_MCU_WAKEUP_PSRAM_MODE) {
RETEN_RAM_CONTENT_WAKEUP_FLASH_BIT_LOCATION = 0x0;
}

if ((mode == RSI_WAKEUP_WITH_RETENTION) || (mode == RSI_WAKEUP_WO_RETENTION_WO_ULPSS_RAM)) {
RSI_PS_RetentionSleepConfig_bypass(stack_address, jump_cb_address, vector_offset, mode);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
id: iostream_si91x
label: IO Stream
label: IO Stream Si91x
package: platform
description: >
The IO Stream component allows to read/write data using a variety of physical
Expand Down Expand Up @@ -44,4 +44,5 @@ define:
provides:
- name: iostream_si91x
requires:
- name: sl_usart_iostream
- name: sl_usart_iostream
- name: iostream_retarget_stdio
Loading

0 comments on commit f24a693

Please sign in to comment.