嵌入式Linux&Android开发-把驱动添加到SDK固件内

目录

一、添加驱动程序到系统固件中

1.1 添加led_driver.c,可复制类似文件修改

1.2 添加驱动Makefile

1.3 添加驱动Kconfig

1.4 打开配置

1.5 编译

1.6 烧录&打印

二、添加测试程序到系统固件中

2.1 创建编写测试程序

2.2 添加Android.mk文件

2.3 配置环境脚本&编译

2.4 编译成功后生成在此路径


一、添加驱动程序到系统固件中

1.1 添加led_driver.c,可复制类似文件修改

文件放到sdk/kernel/drivers/gpio/led_driver.c

/*
 * Driver for pwm demo on kemp board.
 *
 * Copyright (C) 2016, Zhongshan T-chip Intelligent Technology Co.,ltd.
 * Copyright 2006  JC.Lin
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 as
 * published by the Free Software Foundation.
 */
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/fs.h>
#include <linux/init.h>
#include <linux/delay.h>
#include <linux/uaccess.h>
#include <asm/irq.h>
#include <asm/io.h>
#include <linu
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值