資源簡介
ST原廠LSM6DSL I2C總線驅(qū)動
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?“l(fā)sm6dsl_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
評論
共有 條評論