资源简介
gt911触摸屏驱动程序,成功运行与linux 系统中。-------------------------------------------------
代码片段和文件信息
#include
#include“hjt_ts_gt911.h“
static const char *goodix_input_phys = “input/ts“;
static const char *goodix_ts_name = “goodix-ts“;
static struct workqueue_struct *goodix_wq;
struct i2c_client * i2c_connect_client = NULL;
int gtp_rst_gpio;
int gtp_int_gpio;
u8 config[GTP_CONFIG_MAX_LENGTH + GTP_ADDR_LENGTH]
= {GTP_REG_CONFIG_DATA>> 8 GTP_REG_CONFIG_DATA & 0xff};
static ssize_t gt91xx_config_read_proc(struct file * char __user * size_t loff_t*);
static ssize_t gt91xx_config_write_proc(struct file * const char __user * size_tloff_t *);
static s8 gtp_i2c_test(struct i2c_client *client);
void gtp_reset_guitar(struct i2c_client *client s32 ms);
s32 gtp_send_cfg(struct i2c_client *client);
void gtp_int_sync(s32 ms);
static struct proc_dir_entry *gt91xx_config_proc = NULL;
static const struct file_operations config_proc_ops = {
.owner = THIS_MODULE
.read = gt91xx_config_read_proc
.write = gt91xx_config_write_proc
};
static int gtp_register_powermanger(struct goodix_ts_data *ts);
static int gtp_unregister_powermanger(struct goodix_ts_data *ts);
/*******************************************************
Function:
Read data from the i2c slave device.
Input:
client: i2c device.
buf[0~1]: read start address.
buf[2~len-1]: read data buffer.
len: GTP_ADDR_LENGTH + read bytes count
Output:
numbers of i2c_msgs to transfer:
2: succeed otherwise: failed
*********************************************************/
s32 gtp_i2c_read(struct i2c_client *client u8 *buf s32 len)
{
struct i2c_msg msgs[2];
s32 ret=-1;
s32 retries = 0;
GTP_DEBUG_FUNC();
msgs[0].flags = !I2C_M_RD;
msgs[0].addr = client->addr;
msgs[0].len = GTP_ADDR_LENGTH;
msgs[0].buf = &buf[0];
//msgs[0].scl_rate = 300 * 1000; // for Rockchip etc.
msgs[1].flags = I2C_M_RD;
msgs[1].addr = client->addr;
msgs[1].len = len - GTP_ADDR_LENGTH;
msgs[1].buf = &buf[GTP_ADDR_LENGTH];
//msgs[1].scl_rate = 300 * 1000;
while(retries < 5)
{
ret = i2c_transfer(client->adapter msgs 2);
if(ret == 2)break;
retries++;
}
if((retries >= 5))
{
GTP_ERROR(“I2C Read: 0x%04X %d bytes failederrcode: %d! Process reset.“ (((u16)(buf[0] << 8)) | buf[1])len-2 ret);
{
gtp_reset_guitar(client 10);
}
}
return ret;
}
/*******************************************************
Function:
Write data to the i2c slave device.
Input:
client: i2c device.
buf[0~1]: write start address.
buf[2~len-1]: data buffer
len: GTP_ADDR_LENGTH + write bytes count
Output:
numbers of i2c_msgs to transfer:
1: succeed otherwise: failed
*********************************************************/
s32 gtp_i2c_write(struct i2c_client *clientu8 *bufs32 len)
{
struct i2c_ms
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 36919 2018-02-27 10:58 gt911\hjt_ts_gt911.c
文件 11676 2018-02-27 10:58 gt911\hjt_ts_gt911.h
目录 0 2018-03-21 12:47 gt911
----------- --------- ---------- ----- ----
48595 3
- 上一篇:身份证识别
- 下一篇:8位二进制计数器vhdl源程序及原理图
相关资源
- 南通OKI 5330打印机驱动 for win7 32+64位
- SSH Secure远程链接工具
- β cyclodextrin-induced Fluorescence Enhan
- 良哥独创Linux deepin电脑系统装回wind
- linuxdos(Explore2fs)一个windows系统下查
- Wong-Zakai Perturbation of Invariant Manifolds
- Arm-linux 自定义开机启动程序,避开从
- labelImg 1.7 for windows 标图软件
- FortiExplorerSetup
- Linux内核WIFI驱动详细源码
- linux2.6.11.12内核源码注释
- linux运维之道144632
- Codejock Suite Pro for Activex v18.6.0 x86
- 《Xilinx ZYNQ-7000 AP SoC开发实战指南》符
- Algorithms for reinforcement learning
- Linux教程复习资料以及课后习题答案
- Convex Optimization (Stanford CVX101)
- 高通9x07 软件架构及用户指导 mdm9x07
- Qt 拼音输入法
- 学习Linux的一些笔记.docx
- Bioinformatics Algorithms: an Active Learning
- MV-S103182-00_Datasheet for 88E6045 and 88E604
- awl-0.2.tar.gz TCP SYN洪水攻击 linux工具
- 3PAR高可用性解决方案 Peer Persistence
- Quectel_Windows_USB_Drivers_for_EC21&EC25;_V1.
-
Bare me
tal HDMI for ZedBoard with ADV7511 - 《网络服务器搭建与配置》实训指导
- Delphi.High.Performance.Applications.Concurren
- Kettle在Linux的安装使用
- SANGFOR深信服VISIO图标+产品图标
评论
共有 条评论