Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

modules: hal_silabs: add wiseconnect sdk #43

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
add_subdirectory_ifdef(CONFIG_HAS_SILABS_GECKO gecko)
add_subdirectory_ifdef(CONFIG_HAS_SILABS_GECKO zephyr)
add_subdirectory_ifdef(CONFIG_WISECONNECT wiseconnect)
80 changes: 80 additions & 0 deletions wiseconnect/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
# SPDX-License-Identifier: Apache-2.0

if(CONFIG_WISECONNECT)
zephyr_include_directories(
sapi/include
)
zephyr_include_directories(
configs
)
if (CONFIG_WISECONNECT_USE_OS_BINDINGS)
zephyr_compile_definitions(RSI_WITH_OS)
endif()
zephyr_interface_library_named(RS9116_WISECONNECT)
zephyr_library()
zephyr_compile_definitions(RSI_SAMPLE_HAL)
zephyr_compile_definitions(RSI_SPI_INTERFACE)
if (CONFIG_WISECONNECT_WIFI)
zephyr_compile_definitions(RSI_WLAN_ENABLE)
endif()
if (CONFIG_WISECONNECT_BT)
zephyr_compile_definitions(RSI_BT_ENABLE RSI_BLE_ENABLE)
endif()
zephyr_library_sources(
sapi/crypto/rsi_crypto.c
sapi/driver/rsi_iap.c
sapi/driver/rsi_setregion_countryinfo.c
sapi/driver/rsi_driver_event_handlers.c
sapi/driver/rsi_wlan.c
sapi/driver/rsi_nwk_rom.c
sapi/driver/rsi_nwk.c
sapi/driver/rsi_events.c
sapi/driver/rsi_device_init.c
sapi/driver/rsi_utils_rom.c
sapi/driver/rsi_bt_ble.c
sapi/driver/rsi_pkt_mgmt_rom.c
sapi/driver/rsi_os_none.c
sapi/driver/rsi_queue.c
sapi/driver/rsi_scheduler.c
sapi/driver/rsi_common.c
sapi/driver/rsi_events_rom.c
sapi/driver/rsi_pkt_mgmt.c
sapi/driver/rsi_timer.c
sapi/driver/device_interface/sdio/rsi_sdio_reg_rd_wr.c
sapi/driver/device_interface/sdio/rsi_sdio_frame_rd_wr.c
sapi/driver/device_interface/sdio/rsi_sdio_iface_init.c
sapi/driver/device_interface/sdio/rsi_sdio_mem_rd_wr.c
sapi/driver/device_interface/spi/rsi_spi_reg_rd_wr.c
sapi/driver/device_interface/spi/rsi_spi_functs.c
sapi/driver/device_interface/spi/rsi_spi_iface_init.c
sapi/driver/device_interface/spi/rsi_spi_mem_rd_wr.c
sapi/driver/device_interface/spi/rsi_spi_frame_rd_wr.c
sapi/driver/rsi_queue_rom.c
sapi/driver/rsi_driver.c
sapi/driver/rsi_scheduler_rom.c
sapi/driver/rsi_utils.c
sapi/common/rsi_apis_rom.c
sapi/common/rsi_apis_non_rom.c
sapi/common/rsi_device_init_apis.c
sapi/common/rsi_common_apis.c
sapi/bluetooth/rsi_ble_gatt_apis.c
sapi/bluetooth/rsi_bt_common_apis.c
sapi/bluetooth/rsi_bt_a2dp_apis.c
sapi/bluetooth/rsi_bt_avrcp_apis.c
sapi/bluetooth/rsi_bt_gap_apis.c
sapi/bluetooth/rsi_bt_spp_apis.c
sapi/bluetooth/rsi_ble_gap_apis.c
sapi/wlan/rsi_wlan_apis.c
sapi/network/socket/rsi_socket_rom.c
sapi/network/socket/rsi_socket.c
zephyr/rsi_hal_mcu_ioports.c
zephyr/rsi_hal_mcu_platform_init.c
zephyr/rsi_hal_mcu_timer.c
zephyr/rsi_hal_mcu_interrupt.c
zephyr/rsi_hal_mcu_random.c
zephyr/rsi_hal_mcu_uart.c
zephyr/rsi_hal_mcu_spi.c
zephyr/rsi_os_wrapper.c
)
zephyr_library_sources_ifdef(CONFIG_WISECONNECT_DNS sapi/network/protocols/rsi_dns.c)
endif()
108 changes: 108 additions & 0 deletions wiseconnect/Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
# SPDX-License-Identifier: Apache-2.0

config WISECONNECT
bool "Use WiSeConnect API"
default y
depends on DT_HAS_SILABS_RS9116W_ENABLED
select SPI

if WISECONNECT

config HEAP_MEM_POOL_SIZE
int
default 1024

config WISECONNECT_WIFI
bool "Compile WiFi APIs"

config WISECONNECT_BT
bool "Compile bluetooth APIs"

config WISECONNECT_USE_OS_BINDINGS
bool "Enable OS Bindings"
default y

endif # WISECONNECT

if WISECONNECT_WIFI

config WISECONNECT_SOCKETS_COUNT
int "Number of simultaneous sockets allowed"
range 1 10
default 10

config WISECONNECT_IPV6
bool "Enable IPV6 features in WiSeConnect"
default y

config WISECONNECT_TLS
bool "Enable TLS features on the WiSeConnect"
default y

config WISECONNECT_ICMP
bool "Enable WiSeConnect ICMP/Ping feature"
default n

config WISECONNECT_DHCP
bool "Enable WiSeConnect DHCP client"
default y

config WISECONNECT_DNS
bool "Enable WiSeConnect DNS client"
default y

config WISECONNECT_SOCKETS_LARGE_TRANSACTIONS
bool "Enable large socket send/recv."
default n

config WISECONNECT_IP_BYPASS_MODE
bool "Enable IP bypass mode (l2 access)"
default n
imply WISECONNECT_IP_DUAL_MODE

config WISECONNECT_IP_DUAL_MODE
bool "Enable IP bypass alongside non-bypass mode"
depends on WISECONNECT_IP_BYPASS_MODE

config WISECONNECT_BGSCAN
bool "Enable background scan/scans whilst connected"
default y

endif # WISECONNECT_WIFI

if WISECONNECT_BT

config WISECONNECT_DISABLE_DEFAULT_GAP_GATT
bool "Disable default GAP & GATT services."
default n

config WISECONNECT_DISABLE_DEFAULT_SCAN_RESPONSE
bool "Device will maintain some default scan reponse data and will be used in the scan_response controller frame. By enabling this we can make the default data as Null(empty)."
default n

config WISECONNECT_BLE_MAX_CENTRALS
int "Maximum number of BLE masters/centrals."
range 1 2
default 1

config WISECONNECT_BLE_MAX_PERIPHERALS
int "Maximum number of BLE slaves/peripherals."
range 1 8
default 1

config WISECONNECT_BLE_MAX_SERVS
int "Maximum number of BLE GATT services."
range 2 10
default 10

config WISECONNECT_BLE_MAX_CHARS
int "Maximum number of BLE GATT characteristics."
range 10 80
default 80

config WISECONNECT_BLE_MTU
int "Maximum Transfer Unit for BLE."
range 20 232
default 232

endif # BT_RS9116W
12 changes: 12 additions & 0 deletions wiseconnect/README
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
This directory contains firmware supporting wiseconnect 2.8.0 provided by SiLabs to T-Mobile under the Apache 2.0 licence.

* Available firmware images:
https://github.com/SiliconLabs/wiseconnect-wifi-bt-sdk/blob/2.8.0/firmware/RS9116W.2.8.0.0.45.rps
https://github.com/SiliconLabs/wiseconnect-wifi-bt-sdk/blob/2.8.0/firmware/RS916W.2.8.0.0.45.rps

Please choose the right firmware file (in the package) as per the below guidelines.
1. Customers using OPN RS9116X-xxx-xxx-Xxx parts (Silicon rev 1.3) or customers using OPN RS9116X-xxx-xxx-Bxx(Silicon rev 1.4)
should use RS9116W.x.x.x.x.x.rps
2. Customers using the RS9116X-xxx-xxx-Cxx parts(Silicon rev 1.5) should use RS916W.x.x.x.x.x.rps.
Silicon rev 1.5 has some enhancements primarily for BT classic audio A2DP etc

58 changes: 58 additions & 0 deletions wiseconnect/configs/rsi_ble_config.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
/*
* Copyright (c) 2021 T-Mobile USA, Inc.
*
* SPDX-License-Identifier: Apache-2.0
*/


#ifndef RSI_BLE_CONFIG_H
#define RSI_BLE_CONFIG_H

#include <rsi_data_types.h>
#include <rsi_ble_common_config.h>


#ifdef CONFIG_WISECONNECT_DISABLE_DEFAULT_SCAN_RESPONSE
#undef RSI_BLE_SET_SCAN_RESP_DATA_FROM_HOST
#if CONFIG_WISECONNECT_DISABLE_DEFAULT_SCAN_RESPONSE
#define RSI_BLE_SET_SCAN_RESP_DATA_FROM_HOST 1
#else
#define RSI_BLE_SET_SCAN_RESP_DATA_FROM_HOST 0
#endif
#endif

#ifdef CONFIG_WISECONNECT_DISABLE_DEFAULT_GAP_GATT
#undef BLE_SIMPLE_GATT
#if CONFIG_WISECONNECT_DISABLE_DEFAULT_GAP_GATT
#define BLE_SIMPLE_GATT 1
#else
#define BLE_SIMPLE_GATT 0
#endif
#endif

#ifdef CONFIG_WISECONNECT_BLE_MAX_CENTRALS
#undef RSI_BLE_MAX_NBR_MASTERS
#define RSI_BLE_MAX_NBR_MASTERS CONFIG_WISECONNECT_BLE_MAX_CENTRALS
#endif

#ifdef CONFIG_WISECONNECT_BLE_MAX_PERIPHERALS
#undef RSI_BLE_MAX_NBR_SLAVES
#define RSI_BLE_MAX_NBR_SLAVES CONFIG_WISECONNECT_BLE_MAX_PERIPHERALS
#endif

#ifdef CONFIG_WISECONNECT_BLE_MAX_SERVS
#undef RSI_BLE_MAX_NBR_ATT_SERV
#define RSI_BLE_MAX_NBR_ATT_SERV CONFIG_WISECONNECT_BLE_MAX_SERVS
#endif

#ifdef CONFIG_WISECONNECT_BLE_MAX_CHARS
#undef RSI_BLE_MAX_NBR_ATT_REC
#define RSI_BLE_MAX_NBR_ATT_REC CONFIG_WISECONNECT_BLE_MAX_CHARS
#endif

#ifdef CONFIG_WISECONNECT_BLE_MTU
#undef RSI_BLE_MTU_SIZE
#define RSI_BLE_MTU_SIZE CONFIG_WISECONNECT_BLE_MTU
#endif

#endif
10 changes: 10 additions & 0 deletions wiseconnect/configs/rsi_board_configuration.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/*
* Copyright (c) 2022 T-Mobile USA, Inc.
*
* SPDX-License-Identifier: Apache-2.0
*/

/* This eliminates the sscanf warning */
#if !CONFIG_NEWLIB_LIBC
int sscanf(const char *str, const char *format, ...);
#endif
19 changes: 19 additions & 0 deletions wiseconnect/configs/rsi_bt_config.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/*
* Copyright (c) 2021 T-Mobile USA, Inc.
*
* SPDX-License-Identifier: Apache-2.0
*/


#ifndef RSI_BT_CONFIG_H
#define RSI_BT_CONFIG_H


#include <rsi_data_types.h>
#include <rsi_bt_common.h>
#include <rsi_bt_common_config.h>

#undef RSI_BT_FEATURE_BITMAP
#define RSI_BT_FEATURE_BITMAP (BT_RF_TYPE | ENABLE_BLE_PROTOCOL)
#endif

Loading