![](https://img-blog.csdnimg.cn/20201014180756724.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Linux驱动开发
文章平均质量分 62
Yantai666
这个作者很懒,什么都没留下…
展开
-
freetype提取字模
#include #include #include #include //使用freetype必须添加#include FT_FREETYPE_H#define WIDTH 80#define HEIGHT 80//模拟一个高度为HEIGHT宽度为WIDTH的屏幕,其实就是控制台了unsigned char image[HEIGHT][WI原创 2015-01-28 14:40:35 · 1029 阅读 · 0 评论 -
spi master spi driver spi device
为了更好的将各个层次划分开来,互不影响。所以抽像出来了3个层次:1、spi核心管理层2、spi控制器驱动(作为spi master)3、spi设备驱动(作为spi slave)本来,master与slave之间可以直接进行通信,但是这样耦合程序就很大。更改一点就得全改,因为spi的时钟有不同的极性以及空闲时时间线的定义包括,master提供的时钟的最大频率都受到限制。所以引原创 2015-05-15 10:51:18 · 769 阅读 · 0 评论 -
freescale github for imx6
freescale github for imx6原创 2015-05-14 14:27:12 · 921 阅读 · 0 评论 -
/dev/input/event0 键盘输入
在linux中读取键盘输入也是通过设备文件进行的,如/dev/input/event0就对应的键盘输入,可是键盘一般是有编码的,读取的按键并不只对应一个码,而是对应一串,需要读入后,进行解析来决定当前按下的是哪个按键。下面是简单的测试:原创 2015-05-14 10:07:32 · 10866 阅读 · 0 评论 -
kernel spi framework details
SPIdevices have a limited userspace API, supporting basic half-duplexread()and write() access to SPI slave devices. Using ioctl() requests,fullduplex transfers and device I/O configuration are als原创 2015-05-20 10:46:58 · 1457 阅读 · 0 评论 -
grab raw keyboard input from event device node
#include #include #include #include #include #include #include #include #include #include #include #include #include #include void handler (int sig){ printf ("nexit原创 2015-05-20 14:19:00 · 836 阅读 · 0 评论 -
qt5.3.2 everywhere evdev keyboard&mouse
看到没有?!最关键的参数:-mtdev -evdev ,因为运行的时候需要输入:./zsy.bin -platform linuxfb -plugin evdevkeyboard=/dev/input/input0 evdevmouse=/dev/input/input1The linuxfb plugin allows specifying add原创 2015-05-15 11:26:45 · 5486 阅读 · 1 评论 -
how to detemine event file node belongs to which device
linux输入子系统,在驱动中注册register_input_device()时,会在/dev/input/下生成节点,但是具体如何对应起来了,这就可以看/proc/bus/input/devices这个文件呢,在这个文件中,有个Handlers这个后面最后一个就是对应的处理器。shell.albert@yantai:~> ls -l /dev/input/tot原创 2015-05-20 11:29:45 · 582 阅读 · 0 评论 -
/dev/input/event* linux keyboard mouse event simulation
网上找的一个RedHat大神写的输入事件探测及使用的例子: /* * Copyright 2002 Red Hat Inc., Durham, North Carolina. * * All Rights Reserved. * * Permission is hereby granted, free of原创 2015-05-20 13:21:57 · 2031 阅读 · 0 评论 -
spi driver framework
cccccccccccccccccccccccccccccccccccccccccccccccccccccccccxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx2.3.4.5.6.原创 2015-05-15 15:47:37 · 641 阅读 · 0 评论 -
linux spi framework
Today Linux is the operating system choice for a wide range of special-purpose electronic devices known as embedded systems. An embedded system is specifically designed to perform a set of designated原创 2015-05-13 16:45:07 · 739 阅读 · 0 评论 -
ds1620混杂设备驱动
下面分析一下数字温度计DS1620的驱动程序。先从网上找到其数据手册,看看它的功能,再找到时序图片一下。这样有利于分析驱动,再套用上linux的驱动框架就可以了。同样,先找驱动的入口和出口,看看他们都做了什么。module_init(ds1620_init);module_exit(ds1620_exit);先来看一些常量的定义吧/*原创 2015-05-13 15:49:26 · 888 阅读 · 0 评论 -
视频监控那点事儿(复制别人的)
视频监控程序设计那点事儿这个项目前后历时两个礼拜,包括一周多的项目开发以及后期的收尾总结。一、框架结构图以及项目分析。图略。开发板上的应用程序要做的工作如下:1、采集摄像头视频数据到内存。2、发送数据,即传输视频。PC上的QT应用程序要做的工作如下:1、接收视频数据2、显示数据二、项目分析。转载 2015-01-29 17:19:29 · 2151 阅读 · 0 评论 -
linux uvc usb camera driver
usb被插入后识别为video3,所以应用中将打开设备由/dev/video0改为/dev/video3.原创 2015-05-12 20:21:15 · 865 阅读 · 0 评论 -
yuv422 format detail
原创 2015-05-04 10:09:38 · 1335 阅读 · 0 评论 -
摄像头中的HSYC VSYNC 信号
原创 2015-05-04 10:13:02 · 3591 阅读 · 1 评论 -
imx6 kernel boog log
U-Boot 2009.08-dirty ( 9æ?19 2014 - 18:53:46)CPU: Freescale i.MX6 family TO1.2 at 792 MHzThermal sensor with ratio = 183Temperature: 41 C, calibration data 0x5884ef69mx6q pll1: 792MHzmx原创 2015-05-13 09:35:47 · 2228 阅读 · 0 评论 -
imx6 fec eth0 FIFO_RD_AUX_LSB read fails
从网上找了一个好像是网络跟USB冲突导致的,记得之前编译的内核也是插上网线就报USB Charger Connected.USB Charger disconnected.一直打印这样的错误,拿下网线就不报了。所以肯定是网上所说的USB_PWR_EN跟网卡冲突了。看来,得把内核重新编译一次原创 2015-05-13 09:11:52 · 1794 阅读 · 0 评论 -
linux驱动分析之DS1302 RTC
系统开机时一般会通过/dev/rtc设备来获取当时时间,所以肯定有一个驱动用于支持这个/dev/rtc设备的。在内核的drivers/char中找到了ds1302.c的驱动。在这个驱动中就注册了字符型设备。并支持RTC设备的ioctl(),RTC_RD_TIME和RTC_SET_TIME这2个最为重要的控制方法。先看一下这个模块注册函数:module_init(ds1302_regis原创 2015-05-13 14:30:16 · 3089 阅读 · 0 评论 -
imx6 WiFI RTL8188EUS
rtl8188EUS_rtl8189ES_linux_v4.1.7_9024.20130916.tar.gzshell.albert@yantai:~/project/iMX6Build/rtl8188EUS_rtl8189ES_linux_v4.1.7_9024.20130916> ./make_drvPlease select card type(1/2):1) RTL原创 2015-05-15 13:24:46 · 4883 阅读 · 0 评论 -
input_report APIs
static inline void input_report_key(struct input_dev *dev, unsigned int code, int value){ input_event(dev, EV_KEY, code, !!value);}static inline void input_report_rel(struct input_dev *原创 2015-05-20 13:51:40 · 680 阅读 · 0 评论 -
Linux模拟鼠标和键盘事件的方法
#ifndef _INPUT_H#define _INPUT_H/* * Copyright (c) 1999-2002 Vojtech Pavlik * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Gener原创 2015-05-20 13:46:17 · 6057 阅读 · 0 评论 -
wpa_supplicant summary
by zhangshaoyan at May 20,2015.原创 2015-05-20 16:25:02 · 394 阅读 · 0 评论 -
input core输入事件 矩阵键盘 映射 原理分析
//这个是矩阵键盘映射表,使用内核定义的宏KEY()来建立//#defineKEY(row,col,val) ((((row)& (MATRIX_MAX_ROWS - 1)) //(((col)& (MATRIX_MAX_COLS - 1)) //((val)& 0xffff))//从上面的定义来看KEY用于唯一确认一个值,用于将(row,col,val)转换为一个原创 2015-07-08 11:20:46 · 2930 阅读 · 0 评论 -
imx6 WatchDog驱动程序及测试例程
/* * Watchdog driver for IMX2 and later processors * * Copyright (C) 2010 Wolfram Sang, Pengutronix e.K. * * some parts adapted by similar drivers from Darius Augulis and Vladimir * Zapo原创 2015-07-06 10:30:54 · 5199 阅读 · 0 评论 -
libmad mp3 decode example code
/* * libmad - MPEG audio decoder library * Copyright (C) 2000-2004 Underbit Technologies, Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms o原创 2015-07-06 21:25:57 · 1298 阅读 · 0 评论 -
qt5输入的一些细节
InputWhen no windowing system is present, the mouse, keyboard and touch input are read directly via evdev or using helper libraries liketslib. Note that this requires that devices nodes原创 2015-07-06 17:35:43 · 5606 阅读 · 0 评论 -
x264 encode example code
/***************************************************************************** * example.c: libx264 API usage example *****************************************************************************原创 2015-07-06 21:19:10 · 796 阅读 · 0 评论 -
udev和mdev hotplug事件
udev 和mdev 是两个使用uevent 机制处理热插拔问题的用户空间程序,两者的实现机理不同。udev 是基于netlink 机制的,它在系统启动时运行了一个deamon 程序udevd,通过监听内核发送的uevent 来执行相应的热拔插动作,包括创建/删除设备节点,加载/卸载驱动模块等等。mdev 是基于uevent_helper 机制的,它在系统启动时修改了内核中的uevnet_help原创 2015-07-17 10:54:01 · 1229 阅读 · 0 评论 -
输入设备节点自动生成
内核使用 event(事件)机制向外抛出消息,在应用层由udev/mdev接收到事件后,根据规则自动创建设备文件。但是内核有事件时需要调用 一个程序,以执行接下来的操作,故一般使用echo /sbin/mdev > /proc/sys/kernel/hotplug mdev -s但前提是必须要挂载一些文件系统,如将/dev挂为临时文件系统,这样就不需要向Flash写数据了。好了原创 2015-09-01 14:34:36 · 810 阅读 · 0 评论 -
imx6 项目的按键驱动程序
/** * filename:imx6_key_drv.c * description: matrix key driver for imx6. * author:shell.albert@gmail.com * date: September 1,2015. * * three gpio keys are connected to imx6 through differ原创 2016-01-02 11:49:14 · 2658 阅读 · 0 评论 -
V4L2 Test Bench
I need a tool to check the usb camera's features.So I found the packet names "qv4l2".And I found a very interesting point that is as follows:640x480 30fps800x600 15fps1024x768 12.5fps1280x10原创 2015-05-25 09:36:02 · 1862 阅读 · 0 评论 -
rtl8188 driver for linux
今晚搞定了wlan,连网成功。记录一下,明天继续进行低功耗的修改。1、安装编译好的无线网卡驱动模块root@yantai /$ insmod rtl8188.ko RTL87原创 2015-05-18 21:55:12 · 6375 阅读 · 2 评论 -
opensuse13.2 xfs文件系统修复
opensuse13,2开机时进入紧急模式welcome to emergency mode.Use "systemctl default "or ^D to actovate default mode.Give root password for maintenance (or type Control -D to continue ) :直接输入root密码进入 。dmes原创 2015-05-19 09:05:25 · 1201 阅读 · 0 评论 -
wpa_cli commands verify
使用wpa_cli手工发送命令进行连接WiFi.测试这些基于WPA的命令主要是想实现一个wpa的客户端工具,需要在arm上用qt实现一个这样的网络管理工具。唉,真是麻烦。yantai:/home/shell.albert # wpa_cli wpa_cli v2.2Copyright (c) 2004-2014, Jouni Malinen and contributors原创 2015-05-20 15:57:46 · 3864 阅读 · 1 评论 -
platform_set_drvdata() platform_get_drvdata()
内核模块一般在probe()函数中动态申请内存来使用,这种情况下,这个指针就得有个位置存储防止丢失,所以内核设计得在platform_device结构体中,保留了一个指针,就是为了这样的驱动编写方式。所以我们一般在probe()函数中动态申请设备结构体,并初始化它,然后使用platform_set_drvdata()将其保存到platform_device中,在需要使用的时候再使用原创 2015-05-21 16:15:23 · 13715 阅读 · 2 评论 -
imx6 uboot parameters
原创 2015-05-21 17:18:35 · 607 阅读 · 0 评论 -
imx6 uboot logo
The maximum resolution is 1024x600,bmp format,8-bit,256 grade.use bin2txt.pyw to change bmp to text.原创 2015-05-21 17:23:59 · 3046 阅读 · 4 评论 -
linux keypad driver
Linux kernel & device driver programming Cross-Referenced Linux and Device Driver Code[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ]Version: [原创 2015-05-21 17:39:31 · 1374 阅读 · 0 评论 -
iwconfig tools
shell.albert@yantai:~/tools/sokit-1.3-linux32> /usr/sbin/iwlistUsage: iwlist [interface] scanning [essid NNN] [last] [interface] frequency [interface] channel原创 2015-05-18 17:34:56 · 1270 阅读 · 0 评论