add readme and update rfswitch

This commit is contained in:
Tom 2025-01-30 20:35:12 +00:00 committed by Tom Fifield
parent d740934278
commit f67cee02a2
2 changed files with 53 additions and 6 deletions

View File

@ -0,0 +1,40 @@
## Notes
### General
The pinout is contained in the variant.h file, and a [generic schematic](./Schematic_Pro-Micro_Pinouts%202024-12-14.pdf) is located in this directory. Note that RXEN is not required if the selected module already has internal RF switching, or if external RF switching logic is already applied.
### LR1121 modules
The CDEbyte implementation of the LR1121 is contained in their E80 module. Naturally, CDEbyte have chosen to ignore the generic Semtech impelementation of the RF switching logic and have their own table, which is located at the bottom of the page [here](https://www.cdebyte.com/products/E80-900M2213S/2#Pin), and reproduced below for posterity:
| DIO5/RFSW0 | DIO6/RFSW1 | RF status |
| ---------- | ---------- | ----------------------------- |
| 0 | 0 | RX |
| 0 | 1 | TX (Sub-1GHz low power mode) |
| 1 | 0 | TX (Sub-1GHz high power mode) |
| 1 | 1 | TX2.4GHz |
If you want to use the Semtech default, the values are (taken from [here](https://github.com/Lora-net/SWSD006/blob/73f59215b0103de7011056105011c5f5cc47f1e8/lib/app_subGHz_config_lr11xx.c#L145C1-L154C4)):
<details>
```
.rfswitch = {
.enable = LR11XX_SYSTEM_RFSW0_HIGH | LR11XX_SYSTEM_RFSW1_HIGH | LR11XX_SYSTEM_RFSW2_HIGH,
.standby = 0,
.rx = LR11XX_SYSTEM_RFSW0_HIGH,
.tx = LR11XX_SYSTEM_RFSW0_HIGH | LR11XX_SYSTEM_RFSW1_HIGH,
.tx_hp = LR11XX_SYSTEM_RFSW1_HIGH,
.tx_hf = 0,
.gnss = LR11XX_SYSTEM_RFSW2_HIGH,
.wifi = 0,
},
```
</details>
| DIO5/RFSW0 | DIO6/RFSW1 | RF status |
| ---------- | ---------- | ----------------------------- |
| 1 | 0 | RX |
| 1 | 1 | TX (Sub-1GHz low power mode) |
| 0 | 1 | TX (Sub-1GHz high power mode) |
| 0 | 0 | TX2.4GHz |

View File

@ -1,17 +1,24 @@
#include "RadioLib.h"
// This is rewritten to match the requirements of the E80-900M2213S
// The E80 does not conform to the reference Semtech switches(!) and therefore needs a custom matrix.
// See footnote #3 in "https://www.cdebyte.com/products/E80-900M2213S/2#Pin"
// RF Switch Matrix SubG RFO_HP_LF / RFO_LP_LF / RFI_[NP]_LF0
// DIO5 -> RFSW0_V1
// DIO6 -> RFSW1_V2
// DIO7 -> ANT_CTRL_ON + ESP_IO9/LR_GPS_ANT_DC_EN -> RFI_GPS (Bias-T GPS) (LR11x0 only)
// DIO7 -> not connected on E80 module - note that GNSS and Wifi scanning are not possible.
static const uint32_t rfswitch_dio_pins[] = {RADIOLIB_LR11X0_DIO5, RADIOLIB_LR11X0_DIO6, RADIOLIB_LR11X0_DIO7, RADIOLIB_NC,
RADIOLIB_NC};
static const Module::RfSwitchMode_t rfswitch_table[] = {
// mode DIO5 DIO6 DIO7
{LR11x0::MODE_STBY, {LOW, LOW, LOW}}, {LR11x0::MODE_RX, {HIGH, LOW, LOW}},
{LR11x0::MODE_TX, {LOW, HIGH, LOW}}, {LR11x0::MODE_TX_HP, {LOW, HIGH, LOW}},
{LR11x0::MODE_TX_HF, {LOW, LOW, LOW}}, {LR11x0::MODE_GNSS, {LOW, LOW, HIGH}},
{LR11x0::MODE_WIFI, {LOW, LOW, LOW}}, END_OF_MODE_TABLE,
};
{LR11x0::MODE_STBY, {LOW, LOW, LOW}},
{LR11x0::MODE_RX, {LOW, LOW, LOW}},
{LR11x0::MODE_TX, {LOW, HIGH, LOW}},
{LR11x0::MODE_TX_HP, {HIGH, LOW, LOW}},
{LR11x0::MODE_TX_HF, {HIGH, HIGH, LOW}},
{LR11x0::MODE_GNSS, {LOW, LOW, HIGH}},
{LR11x0::MODE_WIFI, {LOW, LOW, LOW}},
END_OF_MODE_TABLE,
};