資源簡介
Android GPMC與FPGA進行通信,按道理很簡單的。其大概是在board-xxx.c里頭配置pin mux,系統(tǒng)會調(diào)用GPMC驅(qū)動,并且申請一定的內(nèi)存資源。然后驅(qū)動中會根據(jù)gpmc_cs_request中cs中g(shù)pmc_cs_config7中配置分配地址,然后通過ioremap將地址映射成內(nèi)存地址,然后讀寫內(nèi)存地址,則完成通信讀寫操作

代碼片段和文件信息
#include?
#include?
#include?
#include?
#include?
#include?
#include?
#include?
#include?
#include?
#include?
#include?
#include?
#define?FPGA_MACRO_DEV_NAME????“gpmc_fpga“
static?int?fpga_device_init(struct?platform_device?*pdev){
???//?gpio配置?
???int?ret=0;
???return?ret;
}
static?int?fpga_device_release(void){
return?0;
}
static?struct?platform_device?fpga_ep4ce115_device=
{
????.name?=?FPGA_MACRO_DEV_NAME
????.dev?={
??????.release?=?fpga_device_release
????}
};
static?__init?int?fpga_ep4ce115_init(void){
???int?ret=0;??//控制狀態(tài)
???ret=platform_device_register(&fpga_ep4ce115_device);//?步進電機gpio初始化問題
???if(ret<0){
??????printk(“#####?platform_device_register?failed!\n“);
??????return?ret;
???}
???gpmc_fpga_init();???//?初始化FPGA
???
???return?ret;
}
/**
????\brief??stepmotor_exit????釋放步進電機設備
????\param[out]?none
????\retval?????none
*/
static?__exit?void?fpga_ep4ce115_exit(void){
???printk(“#####?stepmotor_exit?unregister?step?device!\n“);
???platform_device_unregister(&stepmotor_device);
???return;
}
MODULE_LICENSE(“GPL“);
module_init(fpga_ep4ce115_init);
module_exit(fpga_ep4ce115_exit);
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2018-10-14?19:24??fpga\
?????文件????????1398??2018-10-13?16:50??fpga\ep4ce115-dev.c
?????文件????????3968??2018-10-13?16:50??fpga\ep4ce115-drv.c
?????文件????????4922??2018-10-14?21:55??fpga\gpmc-ep4ce115.c
?????文件????????1153??2018-10-14?21:24??fpga\gpmc-ep4ce115.h
?????文件?????????111??2018-10-13?16:50??fpga\Kconfig
?????文件??????????69??2018-10-13?16:50??fpga\Makefile
評論
共有 條評論