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/include | |
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/include')
-rw-r--r-- | src/target/firmware/include/rf/trf6151.h | 12 | ||||
-rw-r--r-- | src/target/firmware/include/rffe.h | 4 |
2 files changed, 12 insertions, 4 deletions
diff --git a/src/target/firmware/include/rf/trf6151.h b/src/target/firmware/include/rf/trf6151.h index 73ff8c09..f0891b6b 100644 --- a/src/target/firmware/include/rf/trf6151.h +++ b/src/target/firmware/include/rf/trf6151.h @@ -9,10 +9,16 @@ void trf6151_init(uint8_t tsp_uid, uint16_t tsp_reset_id); /* switch power off or on */ void trf6151_power(int on); -/* set the VGA and RF gain */ -int trf6151_set_gain(uint8_t dbm, int high); - /* obtain the current total gain of the TRF6151 */ +uint8_t trf6151_get_gain_reg(void); + +/* put current set (or computed) gain to register */ +int trf6151_set_gain_reg(uint8_t dbm, int high); + +/* set the global gain to use */ +int trf6151_set_gain(uint8_t dbm); + +/* obtain the global gain set */ uint8_t trf6151_get_gain(void); /* Request the PLL to be tuned to the given frequency */ diff --git a/src/target/firmware/include/rffe.h b/src/target/firmware/include/rffe.h index c28c696f..63a3a4b5 100644 --- a/src/target/firmware/include/rffe.h +++ b/src/target/firmware/include/rffe.h @@ -28,6 +28,8 @@ uint32_t rffe_get_tx_ports(void); /* get current gain of RF frontend (anything between antenna and baseband in dBm */ uint8_t rffe_get_gain(void); -void rffe_set_gain(int16_t exp_inp, int16_t target_bb); +void rffe_set_gain(uint8_t dbm); + +void rffe_compute_gain(int16_t exp_inp, int16_t target_bb); #endif |