trxcon/l1sched: clarify TDMA Fn (mod 26) maps
[osmocom-bb.git] / src / target / firmware / include / rf / trf6151.h
blob6a23d8ac944c745ac55074b33f452c6b04d80c7d
1 #ifndef _TRF6151_H
2 #define _TRF6151_H
4 #include <osmocom/gsm/gsm_utils.h>
6 /* initialize (reset + power up) */
7 void trf6151_init(uint8_t tsp_uid, uint16_t tsp_reset_id);
9 /* switch power off or on */
10 void trf6151_power(int on);
12 /* obtain the current total gain of the TRF6151 */
13 uint8_t trf6151_get_gain_reg(void);
15 /* put current set (or computed) gain to register */
16 int trf6151_set_gain_reg(uint8_t dbm, int high);
18 /* set the global gain to use */
19 int trf6151_set_gain(uint8_t dbm);
21 /* obtain the global gain set */
22 uint8_t trf6151_get_gain(void);
24 /* Request the PLL to be tuned to the given frequency */
25 /* arfcn must have ARFCN_UPLINK flag set if you want uplink ! */
26 /* tx selects the TX path only and doesn't set UL band ! */
27 void trf6151_set_arfcn(uint16_t arfcn, int tx);
29 enum trf6151_mode {
30 TRF6151_IDLE,
31 TRF6151_RX,
32 TRF6151_TX,
35 /* Set the operational mode of the TRF6151 chip */
36 void trf6151_set_mode(enum trf6151_mode mode);
38 void trf6151_test(uint16_t arfcn);
39 void trf6151_tx_test(uint16_t arfcn);
41 /* prepare a Rx window with the TRF6151 finished at time 'start' (in qbits) */
42 void trf6151_rx_window(int16_t start_qbits, uint16_t arfcn);
44 /* prepare a Tx window with the TRF6151 finished at time 'start' (in qbits) */
45 void trf6151_tx_window(int16_t start_qbits, uint16_t arfcn);
47 /* Given the expected input level of exp_inp dBm and the target of target_bb
48 * dBm, configure the RF Frontend with the respective gain */
49 void trf6151_compute_gain(int16_t exp_inp, int16_t target_bb);
51 /* Need for IQ swap */
52 int trf6151_iq_swapped(uint16_t band_arfcn, int tx);
54 #endif /* TRF6151_H */