![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
驱动
文章平均质量分 89
feiwatson
这个作者很懒,什么都没留下…
展开
-
树莓派 - 通过sysfs操控GPIO
点亮或熄灭LED硬件上,一个LED灯接在pi的Pin-25. 该引脚为BCM的GPIO26$ gpio readall +-----+-----+---------+------+---+---Pi 3---+---+------+---------+-----+-----+ | BCM | wPi | Name | Mode | V | Physical | V | Mode | N...原创 2018-06-24 18:24:51 · 1021 阅读 · 0 评论 -
树梅派 -- 通过/sys读写ADC芯片 pcf8591
通过wiringPi等library, 在user space 通过/dev/i2c来读写i2c设备的方案不在本文讨论了。编译SENSORS_PCF8591 模块在Default raspberryPi的内核中,pcf591模块是没有编译的。查看drivers\hwmon\Makefileobj-$(CONFIG_HWMON) += hwmon.o...ob...原创 2018-07-31 15:06:07 · 526 阅读 · 0 评论 -
Linux I2C驱动
Linux I2C 驱动结构i2c体系结构由三部分组成i2C core i2c core提供了i2c 总线驱动 和 设备驱动的注册,注销方法i2C bus driver (i2c adapter)i2c device driver原创 2018-08-03 21:26:07 · 192 阅读 · 0 评论 -
树莓派 -- oled
硬件SPI0,CE0 SPI Master Driver设备树arch\arm\boot\dts\bcm2710-rpi-3-b.dts&gpio { spi0_pins: spi0_pins { brcm,pins = <9 10 11>; brcm,function = <4>; /* a...原创 2018-07-21 20:57:11 · 1485 阅读 · 0 评论 -
树莓派 -- i2c学习
硬件平台RaspberryPi-3B+Pioneer600外扩版i2c芯片为DS3231,adddress 0x68首先来看一下i2ctool的使用i2ctool 使用https://i2c.wiki.kernel.org/index.php/I2C_Tools https://git.kernel.org/pub/scm/utils/i2c-tools/i2c-too...原创 2018-07-14 23:18:48 · 3047 阅读 · 0 评论 -
树莓派 -- 输入设备驱动 (key) 续2: 转载 Setting up a GPIO-Button “keyboard” on a Raspberry Pi
使用device-tree (DT) overlay应该是更方便的方法:http://blog.gegg.us/2017/01/setting-up-a-gpio-button-keyboard-on-a-raspberry-pi/Back in late 2013, when I wrote the first Version of a raspberry-pi based softwa...转载 2018-07-04 23:07:03 · 504 阅读 · 0 评论 -
树莓派 -- 输入设备驱动 (key) 续1
测试 安装 input-utilspi@raspberrypi:~ $ sudo apt-get install input-utilsReading package lists... DoneBuilding dependency tree Reading state information... DoneThe following NEW packages will ...原创 2018-07-04 22:47:25 · 377 阅读 · 0 评论 -
树莓派 -- i2c学习 续(1) DeviceTree Overlay实例化rtc
上文中讨论了通过sysfs来实例化i2c设备 (rtc ds3231) https://blog.csdn.net/feiwatson/article/details/81048616本文继续看看如何通过 DeviceTree Overlays来实例化rtc ds3231write dts首先,写一个dts/dts-v1/;/plugin/;/ { co...原创 2018-07-16 22:17:14 · 2665 阅读 · 0 评论 -
树莓派 - gpio-led platform driver 控制LED
树莓派3b板上有两个LED, pwr (power) 和 act (activity)。是platform_driver gpio-led驱动。可以通过设备树和gpio-led来额外控制一个LED。如下图在P25和GND之间接入一个发光二极管。 在设备树bcm2710-rpi-3-b.dts中添加一个LED2来控制外部的LED&leds { act_led: act {...原创 2018-06-26 22:26:36 · 818 阅读 · 0 评论 -
树莓派 -- 输入设备驱动 (key)
输入设备(如按键,键盘,触摸屏等)是典型的字符设备,其一般工作原理是底层在按键或触摸等动作发生时产生一个中断,然后CPU通过SPI,I2C总线读取键值。 在这些工作中之后中断和读键值是与设备相关的,而输入事件的缓冲区管理,字符设备驱动的file_operations接口则对输入设备是通用的。因此内核设计了输入子系统,由核心层处理公共的工作。先看gpio-keys platform_drive...原创 2018-07-01 22:13:36 · 2171 阅读 · 0 评论 -
leds-gpio driver 续1
在上文中分析了gpio-led platform_device是如何定义并注册的。 那么gpio-led platform_device 和 gpio-led platform_driver是如何匹配的呢我们还是先分析probe函数 drivers\leds\leds-gpio.cstatic int gpio_led_probe(struct platform_device *pde...原创 2018-07-01 00:51:15 · 805 阅读 · 1 评论 -
leds-gpio driver
leds-gpio driver标签(空格分隔): linux raspberry platform-driver我们还是先看看platform device是如何define的platform device 是如何定义的example1在板级驱动中定义, 通过platform_add_devices()函数将这个platform device注册进系统. ar...原创 2018-07-01 00:49:40 · 774 阅读 · 0 评论 -
树莓派 - 驱动hello
树莓派上Linux驱动,从hello world 开始 ... hello.c #include <linux/init.h> #include <linux/module.h> #include <linux/moduleparam.h> MODULE_LICENSE("Dual BSD/GPL"); static int hell...原创 2018-06-18 15:53:52 · 299 阅读 · 0 评论 -
树莓派 - platform总线,设备和驱动
以树莓派为例子,分析一下其中LED的 platform device 和 platform driver.查看LED设备,被挂载在/sys/devices/platform下。注意其中的driver指向, driver -> ../../../bus/platform/drivers/leds-gpiopi@raspberrypi:/sys/devices/platform/leds $ t...原创 2018-06-24 23:19:40 · 1221 阅读 · 0 评论 -
转: 使用 /sys 文件系统访问 Linux 内核
转一个挺不错的文章使用 /sys 文件系统访问 Linux 内核https://www.ibm.com/developerworks/cn/linux/l-cn-sysfs/ 如果你正在开发的设备驱动程序中需要与用户层的接口,一般可选的方法有: 注册虚拟的字符设备文件,以这个虚拟设备上的 read/write/ioctl 等接口与用户交互;但 read/write ...转载 2018-08-01 21:27:10 · 172 阅读 · 0 评论