summaryrefslogtreecommitdiffstats
path: root/api/fc2580.h
blob: fc3d68708780b2df33d6be67dcb96b7d7850dbd3 (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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
#include "standard.h"

#define FREQ_XTAL	16384	//16.384MHz
#define	BORDER_FREQ	2600000	//2.6GHz : The border frequency which determines whether Low VCO or High VCO is used
#define USE_EXT_CLK	0	//0 : Use internal XTAL Oscillator / 1 : Use External Clock input
#define OFS_RSSI 57

extern Demodulator* FCI_FC2580_demodulator;
extern Byte FCI_FC2580_chip;

typedef enum {
	UHF_BAND,
	L_BAND,
	VHF_BAND,
	NO_BAND
} fc2580_band_type;

/*==============================================================================
		i2c command write							EXTERNAL FUNCTION

  This function is a generic function which write a byte into fc2580's
 specific address.

  <input parameter>

  slave_id
	i2c id of slave chip
	type : byte
	
  addr
	memory address of slave chip
	type : byte

  data
	target data
	type : byte

==============================================================================*/
extern void i2c_write( unsigned char slave_id, unsigned char addr, unsigned char data );

/*==============================================================================
		i2c command write							EXTERNAL FUNCTION

  This function is a generic function which gets called to read data from
 slave chip's target memory address.

  <input parameter>

  slave_id
	i2c id of slave chip
	type : byte
	
  addr
	memory address of slave chip
	type : byte

  <return value>
  data
	a byte of data read out of target address 'addr' of slave chip
	type : byte

==============================================================================*/
extern unsigned char i2c_read( unsigned char slave_id, unsigned char addr );

/*==============================================================================
		milisecond delay function					EXTERNAL FUNCTION

  This function is a generic function which write a byte into fc2580's
 specific address.

  <input parameter>

  a
	length of wanted delay in milisecond unit

==============================================================================*/
extern void wait_msec (unsigned long msec);



/*==============================================================================
       fc2580 i2c command write

  This function is a generic function which write a byte into fc2580's
 specific address.

  <input parameter>

  addr
	fc2580's memory address
	type : byte

  data
	target data
	type : byte

==============================================================================*/
void fc2580_i2c_write( unsigned char addr, unsigned char data );

/*==============================================================================
       fc2580 i2c data read

  This function is a generic function which gets called to read data from
 fc2580's target memory address.

  <input parameter>

  addr
	fc2580's memory address
	type : byte


  <return value>
  data
	a byte of data read out of target address 'addr'
	type : byte

==============================================================================*/
unsigned char fc2580_i2c_read( unsigned char addr );

/*==============================================================================
       fc2580 initial setting

  This function is a generic function which gets called to initialize

  fc2580 in DVB-H mode or L-Band TDMB mode

  <input parameter>

  ifagc_mode
    type : integer
	1 : Internal AGC
	2 : Voltage Control Mode

==============================================================================*/
void fc2580_set_init( int ifagc_mode );

/*==============================================================================
       fc2580 frequency setting

  This function is a generic function which gets called to change LO Frequency

  of fc2580 in DVB-H mode or L-Band TDMB mode

  <input parameter>

  f_lo
	Value of target LO Frequency in 'kHz' unit
	ex) 2.6GHz = 2600000

==============================================================================*/
void fc2580_set_freq( unsigned int f_lo );


/*==============================================================================
       fc2580 filter BW setting

  This function is a generic function which gets called to change Bandwidth

  frequency of fc2580's channel selection filter

  <input parameter>

  filter_bw
    1 : 1.53MHz(TDMB)
	5 : 5MHz
	6 : 6MHz
	7 : 7MHz
	8 : 7.8MHz
	9 : 8MHz

==============================================================================*/
void fc2580_set_filter(unsigned char filter_bw);

/*==============================================================================
       fc2580 RSSI function

  This function is a generic function which returns fc2580's
  
  current RSSI value.

  <input parameter>
	none

  <return value>
  int
  	rssi : estimated input power.

==============================================================================*/
int fc2580_get_rssi(void);