summaryrefslogtreecommitdiffstats
path: root/src/target/firmware/include/rf/trf6151.h
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2010-06-25 13:38:22 +0200
committerHarald Welte <laforge@gnumonks.org>2010-06-25 13:39:58 +0200
commit028dcd9e2543c4f91667c393813de24ae4e90cb8 (patch)
tree367dbd8b198aa8bccc05cc458c6e62f271f4ebba /src/target/firmware/include/rf/trf6151.h
parent52ef5a78eea9e54eb572ac5e1713a304a90e1f9a (diff)
[layer1] An actual AGC implementation
We introduce trf6151_compute_gain() to compute the gain setting that leads to the ideal analog baseband power input level. This function is called from rffe_set_gain() for both the compal and the gta0x rf frontend, as there are no other amplifiers inside those phone designs. The new AGC function is not used yet from the regular layer1 code.
Diffstat (limited to 'src/target/firmware/include/rf/trf6151.h')
-rw-r--r--src/target/firmware/include/rf/trf6151.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/target/firmware/include/rf/trf6151.h b/src/target/firmware/include/rf/trf6151.h
index 889baaa7..f1b54f2e 100644
--- a/src/target/firmware/include/rf/trf6151.h
+++ b/src/target/firmware/include/rf/trf6151.h
@@ -3,6 +3,13 @@
#include <osmocore/gsm_utils.h>
+/* minimum gain (FE = LOW, VGA at lowest setting */
+#define TRF6151_GAIN_MIN 14
+/* minimum gain (FE = HIGH, VGA at highest setting */
+#define TRF6151_GAIN_MAX 60
+/* Frontend gain if FE = HIGH */
+#define TRF6151_GAIN_FE 20
+
/* initialize (reset + power up) */
void trf6151_init(void);
@@ -35,4 +42,9 @@ void trf6151_rx_window(int16_t start_qbits, uint16_t arfcn, uint8_t vga_dbm, int
/* prepare a Tx window with the TRF6151 finished at time 'start' (in qbits) */
void trf6151_tx_window(int16_t start_qbits, uint16_t arfcn);
+
+/* Given the expected input level of exp_inp dBm/8 and the target of target_bb
+ * dBm8, configure the RF Frontend with the respective gain */
+void trf6151_compute_gain(int16_t exp_inp, int16_t target_bb);
+
#endif /* TRF6151_H */