diff options
author | Andreas Eversberg <jolly@eversberg.eu> | 2011-07-17 09:27:35 +0200 |
---|---|---|
committer | Andreas Eversberg <jolly@eversberg.eu> | 2011-07-17 09:27:35 +0200 |
commit | 065b6e35a35e290450f3a7e2958c11cd4fd25131 (patch) | |
tree | 257b300e0c049714acc8af22342d9148ee673969 /src/target/firmware/layer1 | |
parent | e91dfa950e85d12cb35765670762906bbc6f0846 (diff) |
[rf] Adding rffe_set_gain() and rffe_get_gain() to get/set computed gain
rffe_compute_gain() is the new name for rffe_set_gain(). I needed to change
this, to solve the name collision with the rffe_set_gain() function, which
actually sets the absolute gain.
rffe_get_gain() will now read the absolute gain which has been computed by
rffe_compute_gain() or set by rffe_set_gain().
Diffstat (limited to 'src/target/firmware/layer1')
-rw-r--r-- | src/target/firmware/layer1/prim_fbsb.c | 2 | ||||
-rw-r--r-- | src/target/firmware/layer1/prim_pm.c | 3 | ||||
-rw-r--r-- | src/target/firmware/layer1/prim_rx_nb.c | 2 | ||||
-rw-r--r-- | src/target/firmware/layer1/prim_tch.c | 6 |
4 files changed, 8 insertions, 5 deletions
diff --git a/src/target/firmware/layer1/prim_fbsb.c b/src/target/firmware/layer1/prim_fbsb.c index 124a3162..53e30c82 100644 --- a/src/target/firmware/layer1/prim_fbsb.c +++ b/src/target/firmware/layer1/prim_fbsb.c @@ -373,7 +373,7 @@ static int l1s_fbdet_cmd(__unused uint8_t p1, __unused uint8_t p2, l1s.fb.mode = fb_mode; /* Tell the RF frontend to set the gain appropriately */ - rffe_set_gain(-85, CAL_DSP_TGT_BB_LVL); + rffe_compute_gain(-85, CAL_DSP_TGT_BB_LVL); /* Program DSP */ dsp_api.db_w->d_task_md = FB_DSP_TASK; /* maybe with I/Q swap? */ diff --git a/src/target/firmware/layer1/prim_pm.c b/src/target/firmware/layer1/prim_pm.c index 5d2f413c..e6a79553 100644 --- a/src/target/firmware/layer1/prim_pm.c +++ b/src/target/firmware/layer1/prim_pm.c @@ -46,6 +46,7 @@ #include <layer1/tpu_window.h> #include <layer1/l23_api.h> #include <layer1/prim.h> +#include <rffe.h> #include <l1ctl_proto.h> @@ -68,7 +69,7 @@ static int l1s_pm_cmd(uint8_t num_meas, dsp_api.ndb->d_fb_mode = 0; /* wideband search */ /* Tell the RF frontend to set the gain appropriately */ - rffe_set_gain(-85, CAL_DSP_TGT_BB_LVL); + rffe_compute_gain(-85, CAL_DSP_TGT_BB_LVL); /* Program TPU */ /* FIXME: RXWIN_PW needs to set up multiple times in case diff --git a/src/target/firmware/layer1/prim_rx_nb.c b/src/target/firmware/layer1/prim_rx_nb.c index ea902677..7eb45483 100644 --- a/src/target/firmware/layer1/prim_rx_nb.c +++ b/src/target/firmware/layer1/prim_rx_nb.c @@ -105,7 +105,7 @@ static int l1s_nb_resp(__unused uint8_t p1, uint8_t burst_id, uint16_t p3) toa_input(rxnb.meas[burst_id].toa_qbit << 2, rxnb.meas[burst_id].snr); /* Tell the RF frontend to set the gain appropriately */ - rffe_set_gain(rxnb.meas[burst_id].pm_dbm8/8, CAL_DSP_TGT_BB_LVL); + rffe_compute_gain(rxnb.meas[burst_id].pm_dbm8/8, CAL_DSP_TGT_BB_LVL); /* 4th burst, get frame data */ if (dsp_api.db_r->d_burst_d == 3) { diff --git a/src/target/firmware/layer1/prim_tch.c b/src/target/firmware/layer1/prim_tch.c index 013318d4..cb0da71c 100644 --- a/src/target/firmware/layer1/prim_tch.c +++ b/src/target/firmware/layer1/prim_tch.c @@ -178,7 +178,8 @@ static int l1s_tch_resp(__unused uint8_t p1, __unused uint8_t p2, uint16_t p3) toa_input(rx_tch.meas[meas_id].toa_qbit << 2, rx_tch.meas[meas_id].snr); /* Tell the RF frontend to set the gain appropriately */ - rffe_set_gain(rx_tch.meas[meas_id].pm_dbm8 / 8, CAL_DSP_TGT_BB_LVL); + rffe_compute_gain(rx_tch.meas[meas_id].pm_dbm8 / 8, + CAL_DSP_TGT_BB_LVL); /* FACCH Block end ? */ if (tch_f_hn) { @@ -510,7 +511,8 @@ static int l1s_tch_a_resp(__unused uint8_t p1, __unused uint8_t p2, uint16_t p3) toa_input(rx_tch_a.meas[burst_id].toa_qbit << 2, rx_tch_a.meas[burst_id].snr); /* Tell the RF frontend to set the gain appropriately */ - rffe_set_gain(rx_tch_a.meas[burst_id].pm_dbm8 / 8, CAL_DSP_TGT_BB_LVL); + rffe_compute_gain(rx_tch_a.meas[burst_id].pm_dbm8 / 8, + CAL_DSP_TGT_BB_LVL); /* Last burst, read data & send to the up layer */ if ((burst_id == 3) && (dsp_api.ndb->a_cd[0] & (1<<B_BLUD))) { |