Added TCXO control functions
This commit is contained in:
		
							
								
								
									
										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
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user