Updated board definitions

This commit is contained in:
Mark Qvist 2022-06-29 14:28:01 +02:00
parent 21b6348f1a
commit 51c45e43bd
3 changed files with 12 additions and 7 deletions

View File

@ -38,6 +38,7 @@
#define REG_FRF_MID 0x07
#define REG_FRF_LSB 0x08
#define REG_PA_CONFIG 0x09
#define REG_OCP 0x0b
#define REG_LNA 0x0c
#define REG_FIFO_ADDR_PTR 0x0d
#define REG_FIFO_TX_BASE_ADDR 0x0e
@ -63,6 +64,7 @@
#define REG_SYNC_WORD 0x39
#define REG_DIO_MAPPING_1 0x40
#define REG_VERSION 0x42
#define REG_PA_DAC 0x4d
// Modes
#define MODE_LONG_RANGE_MODE 0x80
@ -402,6 +404,7 @@ void LoRaClass::setTxPower(int level, int outputPin) {
level = 14;
}
writeRegister(REG_PA_DAC, 0x84);
writeRegister(REG_PA_CONFIG, 0x70 | level);
} else {
@ -412,6 +415,7 @@ void LoRaClass::setTxPower(int level, int outputPin) {
level = 17;
}
writeRegister(REG_PA_DAC, 0x84);
writeRegister(REG_PA_CONFIG, PA_BOOST | (level - 2));
}
}

1
ROM.h
View File

@ -23,6 +23,7 @@
#define MODEL_C9 0xC9
#define MODEL_E4 0xE4
#define MODEL_E9 0xE9
#define MODEL_FE 0xFE
#define MODEL_FF 0xFF
#define ADDR_PRODUCT 0x00

View File

@ -658,19 +658,19 @@ void setTXPower() {
if (model == MODEL_A8) LoRa.setTxPower(lora_txp, PA_OUTPUT_PA_BOOST_PIN);
if (model == MODEL_A9) LoRa.setTxPower(lora_txp, PA_OUTPUT_PA_BOOST_PIN);
if (model == MODEL_B3) LoRa.setTxPower(lora_txp, PA_OUTPUT_RFO_PIN);
if (model == MODEL_B4) LoRa.setTxPower(lora_txp, PA_OUTPUT_RFO_PIN);
if (model == MODEL_B3) LoRa.setTxPower(lora_txp, PA_OUTPUT_PA_BOOST_PIN);
if (model == MODEL_B4) LoRa.setTxPower(lora_txp, PA_OUTPUT_PA_BOOST_PIN);
if (model == MODEL_B8) LoRa.setTxPower(lora_txp, PA_OUTPUT_PA_BOOST_PIN);
if (model == MODEL_B9) LoRa.setTxPower(lora_txp, PA_OUTPUT_PA_BOOST_PIN);
if (model == MODEL_C4) LoRa.setTxPower(lora_txp, PA_OUTPUT_RFO_PIN);
if (model == MODEL_C4) LoRa.setTxPower(lora_txp, PA_OUTPUT_PA_BOOST_PIN);
if (model == MODEL_C9) LoRa.setTxPower(lora_txp, PA_OUTPUT_PA_BOOST_PIN);
if (model == MODEL_E4) LoRa.setTxPower(lora_txp, PA_OUTPUT_RFO_PIN);
if (model == MODEL_E4) LoRa.setTxPower(lora_txp, PA_OUTPUT_PA_BOOST_PIN);
if (model == MODEL_E9) LoRa.setTxPower(lora_txp, PA_OUTPUT_PA_BOOST_PIN);
if (model == MODEL_FE) LoRa.setTxPower(lora_txp, PA_OUTPUT_PA_BOOST_PIN);
if (model == MODEL_FF) LoRa.setTxPower(lora_txp, PA_OUTPUT_RFO_PIN);
}
}
@ -814,7 +814,7 @@ bool eeprom_model_valid() {
#elif BOARD_MODEL == BOARD_RNODE_NG_21
if (model == MODEL_A2 || model == MODEL_A7) {
#elif BOARD_MODEL == BOARD_HMBRW
if (model == MODEL_FF) {
if (model == MODEL_FF || model == MODEL_FE) {
#elif BOARD_MODEL == BOARD_TBEAM
if (model == MODEL_E4 || model == MODEL_E9) {
#elif BOARD_MODEL == BOARD_LORA32_V2_0
@ -826,7 +826,7 @@ bool eeprom_model_valid() {
#elif BOARD_MODEL == BOARD_HUZZAH32
if (model == MODEL_FF) {
#elif BOARD_MODEL == BOARD_GENERIC_ESP32
if (model == MODEL_FF) {
if (model == MODEL_FF || model == MODEL_FE) {
#else
if (false) {
#endif