《Arm驱动程序设计》PPT课件.ppt





《《Arm驱动程序设计》PPT课件.ppt》由会员分享,可在线阅读,更多相关《《Arm驱动程序设计》PPT课件.ppt(19页珍藏版)》请在淘文阁 - 分享文档赚钱的网站上搜索。
1、Arm驱动程序设计LED灯驱动任务要求要求:对开发板上的LED灯点亮实现:两部分1、驱动设计(在linux内核中加入LED驱动)2、应用程序实现(应用程序调用驱动实现点亮)硬件原理图驱动编写第一步:解压源码我们要编写的驱动是对应于LED第二步:进入drivers目录cd driversLED属于字符设备cd char进入char目录第三步:编写驱动源程序第一步、编写驱动包括6部分1头文件2注册函数3卸载函数找一个类似的驱动打开,编写首先把头文件全部copy4定义设备名#define DEVICE_NAME leds“5硬件引脚定义6模块信息#include#include#include#in
2、clude#include#include#include#include#include#include#include#include#include#include#include#include#include#include#include 1加入硬件引脚static unsigned long gpio_table =S3C2410_GPB5,S3C2410_GPB6,S3C2410_GPB7,S3C2410_GPB8,;static int leds_init(void)static void leds_exit(void)2编写注册函数3编写卸载函数4加入模块信息module_
3、init(leds_init);module_exit(leds_exit);MODULE_LICENSE(GPL);MODULE_AUTHOR(zjl);static unsigned int gpio_cfg_table =S3C2410_GPB5_OUTP,S3C2410_GPB6_OUTP,S3C2410_GPB7_OUTP,S3C2410_GPB8_OUTP,;说明引脚功能,输出static int leds_init(void)int ret;ret=misc_register(&misc_leds);if(ret 4)return-EINVAL;s3c2410_gpio_setp
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- Arm驱动程序设计 Arm 驱动程序 设计 PPT 课件

限制150内