123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309 |
- /*****************************************************************************
- Copyright(c) 2013 FCI Inc. All Rights Reserved
- File name : bbm.c
- Description : API source of ISDB-T 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 :
- ----------------------------------------------------------------------
- *******************************************************************************/
- #include "fci_types.h"
- #include "fci_tun.h"
- #include "fci_hal.h"
- #include "fc8300_bb.h"
- #include "fc8300_isr.h"
- s32 bbm_com_reset(HANDLE handle, DEVICEID devid)
- {
- s32 res;
- res = fc8300_reset(handle, devid);
- return res;
- }
- s32 bbm_com_probe(HANDLE handle, DEVICEID devid)
- {
- s32 res;
- res = fc8300_probe(handle, devid);
- return res;
- }
- s32 bbm_com_init(HANDLE handle, DEVICEID devid)
- {
- s32 res;
- res = fc8300_init(handle, devid);
- return res;
- }
- s32 bbm_com_deinit(HANDLE handle, DEVICEID devid)
- {
- s32 res;
- res = fc8300_deinit(handle, devid);
- return res;
- }
- s32 bbm_com_read(HANDLE handle, DEVICEID devid, u16 addr, u8 *data)
- {
- s32 res;
- res = bbm_read(handle, devid, addr, data);
- return res;
- }
- s32 bbm_com_byte_read(HANDLE handle, DEVICEID devid, u16 addr, u8 *data)
- {
- s32 res;
- res = bbm_byte_read(handle, devid, addr, data);
- return res;
- }
- s32 bbm_com_word_read(HANDLE handle, DEVICEID devid, u16 addr, u16 *data)
- {
- s32 res;
- res = bbm_word_read(handle, devid, addr, data);
- return res;
- }
- s32 bbm_com_long_read(HANDLE handle, DEVICEID devid, u16 addr, u32 *data)
- {
- s32 res;
- res = bbm_long_read(handle, devid, addr, data);
- return res;
- }
- s32 bbm_com_bulk_read(HANDLE handle, DEVICEID devid, u16 addr,
- u8 *data, u16 size)
- {
- s32 res;
- res = bbm_bulk_read(handle, devid, addr, data, size);
- return res;
- }
- s32 bbm_com_data(HANDLE handle, DEVICEID devid, u16 addr, u8 *data, u32 size)
- {
- s32 res;
- res = bbm_data(handle, devid, addr, data, size);
- return res;
- }
- s32 bbm_com_write(HANDLE handle, DEVICEID devid, u16 addr, u8 data)
- {
- s32 res;
- res = bbm_write(handle, devid, addr, data);
- return res;
- }
- s32 bbm_com_byte_write(HANDLE handle, DEVICEID devid, u16 addr, u8 data)
- {
- s32 res;
- res = bbm_byte_write(handle, devid, addr, data);
- return res;
- }
- s32 bbm_com_word_write(HANDLE handle, DEVICEID devid, u16 addr, u16 data)
- {
- s32 res;
- res = bbm_word_write(handle, devid, addr, data);
- return res;
- }
- s32 bbm_com_long_write(HANDLE handle, DEVICEID devid, u16 addr, u32 data)
- {
- s32 res;
- res = bbm_long_write(handle, devid, addr, data);
- return res;
- }
- s32 bbm_com_bulk_write(HANDLE handle, DEVICEID devid,
- u16 addr, u8 *data, u16 size)
- {
- s32 res;
- res = bbm_bulk_write(handle, devid, addr, data, size);
- return res;
- }
- s32 bbm_com_i2c_init(HANDLE handle, u32 type)
- {
- s32 res;
- res = tuner_ctrl_select(handle, DIV_BROADCAST, (enum I2C_TYPE) type);
- return res;
- }
- s32 bbm_com_i2c_deinit(HANDLE handle)
- {
- s32 res;
- res = tuner_ctrl_deselect(handle, DIV_BROADCAST);
- return res;
- }
- s32 bbm_com_tuner_select(HANDLE handle, DEVICEID devid, u32 product,
- u32 brodcast)
- {
- s32 res;
- res = tuner_select(handle, devid, product, brodcast);
- return res;
- }
- s32 bbm_com_tuner_deselect(HANDLE handle, DEVICEID devid)
- {
- s32 res;
- res = tuner_deselect(handle, devid);
- return res;
- }
- s32 bbm_com_tuner_read(HANDLE handle, DEVICEID devid, u8 addr, u8 alen,
- u8 *buffer, u8 len)
- {
- s32 res;
- res = tuner_i2c_read(handle, devid, addr, alen, buffer, len);
- return res;
- }
- s32 bbm_com_tuner_write(HANDLE handle, DEVICEID devid, u8 addr, u8 alen,
- u8 *buffer, u8 len)
- {
- s32 res;
- res = tuner_i2c_write(handle, devid, addr, alen, buffer, len);
- return res;
- }
- s32 bbm_com_tuner_set_freq(HANDLE handle, DEVICEID devid, u32 freq, u8 subch)
- {
- s32 res;
- res = tuner_set_freq(handle, devid, freq, subch);
- return res;
- }
- s32 bbm_com_tuner_get_rssi(HANDLE handle, DEVICEID devid, s32 *rssi)
- {
- s32 res;
- res = tuner_get_rssi(handle, devid, rssi);
- return res;
- }
- s32 bbm_com_scan_status(HANDLE handle, DEVICEID devid)
- {
- s32 res;
- res = fc8300_scan_status(handle, devid);
- return res;
- }
- s32 bbm_com_hostif_select(HANDLE handle, u8 hostif)
- {
- s32 res;
- res = bbm_hostif_select(handle, hostif);
- return res;
- }
- s32 bbm_com_hostif_deselect(HANDLE handle)
- {
- s32 res;
- res = bbm_hostif_deselect(handle);
- return res;
- }
- s32 bbm_com_ts_callback_register(u32 userdata,
- s32 (*callback)(u32 userdata, u8 bufid, u8 *data, s32 length))
- {
- fc8300_ts_user_data = userdata;
- fc8300_ts_callback = callback;
- return BBM_OK;
- }
- s32 bbm_com_ts_callback_deregister(void)
- {
- fc8300_ts_user_data = 0;
- fc8300_ts_callback = NULL;
- return BBM_OK;
- }
- s32 bbm_com_ac_callback_register(u32 userdata,
- s32 (*callback)(u32 userdata, u8 bufid, u8 *data, s32 length))
- {
- fc8300_ac_user_data = userdata;
- fc8300_ac_callback = callback;
- return BBM_OK;
- }
- s32 bbm_com_ac_callback_deregister(void)
- {
- fc8300_ac_user_data = 0;
- fc8300_ac_callback = NULL;
- return BBM_OK;
- }
- void bbm_com_isr(HANDLE handle)
- {
- fc8300_isr(handle);
- }
|