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
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
|
/*****************************************************************************
Copyright(c) 2009 FCI Inc. All Rights Reserved
File name : bbm.c
Description : API of dmb baseband module
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
History :
----------------------------------------------------------------------
2009/08/29 jason initial
*******************************************************************************/
#include "fci_types.h"
#include "fci_tun.h"
#include "fc8050_regs.h"
#include "fc8050_bb.h"
#include "fci_hal.h"
#include "fc8050_isr.h"
int bbm_com_reset(HANDLE hDevice)
{
int res;
res = fc8050_reset(hDevice);
return res;
}
int bbm_com_probe(HANDLE hDevice)
{
int res;
res = fc8050_probe(hDevice);
return res;
}
int bbm_com_init(HANDLE hDevice)
{
int res;
res = fc8050_init(hDevice);
return res;
}
int bbm_com_deinit(HANDLE hDevice)
{
int res;
res = fc8050_deinit(hDevice);
return res;
}
int bbm_com_read(HANDLE hDevice, u16 addr, u8 *data)
{
int res;
res = bbm_read(hDevice, addr, data);
return res;
}
int bbm_com_byte_read(HANDLE hDevice, u16 addr, u8 *data)
{
int res;
res = bbm_byte_read(hDevice, addr, data);
return res;
}
int bbm_com_word_read(HANDLE hDevice, u16 addr, u16 *data)
{
int res;
res = bbm_word_read(hDevice, addr, data);
return res;
}
int bbm_com_long_read(HANDLE hDevice, u16 addr, u32 *data)
{
int res;
res = bbm_long_read(hDevice, addr, data);
return res;
}
int bbm_com_bulk_read(HANDLE hDevice, u16 addr, u8 *data, u16 size)
{
int res;
res = bbm_bulk_read(hDevice, addr, data, size);
return res;
}
int bbm_com_data(HANDLE hDevice, u16 addr, u8 *data, u16 size)
{
int res;
res = bbm_data(hDevice, addr, data, size);
return res;
}
int bbm_com_write(HANDLE hDevice, u16 addr, u8 data)
{
int res;
res = bbm_write(hDevice, addr, data);
return res;
}
int bbm_com_byte_write(HANDLE hDevice, u16 addr, u8 data)
{
int res;
res = bbm_byte_write(hDevice, addr, data);
return res;
}
int bbm_com_word_write(HANDLE hDevice, u16 addr, u16 data)
{
int res;
res = bbm_word_write(hDevice, addr, data);
return res;
}
int bbm_com_long_write(HANDLE hDevice, u16 addr, u32 data)
{
int res;
res = bbm_long_write(hDevice, addr, data);
return res;
}
int bbm_com_bulk_write(HANDLE hDevice, u16 addr, u8 *data, u16 size)
{
int res;
res = bbm_bulk_write(hDevice, addr, data, size);
return res;
}
int bbm_com_tuner_read(
HANDLE hDevice, u8 addr, u8 address_len, u8 *buffer, u8 len)
{
int res;
res = tuner_i2c_read(hDevice, addr, address_len, buffer, len);
return res;
}
int bbm_com_tuner_write(
HANDLE hDevice, u8 addr, u8 address_len, u8 *buffer, u8 len)
{
int res;
res = tuner_i2c_write(hDevice, addr, address_len, buffer, len);
return res;
}
int bbm_com_tuner_set_freq(HANDLE hDevice, u32 freq)
{
int res = BBM_OK;
res = tuner_set_freq(hDevice, freq);
return res;
}
int bbm_com_tuner_select(HANDLE hDevice, u32 product, u32 band)
{
int res = BBM_OK;
res = tuner_select(hDevice, product, band);
return res;
}
int bbm_com_tuner_get_rssi(HANDLE hDevice, s32 *rssi)
{
int res = BBM_OK;
res = tuner_get_rssi(hDevice, rssi);
return res;
}
int bbm_com_scan_status(HANDLE hDevice)
{
int res = BBM_OK;
res = fc8050_scan_status(hDevice);
return res;
}
int bbm_com_channel_select(
HANDLE hDevice, u8 subchannel_id, u8 service_channel_id)
{
int res;
res = fc8050_channel_select(hDevice, subchannel_id, service_channel_id);
return res;
}
int bbm_com_video_select(
HANDLE hDevice, u8 subchannel_id, u8 service_channel_id, u8 cdiId)
{
int res;
res = fc8050_video_select(
hDevice, subchannel_id, service_channel_id, cdiId);
return res;
}
int bbm_com_audio_select(
HANDLE hDevice, u8 subchannel_id, u8 service_channel_id)
{
int res;
res = fc8050_audio_select(hDevice, subchannel_id, service_channel_id);
return res;
}
int bbm_com_data_select(HANDLE hDevice, u8 subchannel_id, u8 service_channel_id)
{
int res;
res = fc8050_data_select(hDevice, subchannel_id, service_channel_id);
return res;
}
int bbm_com_channel_deselect(
HANDLE hDevice, u8 subchannel_id, u8 service_channel_id)
{
int res;
res = fc8050_channel_deselect(
hDevice, subchannel_id, service_channel_id);
return res;
}
int bbm_com_video_deselect(
HANDLE hDevice, u8 subchannel_id, u8 service_channel_id, u8 cdiId)
{
int res;
res = fc8050_video_deselect(
hDevice, subchannel_id, service_channel_id, cdiId);
return res;
}
int bbm_com_audio_deselect(
HANDLE hDevice, u8 subchannel_id, u8 service_channel_id)
{
int res;
res = fc8050_audio_deselect(hDevice, subchannel_id, service_channel_id);
return res;
}
int bbm_com_data_deselect(
HANDLE hDevice, u8 subchannel_id, u8 service_channel_id)
{
int res;
res = fc8050_data_deselect(hDevice, subchannel_id, service_channel_id);
return res;
}
void bbm_com_isr(HANDLE hDevice)
{
fc8050_isr(hDevice);
}
int bbm_com_hostif_select(HANDLE hDevice, u8 hostif)
{
int res = BBM_NOK;
res = bbm_hostif_select(hDevice, hostif);
return res;
}
int bbm_com_hostif_deselect(HANDLE hDevice)
{
int res = BBM_NOK;
res = bbm_hostif_deselect(hDevice);
return res;
}
int bbm_com_fic_callback_register(
u32 userdata
, int (*callback)(u32 userdata, u8 *data, int length))
{
fic_user_data = userdata;
fic_callback = callback;
return BBM_OK;
}
int bbm_com_msc_callback_register(
u32 userdata
, int (*callback)(u32 userdata, u8 subchannel_id, u8 *data, int length))
{
msc_user_data = userdata;
msc_callback = callback;
return BBM_OK;
}
int bbm_com_fic_callback_deregister(HANDLE hDevice)
{
fic_user_data = 0;
fic_callback = NULL;
return BBM_OK;
}
int bbm_com_msc_callback_deregister(HANDLE hDevice)
{
msc_user_data = 0;
msc_callback = NULL;
return BBM_OK;
}
|