mirror of
https://github.com/meshtastic/firmware.git
synced 2025-09-06 03:29:17 +00:00
Add RF switch settings for STM32WL variants (#7813)
* Add RF switch settings for STM32WL variants * Shuffle ifdefs in STM32WLE5JCInterface to make it not get built by other targets
This commit is contained in:
parent
289f90bdbe
commit
5b63bd9331
@ -1,13 +1,13 @@
|
|||||||
#include "STM32WLE5JCInterface.h"
|
|
||||||
#include "configuration.h"
|
#include "configuration.h"
|
||||||
|
|
||||||
|
#ifdef ARCH_STM32WL
|
||||||
|
#include "STM32WLE5JCInterface.h"
|
||||||
#include "error.h"
|
#include "error.h"
|
||||||
|
|
||||||
#ifndef STM32WLx_MAX_POWER
|
#ifndef STM32WLx_MAX_POWER
|
||||||
#define STM32WLx_MAX_POWER 22
|
#define STM32WLx_MAX_POWER 22
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef ARCH_STM32WL
|
|
||||||
|
|
||||||
STM32WLE5JCInterface::STM32WLE5JCInterface(LockingArduinoHal *hal, RADIOLIB_PIN_TYPE cs, RADIOLIB_PIN_TYPE irq,
|
STM32WLE5JCInterface::STM32WLE5JCInterface(LockingArduinoHal *hal, RADIOLIB_PIN_TYPE cs, RADIOLIB_PIN_TYPE irq,
|
||||||
RADIOLIB_PIN_TYPE rst, RADIOLIB_PIN_TYPE busy)
|
RADIOLIB_PIN_TYPE rst, RADIOLIB_PIN_TYPE busy)
|
||||||
: SX126xInterface(hal, cs, irq, rst, busy)
|
: SX126xInterface(hal, cs, irq, rst, busy)
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "SX126xInterface.h"
|
|
||||||
|
|
||||||
#ifdef ARCH_STM32WL
|
#ifdef ARCH_STM32WL
|
||||||
|
#include "SX126xInterface.h"
|
||||||
|
#include "rfswitch.h"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Our adapter for STM32WLE5JC radios
|
* Our adapter for STM32WLE5JC radios
|
||||||
@ -16,13 +16,4 @@ class STM32WLE5JCInterface : public SX126xInterface<STM32WLx>
|
|||||||
virtual bool init() override;
|
virtual bool init() override;
|
||||||
};
|
};
|
||||||
|
|
||||||
/* https://wiki.seeedstudio.com/LoRa-E5_STM32WLE5JC_Module/
|
|
||||||
* Wio-E5 module ONLY transmits through RFO_HP
|
|
||||||
* Receive: PA4=1, PA5=0
|
|
||||||
* Transmit(high output power, SMPS mode): PA4=0, PA5=1 */
|
|
||||||
static const RADIOLIB_PIN_TYPE rfswitch_pins[5] = {PA4, PA5, RADIOLIB_NC, RADIOLIB_NC, RADIOLIB_NC};
|
|
||||||
|
|
||||||
static const Module::RfSwitchMode_t rfswitch_table[4] = {
|
|
||||||
{STM32WLx::MODE_IDLE, {LOW, LOW}}, {STM32WLx::MODE_RX, {HIGH, LOW}}, {STM32WLx::MODE_TX_HP, {LOW, HIGH}}, END_OF_MODE_TABLE};
|
|
||||||
|
|
||||||
#endif // ARCH_STM32WL
|
#endif // ARCH_STM32WL
|
@ -12,7 +12,5 @@ build_flags =
|
|||||||
-DMESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR=1
|
-DMESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR=1
|
||||||
-DMESHTASTIC_EXCLUDE_I2C=1
|
-DMESHTASTIC_EXCLUDE_I2C=1
|
||||||
-DMESHTASTIC_EXCLUDE_GPS=1
|
-DMESHTASTIC_EXCLUDE_GPS=1
|
||||||
;-DPIO_FRAMEWORK_ARDUINO_NANOLIB_FLOAT_PRINTF
|
|
||||||
;-DCFG_DEBUG
|
|
||||||
|
|
||||||
upload_port = stlink
|
upload_port = stlink
|
9
variants/stm32/CDEBYTE_E77-MBL/rfswitch.h
Normal file
9
variants/stm32/CDEBYTE_E77-MBL/rfswitch.h
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
// From E77-900M22S Product Specification
|
||||||
|
// https://www.cdebyte.com/pdf-down.aspx?id=2963
|
||||||
|
// Note 1: PA6 and PA7 pins are used as internal control RF switches of the module, PA6 = RF_TXEN, PA7 = RF_RXEN, RF_TXEN=1
|
||||||
|
// RF_RXEN=0 is the transmit channel, and RF_TXEN=0 RF_RXEN=1 is the receiving channel
|
||||||
|
|
||||||
|
static const RADIOLIB_PIN_TYPE rfswitch_pins[5] = {PA7, PA6, RADIOLIB_NC, RADIOLIB_NC, RADIOLIB_NC};
|
||||||
|
|
||||||
|
static const Module::RfSwitchMode_t rfswitch_table[4] = {
|
||||||
|
{STM32WLx::MODE_IDLE, {LOW, LOW}}, {STM32WLx::MODE_RX, {HIGH, LOW}}, {STM32WLx::MODE_TX_HP, {LOW, HIGH}}, END_OF_MODE_TABLE};
|
@ -18,5 +18,4 @@ Do not expect a working Meshtastic device with this target.
|
|||||||
#define LED_PIN PB4 // LED1
|
#define LED_PIN PB4 // LED1
|
||||||
// #define LED_PIN PB3 // LED2
|
// #define LED_PIN PB3 // LED2
|
||||||
#define LED_STATE_ON 1
|
#define LED_STATE_ON 1
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -15,5 +15,5 @@ build_flags =
|
|||||||
-DMESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR=1
|
-DMESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR=1
|
||||||
-DMESHTASTIC_EXCLUDE_I2C=1
|
-DMESHTASTIC_EXCLUDE_I2C=1
|
||||||
-DMESHTASTIC_EXCLUDE_GPS=1
|
-DMESHTASTIC_EXCLUDE_GPS=1
|
||||||
;-DCFG_DEBUG
|
|
||||||
upload_port = stlink
|
upload_port = stlink
|
||||||
|
7
variants/stm32/rak3172/rfswitch.h
Normal file
7
variants/stm32/rak3172/rfswitch.h
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
// Pins from https://forum.rakwireless.com/t/rak3172-internal-schematic/4557/2
|
||||||
|
// PB8, PC13
|
||||||
|
|
||||||
|
static const RADIOLIB_PIN_TYPE rfswitch_pins[5] = {PB8, PC13, RADIOLIB_NC, RADIOLIB_NC, RADIOLIB_NC};
|
||||||
|
|
||||||
|
static const Module::RfSwitchMode_t rfswitch_table[4] = {
|
||||||
|
{STM32WLx::MODE_IDLE, {LOW, LOW}}, {STM32WLx::MODE_RX, {HIGH, LOW}}, {STM32WLx::MODE_TX_HP, {LOW, HIGH}}, END_OF_MODE_TABLE};
|
8
variants/stm32/wio-e5/rfswitch.h
Normal file
8
variants/stm32/wio-e5/rfswitch.h
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
/* https://wiki.seeedstudio.com/LoRa-E5_STM32WLE5JC_Module/
|
||||||
|
* Wio-E5 module ONLY transmits through RFO_HP
|
||||||
|
* Receive: PA4=1, PA5=0
|
||||||
|
* Transmit(high output power, SMPS mode): PA4=0, PA5=1 */
|
||||||
|
static const RADIOLIB_PIN_TYPE rfswitch_pins[5] = {PA4, PA5, RADIOLIB_NC, RADIOLIB_NC, RADIOLIB_NC};
|
||||||
|
|
||||||
|
static const Module::RfSwitchMode_t rfswitch_table[4] = {
|
||||||
|
{STM32WLx::MODE_IDLE, {LOW, LOW}}, {STM32WLx::MODE_RX, {HIGH, LOW}}, {STM32WLx::MODE_TX_HP, {LOW, HIGH}}, END_OF_MODE_TABLE};
|
Loading…
Reference in New Issue
Block a user