Skip to content

[TrackerM] Add platform support #2492

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

Merged
merged 31 commits into from
Aug 16, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
085c0a5
Fix newline mode
Jun 6, 2022
0edcaaf
Add GPIO expander and demux to tron
Jun 6, 2022
71b1fda
I/O expander and demux for Tracker M proto board
Jun 7, 2022
a03dcde
Add rest of IO expander and demux pins for Tracker M
Jun 7, 2022
1860863
Add PMIC_INT pin definition
Jun 7, 2022
bf4d65e
Workaround for problem CS pins on proto board
Jun 9, 2022
75914c9
Add interrupts for IO expander
Jun 10, 2022
a40a13b
Add cellular sources to p2 build
Jun 13, 2022
1e2c433
Copy quectel stuff from device-os public
Jun 13, 2022
f8e144c
Update tron pins for cell modem GPIOs and start cell manager
Jun 13, 2022
d83377e
Comment out WiFi and enable cell NCP
Jun 14, 2022
eb4d4ce
Reverse levels and disable flow control
Jun 14, 2022
7da80dc
Turn off DMA on modem's UART
Jun 14, 2022
9850d28
Don't use hardware UART events to get BG95 mux working
Jun 15, 2022
56b8b44
Re-enable flow control with Keerthy's change to rtl827x/usart_hal.cpp
Jun 15, 2022
4ad73fa
Add trackerm platform support
keeramis Jul 25, 2022
a055368
Refactor and move demux and ioexpander source files to hal/shared
keeramis Jul 25, 2022
8754af4
Clean up
keeramis Jul 25, 2022
35e7faa
minor
keeramis Jul 26, 2022
071f6c0
Address review comments
keeramis Jul 27, 2022
97b8d18
Address review comments
keeramis Aug 10, 2022
4b1bc78
[rtl872x] fixup sdk headers
avtolstoy Aug 10, 2022
ce920e8
fix wlan interfaces and minor
keeramis Aug 11, 2022
13420eb
Enable HAL_PLATFORM_WIFI for trackerm and other minor
keeramis Aug 11, 2022
0e16984
Fix reading ncp id
keeramis Aug 16, 2022
817aa79
GuoHui's fix to address multi byte serial stream in hal usart
keeramis Aug 16, 2022
bc26a6d
[third_party] ambd_sdk: update submodule reference
avtolstoy Aug 16, 2022
7d82ff2
[rtl872x] fixup irqn defines
avtolstoy Aug 12, 2022
d29e6e7
[buildpack] add trackerm
avtolstoy Aug 16, 2022
ab06eac
[build] minor fix in release scripts fro trackerm
avtolstoy Aug 16, 2022
0c977b3
[build] enumerate_build_matrix.sh add trackerm
avtolstoy Aug 16, 2022
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
4 changes: 2 additions & 2 deletions .buildpackrc
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ export BUILDPACK_VARIATION=manifest
export RELEASE_PLATFORMS=( )

# Platforms for which this firmware is considered experimental
export PRERELEASE_PLATFORMS=( argon boron bsom b5som tracker esomx p2 )
export PRERELEASE_PLATFORMS=( argon boron bsom b5som tracker esomx p2 trackerm )
# Note: a single platform should be only in release or prerelease list. If
# added to both it will be considered a prerelease

# Platforms which require modules to be prebuilt
export MODULAR_PLATFORMS=( argon boron bsom b5som tracker esomx p2 )
export MODULAR_PLATFORMS=( argon boron bsom b5som tracker esomx p2 trackerm )

4 changes: 2 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ orbs:

aliases:
- &tasks ["compile:all clean:all", "compile:user clean:user", "compile:debug clean:debug"]
- &platforms ["argon", "boron", "esomx", "bsom", "b5som", "tracker", "p2"]
- &platforms ["argon", "boron", "esomx", "bsom", "b5som", "tracker", "p2", "trackerm"]

# Define a job to be invoked later in a workflow.
# See: https://circleci.com/docs/2.0/configuration-reference/#jobs
Expand Down Expand Up @@ -475,7 +475,7 @@ workflows:
- particle-ci-private
matrix:
parameters:
platform: ["argon", "boron", "esomx", "bsom", "b5som", "tracker", "p2", "unit-test newhal gcc"]
platform: ["argon", "boron", "esomx", "bsom", "b5som", "tracker", "p2", "trackerm", "unit-test newhal gcc"]
- combine-binaries:
requires:
- build-and-test
Expand Down
2 changes: 1 addition & 1 deletion .workbench/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"version": "1.0.0",
"toolchains": [
{
"platforms": [12, 13, 15, 23, 25, 26, 32],
"platforms": [12, 13, 15, 23, 25, 26, 28, 32],
"firmware": "deviceOS@source",
"compilers": "[email protected]",
"tools": "[email protected]",
Expand Down
2 changes: 1 addition & 1 deletion bootloader/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ BOOTLOADER_MODULE_PATH=.
PLATFORM_DFU=0x8000000
BUILD_PATH_EXT = $(BOOTLOADER_BUILD_PATH_EXT)

ifeq ("$(PLATFORM)","p2")
ifeq ($(PLATFORM_MCU),rtl872x)
RTL_BINARY_FLASH_START = 0x4000
endif

Expand Down
2 changes: 1 addition & 1 deletion bootloader/prebootloader/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ include $(PROJECT_ROOT)/build/macros.mk
include $(PROJECT_ROOT)/build/module-defaults.mk
include $(PROJECT_ROOT)/build/arm-tools.mk

projects = $(sort $(wildcard $(current_dir)/src/$(PLATFORM_DYNALIB_MODULES)/*))
projects = $(sort $(wildcard $(current_dir)/src/$(PLATFORM_MCU)/*))
makefiles = $(foreach module,$(projects),$(and $(strip $(subst $(MODULE_EXCLUDE),,$(notdir $(module)))),$(wildcard $(module)/makefile)))

SUBDIR_GOALS := $(MAKECMDGOALS)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ CSRC += $(PROJECT_ROOT)/hal/src/rtl872x/hal_irq_flag.c
CPPSRC += $(PROJECT_ROOT)/hal/src/rtl872x/flash_common.cpp
CPPSRC += $(PROJECT_ROOT)/hal/src/rtl872x/km0_km4_ipc.cpp
CPPSRC += $(PROJECT_ROOT)/hal/src/rtl872x/pinmap_hal.cpp
CPPSRC += $(PROJECT_ROOT)/hal/src/tron/pinmap_defines.cpp

CPPSRC += $(PROJECT_ROOT)/hal/src/$(PLATFORM_NAME)/pinmap_defines.cpp

LDFLAGS += -T$(PREBOOTLOADER_PART1_SRC_PATH)/linker.ld
LINKER_DEPS += $(PREBOOTLOADER_PART1_SRC_PATH)/linker.ld
4 changes: 2 additions & 2 deletions bootloader/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
#include "button_hal.h"
#include "dct.h"
#include "feature_flags.h"
#if PLATFORM_ID == PLATFORM_P2
#if HAL_PLATFORM_RTL872X
#include "rtl8721d.h"
#include "nonsecure.h"
#endif
Expand All @@ -48,7 +48,7 @@ extern void HAL_DFU_Process();

void platform_startup();

#if PLATFORM_ID == PLATFORM_P2
#if HAL_PLATFORM_RTL872X
static void jump_to_system(uint32_t addr, uint32_t sp) {
nonsecure_jump_to_system(addr);
(void) sp;
Expand Down
2 changes: 2 additions & 0 deletions bootloader/src/trackerm/include.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
INCLUDE_DIRS += $(BOOTLOADER_MODULE_PATH)/src/$(PLATFORM_NAME)
include $(BOOTLOADER_MODULE_PATH)/src/rtl872x/include.mk
2 changes: 2 additions & 0 deletions bootloader/src/trackerm/sources.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
BOOTLOADER_SRC_PATH = $(BOOTLOADER_MODULE_PATH)/src/${PLATFORM_NAME}
include $(BOOTLOADER_MODULE_PATH)/src/rtl872x/sources.mk
3 changes: 2 additions & 1 deletion build/create_module.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ class Platform(IntEnum):
BSOM = 23
B5SOM = 25
TRACKER = 26
TRACKERM = 28
P2 = 32

class StructSerializable(struct.Struct):
Expand Down Expand Up @@ -243,7 +244,7 @@ def parse_dependency(dep):
GEN3_RADIO_STACK_DEPENDENCY = ModuleDependency(ModuleFunction.BOOTLOADER, 501)
GEN3_RADIO_STACK_DEPENDENCY2 = ModuleDependency(ModuleFunction.SYSTEM_PART, 1321, 1)

RTL_PLATFORMS = [Platform.P2]
RTL_PLATFORMS = [Platform.P2, Platform.TRACKERM]
RTL_MBR_OFFSET = 0x08000000
RTL_KM0_PART1_OFFSET = 0x08014000

Expand Down
3 changes: 2 additions & 1 deletion build/make_release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ function valid_platform()
# Validate platform (result of expression returned to caller)
[ "$platform" = "all" ] || [ "$platform" = "argon" ] || [ "$platform" = "asom" ] || \
[ "$platform" = "boron" ] || [ "$platform" = "bsom" ] || [ "$platform" = "b5som" ] || \
[ "$platform" = "esomx" ] || [ "$platform" = "tracker" ] || [ "$platform" = "p2" ]
[ "$platform" = "esomx" ] || [ "$platform" = "tracker" ] || [ "$platform" = "p2" ] || [ "$platform" = "trackerm" ]
}

if !(valid_platform $PLATFORM); then
Expand All @@ -155,6 +155,7 @@ if [ $PLATFORM = "all" ]; then
release_platform "tracker"
release_platform "esomx"
release_platform "p2"
release_platform "trackerm"
else
release_platform "$PLATFORM"
fi
Expand Down
2 changes: 1 addition & 1 deletion build/module.mk
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ exe: $(TARGET_BASE)$(EXECUTABLE_EXTENSION)
none:
;

ifeq ("$(PLATFORM)","p2")
ifeq ($(PLATFORM_MCU),rtl872x)
.PHONY: rtl-flash
rtl_module_start_address = $(subst 0x08,0x00,$(call get_module_start_address))
rtl-flash:
Expand Down
32 changes: 30 additions & 2 deletions build/platform-id.mk
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@ ifeq ("$(PLATFORM)","tracker")
PLATFORM_ID=26
endif

ifeq ("$(PLATFORM)","trackerm")
PLATFORM_ID=28
endif

ifeq ("$(PLATFORM)","p2")
PLATFORM_ID=32
endif
Expand Down Expand Up @@ -214,6 +218,32 @@ PLATFORM_THREADING=1
PLATFORM_OPENTHREAD=nrf52840
endif

ifeq ("$(PLATFORM_ID)","28")
PLATFORM=trackerm
PLATFORM_NAME=trackerm
PLATFORM_GEN=3
PLATFORM_MCU=rtl872x
PLATFORM_NET=rtl872x
PLATFORM_WIZNET=W5500
PRODUCT_DESC=Production TrackerM
USBD_VID_PARTICLE=0x2B04
USBD_PID_DFU=0xD01C
USBD_PID_CDC=0xC01C
DEFAULT_PRODUCT_ID=$(PLATFORM_ID)
PLATFORM_DYNALIB_MODULES=trackerm
PLATFORM_PREBOOTLOADER=1
ifneq ("$(PLATFORM_MCU_CORE)","")
ARM_CPU=cortex-$(PLATFORM_MCU_CORE)
MCU_DEVICE=rtl872x_$(PLATFORM_MCU_CORE)
else
ARM_CPU=cortex-m33
MCU_DEVICE=rtl872x
endif
PLATFORM_THREADING=1
MODULE_SUFFIX_PRODUCT_DATA_OFFSET_FROM_END=42
BOOTLOADER_USE_LTO=n
endif

ifeq ("$(PLATFORM_ID)","32")
PLATFORM=p2
PLATFORM_NAME=tron
Expand Down Expand Up @@ -268,8 +298,6 @@ ifeq ("$(MCU_DEVICE)","rtl872x")
PLATFORM_THREADING=1
endif



ifeq ("$(PLATFORM_MCU)","")
$(error PLATFORM_MCU not defined. Check platform id $(PLATFORM_ID))
endif
Expand Down
2 changes: 1 addition & 1 deletion build/release-publish.sh
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ function valid_platform()
# Validate platform (result of expression returned to caller)
[ "$platform" = "argon" ] || [ "$platform" = "asom" ] || [ "$platform" = "boron" ] || \
[ "$platform" = "bsom" ] || [ "$platform" = "b5som" ] || [ "$platform" = "tracker" ] || \
[ "$platform" = "esomx" ] || [ "$platform" = "p2" ]
[ "$platform" = "esomx" ] || [ "$platform" = "p2" ] || [ "$platform" = "trackerm" ]
}

# Identify the absolute directory
Expand Down
5 changes: 4 additions & 1 deletion build/release-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ function valid_platform ()
# Validate platform (result of expression returned to caller)
[ "$platform" = "argon" ] || [ "$platform" = "asom" ] || [ "$platform" = "boron" ] || \
[ "$platform" = "bsom" ] || [ "$platform" = "b5som" ] || [ "$platform" = "tracker" ] || \
[ "$platform" = "esomx" ] || [ "$platform" = "p2" ]
[ "$platform" = "esomx" ] || [ "$platform" = "p2" ] || [ "$platform" = "trackerm" ]
}

# Handle invalid arguments
Expand Down Expand Up @@ -153,6 +153,9 @@ case "$PLATFORM" in
"tracker")
PLATFORM_ID="26"
;;
"trackerm")
PLATFORM_ID="28"
;;
"p2")
PLATFORM_ID="32"
;;
Expand Down
10 changes: 9 additions & 1 deletion build/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,10 @@ elif [ ! -z $PLATFORM ]; then
PLATFORM_ID="26"
GEN3=true
;;
"trackerm")
PLATFORM_ID="28"
GEN3=true
;;
"p2")
PLATFORM_ID="32"
GEN3=true
Expand Down Expand Up @@ -277,6 +281,10 @@ else
PLATFORM="tracker"
GEN3=true
;;
28)
PLATFORM="trackerm"
GEN3=true
;;
32)
PLATFORM="p2"
GEN3=true
Expand Down Expand Up @@ -321,7 +329,7 @@ rm -rf $ABSOLUTE_TARGET_DIRECTORY/
#########################

# GEN3
if [ $PLATFORM_ID -eq 12 ] || [ $PLATFORM_ID -eq 13 ] || [ $PLATFORM_ID -eq 15 ] || [ $PLATFORM_ID -eq 22 ] || [ $PLATFORM_ID -eq 23 ] || [ $PLATFORM_ID -eq 25 ] || [ $PLATFORM_ID -eq 26 ] || [ $PLATFORM_ID -eq 32 ]; then
if [ $PLATFORM_ID -eq 12 ] || [ $PLATFORM_ID -eq 13 ] || [ $PLATFORM_ID -eq 15 ] || [ $PLATFORM_ID -eq 22 ] || [ $PLATFORM_ID -eq 23 ] || [ $PLATFORM_ID -eq 25 ] || [ $PLATFORM_ID -eq 26 ] || [ $PLATFORM_ID -eq 28 ] || [ $PLATFORM_ID -eq 32 ]; then
# Configure
if [ $DEBUG = true ]; then
cd ../main
Expand Down
2 changes: 1 addition & 1 deletion ci/cf_generate_message.sh
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ EOF
)

fields=""
for p in Argon Boron BSoM B5SoM Tracker ESomX P2 GCC Newhal P2; do
for p in Argon Boron BSoM B5SoM Tracker TrackerM ESomX P2 GCC Newhal P2; do
if echo -e "${failures}" | grep -q "PLATFORM=\"${p,,}\""; then
msg=":scrum_closed: $p\\n"
else
Expand Down
6 changes: 3 additions & 3 deletions ci/enumerate_build_matrix.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ MAKE=runmake
# define build matrix dimensions
# "" means execute execute the $MAKE command without that var specified
DEBUG_BUILD=( y n )
PLATFORM=( argon boron asom bsom b5som esomx p2 )
PLATFORM=( argon boron asom bsom b5som esomx p2 trackerm )
# All modules are now built by reease scripts instead, skip
# Only building applications and tests here
# PLATFORM_BOOTLOADER=( argon boron asom bsom b5som tracker esomx p2 )
Expand All @@ -57,7 +57,7 @@ PLATFORM_PREBOOTLOADER=()
APP=( "" product_id_and_version )
TEST=( wiring/api )

MODULAR_PLATFORM=( argon boron asom bsom b5som tracker esomx p2 )
MODULAR_PLATFORM=( argon boron asom bsom b5som tracker esomx p2 trackerm )

filterPlatform PLATFORM
filterPlatform MODULAR_PLATFORM
Expand Down Expand Up @@ -159,7 +159,7 @@ do
do
# Gen 3 overflows with modular DEBUG_BUILD=y, so skip those
if [[ "$db" = "y" ]]; then
if [[ "$p" = "argon" ]] || [[ "$p" = "boron" ]] || [[ "$p" = "asom" ]] || [[ "$p" = "bsom" ]] || [[ "$p" = "b5som" ]] || [[ "$p" = "tracker" ]] || [[ "$p" = "esomx" ]] || [[ "$p" = "p2" ]]; then
if [[ "$p" = "argon" ]] || [[ "$p" = "boron" ]] || [[ "$p" = "asom" ]] || [[ "$p" = "bsom" ]] || [[ "$p" = "b5som" ]] || [[ "$p" = "tracker" ]] || [[ "$p" = "esomx" ]] || [[ "$p" = "p2" ]] || [[ "$p" = "trackerm" ]]; then
continue
fi
fi
Expand Down
2 changes: 1 addition & 1 deletion dynalib/inc/dynalib.h
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ constexpr T2* dynalib_checked_cast(T2 *p) {
#define __S(x) #x
#define __SX(x) __S(x)

#if PLATFORM_ID == 32
#if PLATFORM_ID == 32 || PLATFORM_ID == 28
#define DYNALIB_FN_IMPORT(index, tablename, name, counter) \
DYNALIB_STATIC_ASSERT(index == counter, "Index of the dynamically exported function has changed"); \
const char check_name_##tablename_##name[0]={}; /* this will fail if the name is already defined */ \
Expand Down
2 changes: 1 addition & 1 deletion dynalib/inc/module_info.inc
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ extern "C" {

extern char link_module_start;
extern char link_module_end;
#if PLATFORM_ID == 32
#if HAL_PLATFORM_RTL872X
extern uintptr_t link_dynalib_start;
extern uintptr_t link_dynalib_flash_start;
#endif
Expand Down
6 changes: 6 additions & 0 deletions hal/inc/hal_platform.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,17 @@
#define HAL_PLATFORM_WIFI_NCP_SDIO (0)
#endif // HAL_PLATFORM_WIFI_NCP_SDIO

#ifndef HAL_PLATFORM_ESP32_NCP
#define HAL_PLATFORM_ESP32_NCP (0)
#endif // HAL_PLATFORM_ESP32_NCP

#if HAL_PLATFORM_ESP32_NCP
#if HAL_PLATFORM_WIFI && HAL_PLATFORM_NCP_AT && !HAL_PLATFORM_WIFI_NCP_SDIO
# ifndef HAL_PLATFORM_WIFI_SERIAL
# error "HAL_PLATFORM_WIFI_SERIAL is not defined"
# endif /* HAL_PLATFORM_WIFI_SERIAL */
#endif /* HAL_PLATFORM_WIFI */
#endif /* HAL_PLATFORM_ESP32_NCP */

#ifndef HAL_PLATFORM_CELLULAR
#define HAL_PLATFORM_CELLULAR 0
Expand Down
29 changes: 29 additions & 0 deletions hal/src/tracker/demux.cpp → hal/shared/demux.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@
#if HAL_PLATFORM_DEMUX

#include "check.h"
#if HAL_PLATFORM_RTL872X
#include "gpio_hal.h"
#endif
#include "system_error.h"

using namespace particle;
Expand All @@ -38,17 +41,33 @@ int Demux::write(uint8_t pin, uint8_t value) {
DemuxLock lock();
CHECK_TRUE(pin < DEMUX_MAX_PIN_COUNT && pin != 0, SYSTEM_ERROR_INVALID_ARGUMENT); // Y0 is not available for user's usage.
CHECK_TRUE(initialized_, SYSTEM_ERROR_INVALID_STATE);
#if HAL_PLATFORM_NRF52840
// We can do it in this way for now, since the control pins are continuous.
uint32_t currOut = (nrf_gpio_port_out_read(DEMUX_NRF_PORT) >> DEMUX_PINS_SHIFT) & 0x00000007;
if ((currOut == pin && value == 0) || (currOut != pin && value == 1)) {
return SYSTEM_ERROR_NONE;
}
#endif

if (value) {
#if HAL_PLATFORM_NRF52840
// Select Y0 by default, so that all other pins output high.
nrf_gpio_port_out_clear(DEMUX_NRF_PORT, DEMUX_PIN_2_MASK | DEMUX_PIN_1_MASK | DEMUX_PIN_0_MASK);
#elif HAL_PLATFORM_RTL872X
// Select Y0 by default, so that all other pins output high.
hal_gpio_write(DEMUX_C, 0);
hal_gpio_write(DEMUX_B, 0);
hal_gpio_write(DEMUX_A, 0);
#endif
setPinValue(0, 0);
} else {
#if HAL_PLATFORM_NRF52840
nrf_gpio_port_out_set(DEMUX_NRF_PORT, ((uint32_t)pin) << DEMUX_PINS_SHIFT);
#elif HAL_PLATFORM_RTL872X
hal_gpio_write(DEMUX_C, (pin & DEMUX_PIN_2_MASK) ? 1 : 0);
hal_gpio_write(DEMUX_B, (pin & DEMUX_PIN_1_MASK) ? 1 : 0);
hal_gpio_write(DEMUX_A, (pin & DEMUX_PIN_0_MASK) ? 1 : 0);
#endif
setPinValue(pin, 0);
}
return SYSTEM_ERROR_NONE;
Expand All @@ -72,9 +91,19 @@ int Demux::unlock() {
}

void Demux::init() {
#if HAL_PLATFORM_NRF52840
nrf_gpio_port_dir_output_set(DEMUX_NRF_PORT, DEMUX_PIN_0_MASK | DEMUX_PIN_1_MASK | DEMUX_PIN_2_MASK);
// Select Y0 by default.
nrf_gpio_port_out_clear(DEMUX_NRF_PORT, DEMUX_PIN_0_MASK | DEMUX_PIN_1_MASK | DEMUX_PIN_2_MASK);
#elif HAL_PLATFORM_RTL872X
hal_gpio_mode(DEMUX_A, OUTPUT);
hal_gpio_mode(DEMUX_B, OUTPUT);
hal_gpio_mode(DEMUX_C, OUTPUT);
// Select Y0 by default.
hal_gpio_write(DEMUX_C, 0);
hal_gpio_write(DEMUX_B, 0);
hal_gpio_write(DEMUX_A, 0);
#endif
initialized_ = true;
}

Expand Down
Loading