资源简介
ST原厂LSM6DSL I2C总线驱动
In the 'driver' folder there are the driver files of Mems Sensor (.h and .c)
to be included in your project.
Driver documentation can be generate using Doxigen tool.
The driver is platform independent, you need only to complete the two functions
for write and read from Mems Ha
代码片段和文件信息
/*
******************************************************************************
* @file lsm6dsl_reg.c
* @author MEMS Software Solution Team
* @brief LSM6DSL driver file
******************************************************************************
* @attention
*
* © COPYRIGHT(c) 2018 STMicroelectronics
*
* Redistribution and use in source and binary forms with or without modification
* are permitted provided that the following conditions are met:
* 1. Redistributions of source code must retain the above copyright notice
* this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* 3. Neither the name of STMicroelectronics nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS“
* AND ANY EXPRESS OR IMPLIED WARRANTIES INCLUDING BUT NOT LIMITED TO THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT INDIRECT INCIDENTAL SPECIAL EXEMPLARY OR CONSEQUENTIAL
* DAMAGES (INCLUDING BUT NOT LIMITED TO PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE DATA OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY WHETHER IN CONTRACT STRICT LIABILITY
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
#include “lsm6dsl_reg.h“
/**
* @addtogroup lsm6dsl
* @brief This file provides a set of functions needed to drive the
* lsm6dsl enanced inertial module.
* @{
*/
/**
* @addtogroup interfaces_functions
* @brief This section provide a set of functions used to read and write
* a generic register of the device.
* @{
*/
/**
* @brief Read generic device register
*
* @param lsm6dsl_ctx_t* ctx: read / write interface definitions
* @param uint8_t reg: register to read
* @param uint8_t* data: pointer to buffer that store the data read
* @param uint16_t len: number of consecutive register to read
*
*/
int32_t lsm6dsl_read_reg(lsm6dsl_ctx_t* ctx uint8_t reg uint8_t* data
uint16_t len)
{
int32_t ret;
ret = ctx->read_reg(ctx->handle reg data len);
return ret;
}
/**
* @brief Write generic device register
*
* @param lsm6dsl_ctx_t *ctx: read / write interface definitions
* @param uint8_t reg: register to write
* @param uint8_t* data: pointer to data to write in register reg
* @param uint16_t len: number of
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2018-06-04 11:00 lsm6dsl_STdC\
目录 0 2018-06-04 11:00 lsm6dsl_STdC\driver\
文件 181848 2018-06-04 11:00 lsm6dsl_STdC\driver\lsm6dsl_reg.c
文件 70255 2018-06-04 11:00 lsm6dsl_STdC\driver\lsm6dsl_reg.h
目录 0 2018-06-04 11:00 lsm6dsl_STdC\example\
文件 9574 2018-06-04 11:00 lsm6dsl_STdC\example\read_data_simple.c
文件 555 2018-06-04 11:00 lsm6dsl_STdC\README.txt
评论
共有 条评论