资源简介
ST系列三轴加速度传感器lis2ds12的基本驱动程序
代码片段和文件信息
/******************** (C) COPYRIGHT 2013 STMicroelectronics ********************
* File Name : main.c
* Author : MSH Application Team
* Author : Armando Visconti
* Revision : $Revision: 1.2 $
* Date : 09/2014
* Description : EKSTM32 main file
* HISTORY:
* Date | Modification | Author
* 08/2011 | Initial Revision | Armando Visconti
********************************************************************************
* THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS
* WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE TIME.
* AS A RESULT STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY DIRECT
* INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING FROM THE
* CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE CODING
* INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
*
* THIS SOFTWARE IS SPECIFICALLY DESIGNED FOR EXCLUSIVE USE WITH ST PARTS.
*******************************************************************************/
/* Includes ------------------------------------------------------------------*/
#include “stm32f10x.h“
#include “hw_config.h“
#include “i2C_mems.h“
#include “interruptHandler.h“
#include “LIS2DS12_ACC_driver.h“
/* This macro can be used to switch on/off the evaluation with interrupts */
#define TEST_WITH_FTH_INTERRUPT 1
#define FIFO_THRESHOLD 250
#define FIFO_SIZE 256
/* Private macro -------------------------------------------------------------*/
/* Private variables ---------------------------------------------------------*/
Type3Axis16bit_U Acceleration;
int Acceleration_G[FIFO_SIZE][3];
status_t response;
/* Extern variables ----------------------------------------------------------*/
/* Private function prototypes -----------------------------------------------*/
/* Private functions ---------------------------------------------------------*/
/*
* This part is needed in case we need to bypass the device ROM
*/
/*
* Accelerometer + FIFO in various modes
*/
static u32_t LIS2DS12_ACC_sample_calls = 0;
/*
* Callback to handle the XL event.
* It must be registered to be called at interrupt time.
*
* This is specific version for FIFO in Continuos mode
*/
static void LIS2DS12_ACC_sample_Callback(u8_t intID)
{
u16_t sample_num = 0 cnt = 0;
LIS2DS12_ACC_sample_calls++;
LIS2DS12_ACC_R_SamplesNum(&sample_num);
/* Read all the data. */
while (sample_num-- > 0)
LIS2DS12_ACC_Get_Acceleration(Acceleration_G[cnt++]);
}
/*
* Callback to handle the XL event.
* It must be registered to be called at interrupt time.
*
* This is specific version for FIFO in BTS mode
*/
static void LIS2DS12_ACC_sample_Callback_bts(u8_t intID)
{
u16_t sample_num = 0 cnt = 0;
LIS2DS12_ACC_FTH_STATUS_t F
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2015-06-19 21:49 LIS2DS12_Driver__Example_v1.5\
目录 0 2015-06-19 21:49 LIS2DS12_Driver__Example_v1.5\LIS2DS12_Driver\
文件 128430 2015-06-19 21:43 LIS2DS12_Driver__Example_v1.5\LIS2DS12_Driver\LIS2DS12_ACC_driver.c
文件 66325 2015-06-19 21:43 LIS2DS12_Driver__Example_v1.5\LIS2DS12_Driver\LIS2DS12_ACC_driver.h
文件 20533 2015-06-19 21:43 LIS2DS12_Driver__Example_v1.5\main_LIS2DS12_example.c
文件 440 2015-06-19 21:43 LIS2DS12_Driver__Example_v1.5\ReadMe.txt
- 上一篇:LPT变换源码
- 下一篇:ARM Mini2440 电路图.
相关资源
- intel parallel studio xe 2013 license file
- Materials Studio 7 lic
- 基于PSO_LSTM模型的变压器油中溶解气体
- Intel_parallel_studio_xe_2013_sp1_update3_for_
- SPWM逆变器stm32例程及电路图仿真.zip
- StaMPS_v3.2.1
- MPU6050(STM32 DMP).rar
- Discovery Studio分子动力学教程.pdf
- AXIS-interconnect-testbench.zip
- STM32F407 485 MODBUS
- Qt 写的http 请求使用POST Json
- DriverStudio3.2补丁DSDDKEnv.zip
- destoon 7.0-utf 全国地区四级联动数据
- STM32 hal库操作ESP8266
- ISO_IEC_24712_2007_Test_Pages 彩色打印标准
- STM32 STM32F103C8T6 读取DS18B20温度数据例
- STM32 STM32F103C8T6 CAN从机+4DI2DO 硬件设计
- 基于STC单片机的PID温度控制程序
- STM32外部计数器程序
- STMicroelectronics STM32及STM8全系列Altium
- GUI绘图系统(功能齐全)
- logistic回归病马训练集horseColicTrainin
- visual studio 2017社区版
- 基于STM32cubeMX,STM32F103C8T6的PWM输出实
- 华中科技大学 中国大学mooc 实验课e
- 服务端获取签名前端直传oss插件layu
- 申请国外博士的个人简历(CV)模板
- US100超声波代码stm32
- 基于STM32电力数据采集系统的设计
- STM32 之DHT11驱动程序
评论
共有 条评论