板子上有一颗IC:MMA7660FC,我们来试着读一下它的芯片手册,当然读的目的是为了驱动它。这也是我们驱动开发的目的:拿过来一块未知的IC,去读它的芯片手册,支持那种通讯协议,然后编码让它动起来。

he sensor has three power modes: Off Mode, Standby Mode, and Active Mode to offer the customer different power
consumption options. The sensor is only capable of running in one of these modes at a time.
支持三种模式:off mode,standby mode,active mode.

During the Active Mode, continuous measurement on all three axes is enabled. In addition, the user can choose to enable:Shake Detection, Tap Detection, Orientation Detection, and/or Auto-Wake/Sleep Feature and in this mode the digital analysis for any of these functions is done. The user can configure the samples per second to any of the following: 1 sample/second,2 samples/second, 4 samples/second, 8 samples/second, 16 samples/second, 32 samples/second, 64 samples/second, and 120 samples/second, for the Auto-Sleep state. If the user is configuring the Auto-Wake feature, the selectable ranges are:
1 sample/second, 8 samples/second, 16 samples/seconds and 32 samples/second. Depending on the samples per second selected the power consumption will vary.
在active mode下,3轴的连续测量是开启的。用户可选择开启:抖动检测,敲击检测,方向检测。或者 auto-wake auto sleep模式的切换。也可以配置每秒采样的率.

采样率配置:this can be configured in the SR (0x08) register.Once the user configurable samples per
second is chosen, the device will update the data for all 3 axes in the register at a resolution of 6-bits/axis

The user can choose to enable/disable any of the following interrupts in the INTSU (0x06) register: Front/Back Interrupt,
Up/Down/Left/Right Interrupt, Tap Detection Interrupt, GINT (real-time motion tracking), Shake on X-axis, Shake on Y-axis, and
Shake on Z-axis. If the GINT is enabled, real-time motion tracking can be configured to trigger an interrupt after every sensor data update
中断的配置在 INTSU(0x06) 寄存器里面.

寄存器相关:








slave addr:0x4c

write方式:

read方式:

相关的说明就这么多,至于后面的编程实现,我们需要参考这边的芯片手册来实现。所以芯片手册读懂,读通很重要。虽然很难读,可是读不懂没办法写代码。所以英文阅读和理解能力一定要好。猜测能力也要好些,剩下的就是经验和实验了。任何驱动不可能一下子就明白它的实现原理并立即把它实现出来,大多的需要try。
关于这颗IC我们就先介绍到这里.

linux驱动开发:重力传感器的了解相关推荐

  1. Linux驱动开发(十八)---网络(网卡)驱动学习

    前文回顾 <Linux驱动开发(一)-环境搭建与hello world> <Linux驱动开发(二)-驱动与设备的分离设计> <Linux驱动开发(三)-设备树> ...

  2. Linux驱动开发—内核I2C驱动详解

    Linux驱动开发--内核I2C驱动 I2C驱动文件结构 I2C数据传输过程 i2c_transfer i2c_msg I2C通讯常用的接口函数(老版本) 快速读写接口函数:(连续读写) 常用的读操作 ...

  3. Linux驱动开发工程师需要掌握哪些技能?

    一.前言 Linux驱动开发是一项高度技术性的工作,需要深厚的编程技能和对计算机硬件的深入理解.随着物联网.人工智能等领域的快速发展,Linux驱动开发工程师的需求日益增加.在这篇文章中,我将为您介绍 ...

  4. linux驱动开发(转载自正点原子)

    一.Linux驱动开发思维 1.Linux下驱动开发直接操作寄存器不现实. 2.根据Linux下的各种驱动框架进行开发.一定要满足框架,也就是Linux下各种驱动框架的掌握. 3.驱动最终表现就是/d ...

  5. 嵌入式linux驱动开发之点亮led(驱动编程思想之初体验)

    这节我们就开始开始进行实战啦!这里顺便说一下啊,出来做开发的基础很重要啊,基础不好,迟早是要恶补的.个人深刻觉得像这种嵌入式的开发对C语言和微机接口与原理是非常依赖的,必须要有深厚的基础才能hold的 ...

  6. Linux驱动开发环境配置(内核源码树构造)

    来源:季义钦BLOG 作者:季义钦 初次接触Linux驱动程序开发,买了一本<Linux设备驱动程序>,第一件事当然就是构建开发环境了!!! 它上面有一个Hello World的列子: / ...

  7. linux驱动开发的经典书籍

    Linux驱动学习的最大困惑在于书籍的缺乏,市面上最常见的书为<linux_device_driver 3rd Edition>,这是一本很经典的书,无奈Linux的东东还是过于庞大,这本 ...

  8. Linux驱动开发必看详解神秘内核(完全转载)

    Linux驱动开发必看详解神秘内核 完全转载-链接:http://blog.chinaunix.net/uid-21356596-id-1827434.html IT168 技术文档]在开始步入Lin ...

  9. 【嵌入式Linux】嵌入式Linux驱动开发基础知识之Pinctrl子系统和GPIO子系统的使用

    文章目录 前言 1.Pinctrl子系统 1.1.为什么有Pinctrl子系统 1.2.重要的概念 1.3.代码中怎么引用pinctrl 2.GPIO子系统 2.1.为什么有GPIO子系统 2.2.在 ...

  10. 【嵌入式Linux】嵌入式Linux驱动开发基础知识之按键驱动框架

    文章目录 前言 1.APP怎么读取按键值 1.1.查询方式 1.2.休眠-唤醒方式 1.3.poll方式 1.3.异步通知方式 1.5. 驱动程序提供能力,不提供策略 2.按键驱动程序框架--查询方式 ...

最新文章

  1. python随机选取列表中的一个字符串_如何从Python中的列表中选择随机字符串?
  2. get_headers()请求https报错解决思路
  3. 20行python代码的入门级小游戏-200行Python代码实现的2048小游戏
  4. Java虚拟机 —— 运行时数据区
  5. 一分钟教你用Excel从统计局抓数据!
  6. 【Java】矩阵乘法的朴素算法
  7. Kafka 与Spark的集成
  8. linux线程计算,有关Linux进程与线程数目计算的问题
  9. (三)使用Keras构建移动风格迁移CycleGAN
  10. Qt4_实现其他菜单
  11. 8.Linux 高性能服务器编程 --- 高性能服务器程序框架
  12. 优云软件又双叒通过CMMI ML3评估 , 研发和质量管理水平创新高
  13. 《数据结构与抽象:Java语言描述(原书第4版)》一第2章
  14. The NMEA 0183 Protocol
  15. 计算机开放电子书 2016 归档
  16. 【工具篇】Unity迷宫地图生成器MazeSpawner随机迷宫信手拈来
  17. 如何向弱智程序员解释区块链
  18. R语言检测异常值的几个案例
  19. 电机驱动模块--L298N
  20. canvas绘制图形API(一)

热门文章

  1. 无法通过“控制面板”卸载 Office 2003、Office 2007 或 Office 2010 套件的情况下,如何才能将其卸载?...
  2. Linux中进程和计划任务管理
  3. Linux系统中使用linux-wifi-hotspot工具开启网络热点
  4. 照片背景底色更换工具二(python+flask网页版使用演示)
  5. 运用BeanUtils构建通用的查询 更新方法(个人拙作,不喜勿喷)
  6. 购买云服务器选择阿里云的理由(个人见解)
  7. vmware workstaion16安装windows10系统教程
  8. 理论:如何调整四轴4个电机的转速,使飞行器朝不同方向运动
  9. error C2872: “flann”: 不明确的符号 --- PCL 与OpenCV2 的flann命名空间冲突问题的解决方法
  10. DELL升级bios方式