/*****************************************************************
1 先分析类的继承关系
2 rf卡类的分析,及构造函数过程
3 软件改动文件,及其调用过程
4 硬件端口PORT的选定方法
1 先分析类的继承关系
2 rf卡类的分析,及构造函数过程
3 软件改动文件,及其调用过程
4 硬件端口PORT的选定方法
******************************************************************/
/*1 以下是程序中用到的类*/
最基类rfa -----作用RFC Common base class
class rfdevice_rxtx_common_class:public rfdevice_class
class rfdevice_rxtx_common_adapter : public rfdevice_rxtx_common_class
class rfdevice_rxtx_common_class:public rfdevice_class //rfdevice_rxtx_common_class添加了一些对设备的操作:如设置路径,上电,改变state,reg dump
class rfdevice_class: public rfa //rfdevice_class添加了一些设备的基本信息,如厂家id,设备id,设备类型,实例号等操作信息
class rfdevice_trx_wcdma_rx_adapter:public rfdevice_trx_wcdma_rx
class rfdevice_trx_wcdma_rx:public rfdevice_class //rfdevice_trx_wcdma_rx主要增加了一些virtual函数接口,如,setband disable entermode setport,不过真正的操作函数还得由子类自己实现
class rfdevice_class: public rfa //rfa代表什么设备
class rfc_wtr4905_chile_srlte_v2_lte_ag:public rfc_lte_data //子类中有相关函数,所以会调用子类中定义的函数
class rfc_lte_data : public rfa //rfc_lte_data类中定义了一些虚函数,如果子类同名,则覆盖
class rfdevice_asm_common:public rfdevice_asm
class rfdevice_asm:public rfdevice_class
class rfdevice_class: public rfa
/*2 以下是程序rf卡的代码初始化过程*/
//构造函数, Create rf device objects based on the rf-card specific device configuration info
rfc_intf(rf_hw_type rfhw, system_clock_enum sysclk) :
// Initializes the RFC common module,主要初始化设置RF_GRFC/GRFC/GPIO initialization;
rfc_common_init(rfc_info_table, rfc_signal_num);
rfc_msm_signals_num = rfc_msm_sig_info_table_get(& rfc_msm_signal_info_table);相应的平台src中定义次函数,比如:\modem_proc\rfc_jolokia\target\mdm9609\src\Rfc_msm_signal_info_ag.c
相关rf管脚的定义信息
for (i = 0; i < rfc_signals_num ; i++)
//设置相关的硬件管脚
rfc_common_set_grfc(rc_msm_signal_info_table[msm_signal].grfc_num, rfc_signal_info_table[i].init_state); //来自lib
// create all the rf device objects based on the device configuration data
create_cmn_rf_devices
phys_devices_array = modem_mem_alloc(sizeof(rfc_physical_device_struct_type)*phys_devices_count,MODEM_MEM_CLIENT_RFA); //分配phys设备内存
memset(phys_devices_array, 0, phys_devices_count*sizeof(rfc_physical_device_struct_type)); //初始化内存
/*Create the physical device,创建物理设备,以下有逻辑设备。一个逻辑设备只能对应一个物理设备,一个物理设备可以对应多个逻辑设备*/
phys_dev = rf_device_factory_create_phys_device(&phy_devices_cfg[index]);
return new qfe2520_physical_device(cfg, FALSE);\modem_proc\rfdevice_qfe2520\api\Qfe2520_physical_device.h中定义的结构体
/**********************************Adding physical device objects to the physical devices array indexed by the physical device instance****************/
/*Store the phy obj to the phy devices array,将实体跟数组相关联,方便调用,程序里会有一个物理设备的一个链表*/
while(){
phys_devices_array[phy_dev_instance].device_obj = phys_dev;
phys_devices_array[phy_dev_instance].device_status = RFC_DEVICE_PRESENT;