资源简介
基于F4的HAL库的STM32使用VL53L0X的例程,其中对VL53L0X的库做了精简封装,只需要调用一次初始化函数,以后便可以使用读取函数不停的读取了.启动参数可以在初始化函数中自行更改.可以很方便的移植HAL库的其他工程,只需要稍微更换头文件.
代码片段和文件信息
/*******************************************************************************
Copyright ?2016 STMicroelectronics International N.V.
All rights reserved.
Redistribution and use in source and binary forms with or without
modification are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
notice this list of conditions and the following disclaimer.
* 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.
* 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 FITNESS FOR A PARTICULAR PURPOSE AND
NON-INFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS ARE DISCLAIMED.
IN NO EVENT SHALL STMICROELECTRONICS INTERNATIONAL N.V. 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 “vl53l0x_api.h“
#include “vl53l0x_tuning.h“
#include “vl53l0x_interrupt_threshold_settings.h“
#include “vl53l0x_api_core.h“
#include “vl53l0x_api_calibration.h“
#include “vl53l0x_api_strings.h“
#ifndef __KERNEL__
#include
#endif
#define LOG_FUNCTION_START(fmt ...) \
_LOG_FUNCTION_START(TRACE_MODULE_API fmt ##__VA_ARGS__)
#define LOG_FUNCTION_END(status ...) \
_LOG_FUNCTION_END(TRACE_MODULE_API status ##__VA_ARGS__)
#define LOG_FUNCTION_END_FMT(status fmt ...) \
_LOG_FUNCTION_END_FMT(TRACE_MODULE_API status fmt ##__VA_ARGS__)
#ifdef VL53L0X_LOG_ENABLE
#define trace_print(level ...) trace_print_module_function(TRACE_MODULE_API \
level TRACE_FUNCTION_NONE ##__VA_ARGS__)
#endif
/* Group PAL General Functions */
VL53L0X_Error VL53L0X_GetVersion(VL53L0X_Version_t *pVersion)
{
VL53L0X_Error Status = VL53L0X_ERROR_NONE;
LOG_FUNCTION_START(““);
pVersion->major = VL53L0X_IMPLEMENTATION_VER_MAJOR;
pVersion->minor = VL53L0X_IMPLEMENTATION_VER_MINOR;
pVersion->build = VL53L0X_IMPLEMENTATION_VER_SUB;
pVersion->revision = VL53L0X_IMPLEMENTATION_VER_REVISION;
LOG_FUNCTION_END(Status);
return Status;
}
VL53L0X_Error VL53L0X_GetPalSpecVersion(
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 13 2018-04-22 23:39 Simple_VL53L0X\.git\COMMIT_EDITMSG
文件 291 2018-04-22 23:41 Simple_VL53L0X\.git\config
文件 73 2018-04-22 23:38 Simple_VL53L0X\.git\desc
文件 23 2018-04-22 23:39 Simple_VL53L0X\.git\HEAD
文件 478 2018-04-22 23:38 Simple_VL53L0X\.git\hooks\applypatch-msg.sample
文件 896 2018-04-22 23:39 Simple_VL53L0X\.git\hooks\commit-msg.sample
文件 189 2018-04-22 23:39 Simple_VL53L0X\.git\hooks\post-update.sample
文件 424 2018-04-22 23:39 Simple_VL53L0X\.git\hooks\pre-applypatch.sample
文件 1642 2018-04-22 23:39 Simple_VL53L0X\.git\hooks\pre-commit.sample
文件 1348 2018-04-22 23:39 Simple_VL53L0X\.git\hooks\pre-push.sample
文件 4898 2018-04-22 23:39 Simple_VL53L0X\.git\hooks\pre-reba
文件 544 2018-04-22 23:39 Simple_VL53L0X\.git\hooks\pre-receive.sample
文件 1492 2018-04-22 23:39 Simple_VL53L0X\.git\hooks\prepare-commit-msg.sample
文件 3610 2018-04-22 23:39 Simple_VL53L0X\.git\hooks\update.sample
文件 2163 2018-04-22 23:39 Simple_VL53L0X\.git\index
文件 240 2018-04-22 23:39 Simple_VL53L0X\.git\info\exclude
文件 153 2018-04-22 23:39 Simple_VL53L0X\.git\logs\HEAD
文件 153 2018-04-22 23:39 Simple_VL53L0X\.git\logs\refs\heads\master
文件 137 2018-04-22 23:42 Simple_VL53L0X\.git\logs\refs\remotes\origin\master
文件 2620 2018-04-22 23:39 Simple_VL53L0X\.git\ob
文件 1009 2018-04-22 23:39 Simple_VL53L0X\.git\ob
文件 2943 2018-04-22 23:39 Simple_VL53L0X\.git\ob
文件 3061 2018-04-22 23:39 Simple_VL53L0X\.git\ob
文件 474 2018-04-22 23:39 Simple_VL53L0X\.git\ob
文件 14358 2018-04-22 23:39 Simple_VL53L0X\.git\ob
文件 1436 2018-04-22 23:39 Simple_VL53L0X\.git\ob
文件 3513 2018-04-22 23:39 Simple_VL53L0X\.git\ob
文件 15720 2018-04-22 23:39 Simple_VL53L0X\.git\ob
文件 111 2018-04-22 23:39 Simple_VL53L0X\.git\ob
文件 2300 2018-04-22 23:39 Simple_VL53L0X\.git\ob
............此处省略89个文件信息
- 上一篇:圣诞节桌面下雪效果的小程序
- 下一篇:SPI按键显示接口设计
相关资源
- 基于STM32F4x9的LCD显示
- VS1053B编解码器的VDR分布式声音采集卡
- stm32的DAC播放音乐文件
- STM32+TMC5160代码电路图.rar
- 基于STM32的深海钻机甲板控制系统
- stm32f103.SchDoc
- STM32F103 USART+DMA
- DMA+stm32 407.zip
- 4_USART串口通信(空闲中断+DMA.zip
- stm32f105-usart-DMA收发demo
- STM32F042F6P6 Uart12DMA;发送中断接收
- 基于STM32的嵌入式双目图像采集系统设
- 基于STM32F103C8单片机的晶联讯电子JL
- VL53L0X激光测距传感器资料
- 基于STM32的温湿度检测系统实现
- stm32F4+w5300
- 14284969_《STM32单片机应用与全案例实践
-
ST-li
nk-V2的SWD仿真使用方法.docx - 安富莱STM32开发板资料
- STM32F103实现OV7670摄像头显示
- STM32F207学习板例程
- STM32F103VCT6TR - High-density performance lin
- STM32 SRAM启动的 KeiL 配置
- STM32的IAP-Bootloader程序
- STM32例程之Bootloader
- stm32f103 虚拟U盘,调试成功的
- 基于stm32F103vct6的SD卡FATFS文件系统移植
- STM32F030从机中断接收的iic代码,附带
- FreeModbus_Slave+STM32F407+USART2代码亲测可
- STM32+1602液晶proteus仿真.zip
评论
共有 条评论