From 462d2b33156826174f19fa4188919bcd2d0d2f04 Mon Sep 17 00:00:00 2001 From: deadprogram Date: Sat, 14 Jan 2023 21:51:20 +0100 Subject: [PATCH] sx126x: correct RX/TX pin mapping for TheThingsIndustries GNSE board Signed-off-by: deadprogram --- sx126x/radiocontrol_gnse.go | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/sx126x/radiocontrol_gnse.go b/sx126x/radiocontrol_gnse.go index e2a72ee..b7721a0 100644 --- a/sx126x/radiocontrol_gnse.go +++ b/sx126x/radiocontrol_gnse.go @@ -26,9 +26,9 @@ func NewRadioControl() *RadioControl { // Init pins needed for controlling rx/tx func (rc *RadioControl) Init() error { - machine.RF_FE_CTRL1.Configure(machine.PinConfig{Mode: machine.PinOutput}) - machine.RF_FE_CTRL2.Configure(machine.PinConfig{Mode: machine.PinOutput}) - machine.RF_FE_CTRL3.Configure(machine.PinConfig{Mode: machine.PinOutput}) + machine.PA0.Configure(machine.PinConfig{Mode: machine.PinOutput}) + machine.PA1.Configure(machine.PinConfig{Mode: machine.PinOutput}) + machine.PB8.Configure(machine.PinConfig{Mode: machine.PinOutput}) return nil } @@ -37,19 +37,19 @@ func (rc *RadioControl) SetRfSwitchMode(mode int) error { switch mode { case RFSWITCH_TX_HP: - machine.RF_FE_CTRL1.Set(false) - machine.RF_FE_CTRL2.Set(true) - machine.RF_FE_CTRL3.Set(true) + machine.PA0.Set(false) + machine.PA1.Set(true) + machine.PB8.Set(true) case RFSWITCH_TX_LP: - machine.RF_FE_CTRL1.Set(true) - machine.RF_FE_CTRL2.Set(true) - machine.RF_FE_CTRL3.Set(true) + machine.PA0.Set(true) + machine.PA1.Set(true) + machine.PB8.Set(true) case RFSWITCH_RX: - machine.RF_FE_CTRL1.Set(true) - machine.RF_FE_CTRL2.Set(false) - machine.RF_FE_CTRL3.Set(true) + machine.PA0.Set(true) + machine.PA1.Set(false) + machine.PB8.Set(true) } return nil