[RK3399][Android7.1]编写一个安卓的GPIO驱动
5 E币
成为会员,免费下载资料
文件大小:155.74 KB
上传者:798253898
时间:2023-01-20 18:36:33
下载量:0
1、在 kernel/drivers 目录下新建 ioctrl 文件夹
# cd kernel/drivers
# mkdir ioctrl
在/driver/ioctrl 目录下,新建 ioctrl.c ,ioctrl.h , Kconfig, Makefile 等 4 个文件。
2、在 Kconfig 下添加代码:
config IOCTRL
tristate "io Control" default y
help
when system setup,change the io state
在 Makefile 下添加代码:
obj-$(CONFIG_IOCTRL) += ioctrl.o
在 ioctrl.c 中添加代码:
/*
* Driver for pwm demo on Firefly board ioctrl. *
* Copyright (C) 2022, Zhongshan T-chip Intelligent Technology Co.,ltd. * Copyright 2006 Sam Chan
*
* 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.
展开》
折叠》