summaryrefslogtreecommitdiffstats
path: root/src/target/firmware/include/rffe.h
blob: 02fc1fdabcf73cc48e3aefe5180db8d4dc107324 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#ifndef _RFFE_H
#define _RFFE_H

#include <osmocom/gsm/gsm_utils.h>

extern const uint8_t system_inherent_gain;

/* initialize RF Frontend */
void rffe_init(void);

/* switch RF Frontend Mode */
void rffe_mode(enum gsm_band band, int tx);

/* query RF wiring */
enum rffe_port
{
	PORT_LO		= 0,	/* Combined 850/900 port */
	PORT_HI		= 1,	/* Combined 1800/1900 port */
	PORT_GSM850	= 2,
	PORT_GSM900	= 3,
	PORT_DCS1800	= 4,
	PORT_PCS1900	= 5,
};

uint32_t rffe_get_rx_ports(void);
uint32_t rffe_get_tx_ports(void);

/* IQ swap requirements */
int rffe_iq_swapped(uint16_t band_arfcn, int tx);

/* get current gain of RF frontend (anything between antenna and baseband in dBm */
uint8_t rffe_get_gain(void);

void rffe_set_gain(uint8_t dbm);

void rffe_compute_gain(int16_t exp_inp, int16_t target_bb);

#endif