mirror of
https://github.com/tinygo-org/drivers.git
synced 2026-08-18 21:53:56 +00:00
sx126x: correct RX/TX pin mapping for TheThingsIndustries GNSE board
Signed-off-by: deadprogram <ron@hybridgroup.com>
This commit is contained in:
+12
-12
@@ -26,9 +26,9 @@ func NewRadioControl() *RadioControl {
|
|||||||
|
|
||||||
// Init pins needed for controlling rx/tx
|
// Init pins needed for controlling rx/tx
|
||||||
func (rc *RadioControl) Init() error {
|
func (rc *RadioControl) Init() error {
|
||||||
machine.RF_FE_CTRL1.Configure(machine.PinConfig{Mode: machine.PinOutput})
|
machine.PA0.Configure(machine.PinConfig{Mode: machine.PinOutput})
|
||||||
machine.RF_FE_CTRL2.Configure(machine.PinConfig{Mode: machine.PinOutput})
|
machine.PA1.Configure(machine.PinConfig{Mode: machine.PinOutput})
|
||||||
machine.RF_FE_CTRL3.Configure(machine.PinConfig{Mode: machine.PinOutput})
|
machine.PB8.Configure(machine.PinConfig{Mode: machine.PinOutput})
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
@@ -37,19 +37,19 @@ func (rc *RadioControl) SetRfSwitchMode(mode int) error {
|
|||||||
switch mode {
|
switch mode {
|
||||||
|
|
||||||
case RFSWITCH_TX_HP:
|
case RFSWITCH_TX_HP:
|
||||||
machine.RF_FE_CTRL1.Set(false)
|
machine.PA0.Set(false)
|
||||||
machine.RF_FE_CTRL2.Set(true)
|
machine.PA1.Set(true)
|
||||||
machine.RF_FE_CTRL3.Set(true)
|
machine.PB8.Set(true)
|
||||||
|
|
||||||
case RFSWITCH_TX_LP:
|
case RFSWITCH_TX_LP:
|
||||||
machine.RF_FE_CTRL1.Set(true)
|
machine.PA0.Set(true)
|
||||||
machine.RF_FE_CTRL2.Set(true)
|
machine.PA1.Set(true)
|
||||||
machine.RF_FE_CTRL3.Set(true)
|
machine.PB8.Set(true)
|
||||||
|
|
||||||
case RFSWITCH_RX:
|
case RFSWITCH_RX:
|
||||||
machine.RF_FE_CTRL1.Set(true)
|
machine.PA0.Set(true)
|
||||||
machine.RF_FE_CTRL2.Set(false)
|
machine.PA1.Set(false)
|
||||||
machine.RF_FE_CTRL3.Set(true)
|
machine.PB8.Set(true)
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
|
|||||||
Reference in New Issue
Block a user