mirror of
https://github.com/liberatedsystems/RNode_Firmware_CE.git
synced 2024-07-02 14:34:13 +02:00
Added TCXO control functions
This commit is contained in:
parent
a29cfc6658
commit
1770557d09
2
Config.h
2
Config.h
@ -87,6 +87,7 @@
|
||||
|
||||
#define HAS_DISPLAY false
|
||||
#define HAS_BLUETOOTH false
|
||||
#define HAS_TCXO false
|
||||
#define HAS_PMU false
|
||||
#define HAS_NP false
|
||||
|
||||
@ -147,6 +148,7 @@
|
||||
const int pin_led_tx = 4;
|
||||
#define HAS_DISPLAY true
|
||||
#define HAS_PMU true
|
||||
#define HAS_TCXO true
|
||||
#define HAS_BLUETOOTH true
|
||||
#define HAS_CONSOLE true
|
||||
#define HAS_SD false
|
||||
|
11
LoRa.cpp
11
LoRa.cpp
@ -67,6 +67,7 @@
|
||||
#define REG_HIGH_BW_OPTIMIZE_2 0x3a
|
||||
#define REG_DIO_MAPPING_1 0x40
|
||||
#define REG_VERSION 0x42
|
||||
#define REG_TCXO 0x4b
|
||||
#define REG_PA_DAC 0x4d
|
||||
|
||||
// Modes
|
||||
@ -424,6 +425,16 @@ void LoRaClass::sleep()
|
||||
writeRegister(REG_OP_MODE, MODE_LONG_RANGE_MODE | MODE_SLEEP);
|
||||
}
|
||||
|
||||
void LoRaClass::enableTCXO() {
|
||||
uint8_t tcxo_reg = readRegister(REG_TCXO);
|
||||
writeRegister(REG_TCXO, tcxo_reg | 0x10);
|
||||
}
|
||||
|
||||
void LoRaClass::disableTCXO() {
|
||||
uint8_t tcxo_reg = readRegister(REG_TCXO);
|
||||
writeRegister(REG_TCXO, tcxo_reg & 0xEF);
|
||||
}
|
||||
|
||||
void LoRaClass::setTxPower(int level, int outputPin) {
|
||||
if (PA_OUTPUT_RFO_PIN == outputPin) {
|
||||
// RFO
|
||||
|
Loading…
Reference in New Issue
Block a user