Run image cal manually after configuring radio

This commit is contained in:
Jonathan Swoboda 2024-11-19 21:27:30 -05:00
parent 49f71e80be
commit b2d6cfba06
2 changed files with 17 additions and 0 deletions

View file

@ -205,6 +205,10 @@ void SX127x::configure() {
this->set_mode_standby();
delay(1);
// run image cal
this->write_register_(REG_IMAGE_CAL, AUTO_IMAGE_CAL_ON | IMAGE_CAL_START | TEMP_THRESHOLD_10C);
delay(10);
// enable rx mode
if (this->rx_start_) {
this->set_mode_rx();

View file

@ -45,6 +45,7 @@ enum SX127xReg : uint8_t {
REG_PACKET_CONFIG_2 = 0x31,
REG_PAYLOAD_LENGTH = 0x32,
REG_FIFO_THRESH = 0x35,
REG_IMAGE_CAL = 0x3B,
REG_DIO_MAPPING1 = 0x40,
REG_DIO_MAPPING2 = 0x41,
REG_VERSION = 0x42,
@ -80,6 +81,18 @@ enum SX127xSyncConfig : uint8_t {
SYNC_ON = 0x10,
};
enum SX127xImageCal : uint8_t {
AUTO_IMAGE_CAL_ON = 0x80,
IMAGE_CAL_START = 0x40,
IMAGE_CAL_RUNNING = 0x20,
TEMP_CHANGE = 0x08,
TEMP_THRESHOLD_20C = 0x06,
TEMP_THRESHOLD_15C = 0x04,
TEMP_THRESHOLD_10C = 0x02,
TEMP_THRESHOLD_5C = 0x00,
TEMP_MONITOR_OFF = 0x01,
};
enum SX127xOpMode : uint8_t {
MOD_FSK = 0x00,
MOD_OOK = 0x20,