PacSat - PacSat/deviceSupport/src/ax5043-ax25.c //printf("INFO: PLL ranging process complete\n"); axradio_trxstate = trxstate_off; axradio_phy_chanpllrng[0] = ax5043ReadReg(device, AX5043_PLLRANGINGA); #if 0 // VCOI Calibration if (axradio_phy_vcocalib) { ax5043_set_registers_tx(); ax5043WriteReg(device, AX5043_MODULATION, 0x08); ax5043WriteReg(device, AX5043_FSKDEV2, 0x00); ax5043WriteReg(device, AX5043_FSKDEV1, 0x00); ax5043WriteReg(device, AX5043_FSKDEV0, 0x00); regValue = ax5043ReadReg(device, AX5043_PLLLOOP); regValue |= 0x04; ax5043WriteReg(device, AX5043_PLLLOOP, regValue); { uint8_t x = ax5043ReadReg(device, AX5043_0xF35); x |= 0x80; if (2 & (uint8_t)~x) ++x; ax5043WriteReg(device, AX5043_0xF35, x); } ax5043WriteReg(device, AX5043_PWRMODE, AX5043_PWRSTATE_SYNTH_TX); { uint8_t vcoisave = ax5043ReadReg(device, AX5043_PLLVCOI); uint8_t j = 2; axradio_phy_chanvcoi[0] = 0; ax5043WriteReg(device, AX5043_PLLRANGINGA, axradio_phy_chanpllrng[0] & 0x0F); { uint32_t f = axradio_phy_chanfreq[0]; ax5043WriteReg(device, AX5043_FREQA0, f); ax5043WriteReg(device, AX5043_FREQA1, f >> 8); ax5043WriteReg(device, AX5043_FREQA2, f >> 16); ax5043WriteReg(device, AX5043_FREQA3, f >> 24); } do { if (axradio_phy_chanvcoiinit[0]) { uint8_t x = axradio_phy_chanvcoiinit[0]; if (!(axradio_phy_chanpllrnginit[0] & 0xF0)) x += (axradio_phy_chanpllrng[0] & 0x0F) - (axradio_phy_chanpllrnginit[0] & 0x0F); axradio_phy_chanvcoi[0] = axradio_adjustvcoi(x); } else { axradio_phy_chanvcoi[0] = axradio_calvcoi(); } } while (--j); j = 1; ax5043WriteReg(device, AX5043_PLLVCOI, vcoisave); } } #endif