# HG changeset patch # User Mychaela Falconia # Date 1495497933 0 # Node ID 4cd55371d3e46e256bc64bc2cdf2eb33b78b4b41 # Parent d6ef94518117a9ff6b039324aefc9ebfdfc81691 fc-rfcal-vcxo: upload and FFS save implemented diff -r d6ef94518117 -r 4cd55371d3e4 autocal/vcxomain.c --- a/autocal/vcxomain.c Mon May 22 23:50:32 2017 +0000 +++ b/autocal/vcxomain.c Tue May 23 00:05:33 2017 +0000 @@ -6,6 +6,7 @@ #include #include #include +#include #include #include #include "afcparams.h" @@ -121,7 +122,23 @@ printf("afcparams DAC_MAX*8: %d\n", afcparams_host.dac_max); printf("afcparams snr_thr: %d\n", afcparams_host.snr_thr); - /* conversion to LE and sending to L1 remain to be implemented */ + /* convert to LE for upload to the DUT */ + afcparams_arm.psi_sta_inv = htole32(afcparams_host.psi_sta_inv); + afcparams_arm.psi_st = htole32(afcparams_host.psi_st); + afcparams_arm.psi_st_32 = htole32(afcparams_host.psi_st_32); + afcparams_arm.psi_st_inv = htole32(afcparams_host.psi_st_inv); + afcparams_arm.dac_center = htole16(afcparams_host.dac_center); + afcparams_arm.dac_min = htole16(afcparams_host.dac_min); + afcparams_arm.dac_max = htole16(afcparams_host.dac_max); + afcparams_arm.snr_thr = htole16(afcparams_host.snr_thr); + + /* send them up */ + printf("Uploading afcparams and INITIAL_AFC_DAC to the DUT\n"); + do_rftw(AFC_PARAMS, &afcparams_arm, sizeof(struct afcparams)); + do_rfpw(INITIAL_AFC_DAC, dac_init_int); + printf("Saving rf-cal and rf-cfg in FFS\n"); + misc_enable(CFG_WRITE_RF_CAL); + misc_enable(CFG_WRITE_RF_CFG); exit(0); }