Skip to content

Commit

Permalink
[Telink] Added W91 v2.1 board configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
interfer committed Sep 25, 2024
1 parent e8554de commit d0b97fa
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 49 deletions.
2 changes: 1 addition & 1 deletion config/telink/chip-module/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ config CHIP_IPV4

config CHIP_BUTTON_MANAGER_IRQ_MODE
bool "Use GPIO in an IRQ mode instead of polling the GPIO"
default PM
default y if BOARD_TLSR9118BDK40D_V2
help
Use GPIO in an IRQ mode to avoid button polling loop and extend the battery lifetime by waking up by GPIO event.
GPIO events are working only with GPIO IRQ. This option changes button matrix configuration.
Expand Down
5 changes: 3 additions & 2 deletions config/telink/chip-module/Kconfig.defaults
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,8 @@ config PWM
endif

# Board non-retention config
if BOARD_TLSR9118BDK40D || BOARD_TLSR9528A || BOARD_TLSR9258A || BOARD_TLSR9518ADK80D
if BOARD_TLSR9118BDK40D_V1 || BOARD_TLSR9118BDK40D_V2 || \
BOARD_TLSR9528A || BOARD_TLSR9258A || BOARD_TLSR9518ADK80D
config PWM
default y
endif
Expand Down Expand Up @@ -292,7 +293,7 @@ config NET_CONFIG_INIT_TIMEOUT

config CHIP_WIFI
bool "Enable Telink Wi-Fi support"
default y if BOARD_TLSR9118BDK40D
default y if BOARD_TLSR9118BDK40D_V1 || BOARD_TLSR9118BDK40D_V2
select WIFI_W91
select WIFI
select NET_STATISTICS
Expand Down
15 changes: 11 additions & 4 deletions examples/platform/telink/common.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
string(REPLACE "_retention" "" BASE_BOARD ${BOARD})

if(NOT FLASH_SIZE)
if(${BASE_BOARD} MATCHES "tlsr9118bdk40d")
if(${BASE_BOARD} MATCHES "tlsr9118bdk40d" OR ${BASE_BOARD} MATCHES "tlsr9118bdk40d_v1"
OR ${BASE_BOARD} MATCHES "tlsr9118bdk40d_v2")
set(FLASH_SIZE "3m")
else()
set(FLASH_SIZE "2m")
Expand Down Expand Up @@ -86,17 +87,23 @@ endif()

set(GLOBAL_BOOT_DTC_OVERLAY_FILE "${CHIP_ROOT}/src/platform/telink/${BASE_BOARD}.overlay")
if(NOT EXISTS "${GLOBAL_BOOT_DTC_OVERLAY_FILE}")
message(FATAL_ERROR "${GLOBAL_BOOT_DTC_OVERLAY_FILE} doesn't exist")
message(STATUS "${GLOBAL_BOOT_DTC_OVERLAY_FILE} doesn't exist")
unset(GLOBAL_BOOT_DTC_OVERLAY_FILE)
endif()

set(GLOBAL_DTC_OVERLAY_FILE "${CHIP_ROOT}/src/platform/telink/${BOARD}.overlay")
if(NOT EXISTS "${GLOBAL_DTC_OVERLAY_FILE}")
message(FATAL_ERROR "${GLOBAL_DTC_OVERLAY_FILE} doesn't exist")
message(STATUS "${GLOBAL_DTC_OVERLAY_FILE} doesn't exist")
unset(GLOBAL_DTC_OVERLAY_FILE)
endif()

set(FLASH_DTC_OVERLAY_FILE "${CHIP_ROOT}/src/platform/telink/${BASE_BOARD}_${FLASH_SIZE}_flash.overlay")
if(NOT EXISTS "${FLASH_DTC_OVERLAY_FILE}")
message(FATAL_ERROR "${FLASH_DTC_OVERLAY_FILE} doesn't exist")
if(${BASE_BOARD} MATCHES "tlsr9118bdk40d_v1" OR ${BASE_BOARD} MATCHES "tlsr9118bdk40d_v2")
set(FLASH_DTC_OVERLAY_FILE "${CHIP_ROOT}/src/platform/telink/tlsr9118bdk40d_${FLASH_SIZE}_flash.overlay")
else()
message(FATAL_ERROR "${FLASH_DTC_OVERLAY_FILE} doesn't exist")
endif()
endif()

if(DTC_OVERLAY_FILE)
Expand Down
4 changes: 1 addition & 3 deletions examples/platform/telink/common/src/AppTaskCommon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -416,9 +416,7 @@ void AppTaskCommon::InitPwms()

void AppTaskCommon::LinkPwms(PwmManager & pwmManager)
{
#if CONFIG_BOARD_TLSR9118BDK40D // TLSR9118BDK40D EVK supports only 1 PWM channel connected to LED
pwmManager.linkPwm(PwmManager::EAppPwm_Red, 0);
#elif CONFIG_WS2812_STRIP
#if CONFIG_WS2812_STRIP
pwmManager.linkPwm(PwmManager::EAppPwm_Red, 0);
pwmManager.linkPwm(PwmManager::EAppPwm_Green, 1);
pwmManager.linkPwm(PwmManager::EAppPwm_Blue, 2);
Expand Down
39 changes: 0 additions & 39 deletions src/platform/telink/tlsr9118bdk40d.overlay

This file was deleted.

0 comments on commit d0b97fa

Please sign in to comment.