资源简介
QST 加速度传感器QMA6981 MTK6737驱动,QST 加速度传感器QMA6981 MTK6737驱动
代码片段和文件信息
/* qma6981 motion sensor driver
*
*
*
* This software is licensed under the terms of the GNU General Public
* License version 2 as published by the Free Software Foundation and
* may be copied distributed and modified under those terms.
*
* This program is distributed in the hope that it will be useful
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*/
#include
#include
#include “qma6981.h“
#define QMA6981_STEP_COUNTER
#ifdef QMA6981_STEP_COUNTER
#define QMA6981_STEP_COUNTER_USE_INT
#define QMA6981_CHECK_ABNORMAL_DATA
//#define QMA6981_STEP_TO_ZERO
#define QMA6981_SELECT_AXIS
#endif
#include
#include
#include
#include
//step counter
#include
#include
#ifdef QMA6981_STEP_COUNTER
#include
#endif
#include
//prize-lixuefeng-20150512-start
#if defined(CONFIG_PRIZE_HARDWARE_INFO)
#include “../../hardware_info/hardware_info.h“
extern struct hardware_info current_gsensor_info;
#endif
//prize-lixuefeng-20150512-end
#define QMA6981_RETRY_COUNT 3
#define qma6981_BUFSIZE 256
#define GSE_TAG “[QMA-Gsensor] “
#define GSE_ERR(fmt args...) pr_err(GSE_TAG “%s %d : “ fmt __FUNCTION__ __LINE__ ##args)
#define GSE_FUN(f) pr_err(GSE_TAG “%s\n“ __FUNCTION__)
#define GSE_DEBUG
#ifdef GSE_DEBUG
#define GSE_LOG(fmt args...) printk(“%s %d : “ fmt __FUNCTION__ __LINE__ ##args)
#else
#define GSE_LOG(fmt args...)
#endif
#define kal_bool bool
#define KAL_TRUE true
#define KAL_FALSE false
static struct acc_hw accel_cust;
static struct acc_hw *hw = &accel_cust;
static int qma6981_init_flag =0;
static DEFINE_MUTEX(qma6981_init_mutex);
static DEFINE_MUTEX(qma6981_mutex);
#if defined(QMA6981_STEP_COUNTER_USE_INT)
//extern struct platform_device *get_acc_platformdev(void);
//struct platform_device *accPltFmDev;
#endif
#if defined(CONFIG_HAS_EARLYSUSPEND)
static void qma6981_early_suspend(struct early_suspend *h);
static void qma6981_late_resume(struct early_suspend *h);
#endif
static struct acc_init_info qma6981_init_info;
#ifdef QMA6981_STEP_COUNTER
static struct step_c_init_info qma6981_step_c_init_info;
static struct wake_lock sc_wakelock;
static kal_bool wake_lock_status = KAL_FALSE;
static int sc_reset_flag = KAL_TRUE;// store last data
static int qma6981_step_c_read_stepCounter(int *data);
static void qma6981_set_wakelock(int en);
#if 1//defined(QMA6981_STEP_TO_ZERO)
static char qma6981_reg13_value = 0x10;
#endif
#define QMA6981_REG13_LOW_VALUE 0x0c //0x0a
#define QMA6981_REG13_HIGH_VALUE 0x11 //0x10
#endif
struct qma6981_data{
struct acc_hw *hw;
struct i2c_client *client;
struct hwmsen_convert cvt;
int sensitivity;
atomic_t layout;
atomic_t trace;
atomic_
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 204 2016-09-21 20:51 accelerometer\Kconfig
文件 149 2016-09-21 20:50 accelerometer\Makefile
文件 81670 2017-09-01 15:44 accelerometer\qma6981\qma6981.c
文件 80524 2017-06-07 12:28 accelerometer\qma6981\qma6981.c.bak
文件 1768 2017-02-15 09:53 accelerometer\qma6981\qma6981.h
文件 24942 2017-02-17 11:35 step_counter\step_counter.c
文件 3710 2017-02-17 11:35 step_counter\step_counter.h
文件 394793 2017-07-04 10:28 图片\config.jpg
文件 428040 2017-07-04 10:27 图片\project.jpg
文件 2069 2017-02-17 10:15 cust_eint.dtsi
文件 88625 2017-02-21 14:55 mt6735.dtsi
文件 34479 2017-03-07 22:29 pri6737t_66_m0.dts
文件 1975 2017-07-04 10:33 移植说明.txt
目录 0 2017-09-01 15:44 accelerometer\qma6981
目录 0 2017-09-01 10:28 accelerometer
目录 0 2017-09-01 10:28 step_counter
目录 0 2017-09-01 15:45 图片
----------- --------- ---------- ----- ----
1142948 17
- 上一篇:二分法Fortran代码
- 下一篇:地籍检查程序
相关资源
- LINUX下的MODBUS-RTU驱动程序
- NVIDIA 显卡驱动for Windows server 2012R2
- 全网首发,ESXi670-202010001合成RealTek网
- Agilent 34410A Driver
- NVIDIA显卡2080ti for windows server 2012R2驱动
- 研华采集卡驱动 DAQNavi_SDK_Drivers_4.1.
- linux下基于QT和v4l2驱动的USB摄像头视频
- PCI串行口驱动 PCI串行口驱动
- 128*32OLED点阵屏驱动已移植GUI
- 微软microsoft_xbox360摄像头驱动
- AVR单片机ATmega16L驱动一个数码管Prot
- 霍尔传感器应用于无刷电机驱动控制
- Linux设备驱动
- AT91RM9200的SPI设备驱动程序开发.pdf
- miniFilter(所有框架代码以及对应的
- CH452键盘数码管驱动程序配有电路图
- Window文件监控微过滤驱动
- STM32驱动max6675测温的测试例程
- MSP430 USB转串口驱动
- cc debugger 驱动
- CH452驱动程序及说明书
- AT89S52控制DDS9850产生可调频的正弦波
- ADE7753电能表芯片的驱动程序
- ifix软狗驱动 支持 3.5 4.0 4.5 5.0
- 用FPGA实现CCD的驱动VerilogHDL
- 用驱动获取cpu的温度
- esp32 sdk编程利用rmt驱动ws2812七彩灯,
- 乐鑫esp8266 NONOS SDK 3.0编程使用 SPI 驱动
- epson驱动串口黑标打印控制代码 delp
- tm1628 用作键盘和时钟led显示屏的驱动
评论
共有 条评论