完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
你好,
我对VL53L0X的API开发人员提出了一些问题(此传感器的其他用户的帮助也受到高度赞赏)。在下一段中,您可以找到我已经与客户威廉希尔官方网站 支持共享的文本,我从中得不到答案。最后他们任命我参加这个论坛。我的请求: 为了使用上面提到的传感器并从中获得最佳结果,我打算使用交付的API,而不是必须处理传感器的所有众多寄存器。这个建议公开了你建议使用API(因为没有真正的寄存器)。 我唯一的问题是调整(修改)API以匹配我想要使用的微控制器,即Amel ARM Cortex-M7。 在我看来,最重要的修改部分是I2C通信接口。 我的问题是: - 我想从您的软件开发人员那里获得一些头条新闻。我想知道为了使API工作而不必重写API并且必须在最低寄存器级别处理传感器,已经修改的软件的重要位置是什么。 API应该可以针对所有平台进行调整,至少它是在您的网站上编写的。 如果你能迅速回答,我会很高兴的。 提前致谢 #cortex-m#vl53l0x#atmel-studio 以上来自于谷歌翻译 以下为原文 Hello, I have some questions to the developers of the API of the VL53L0X (Help from fellow users of this sensor is also highly appreciated). In the next paragraph you find the text which I already shared with customer technical support, from which I got no answer. Finally they appointed me to this forum. My request: In order to use the above mentioned sensor and get the best results out of it I am intending to use the delivered API instead of having to deal with all numerous registers of the sensor. This proposal is made open your recommendation to use the API (and since there is no real ma of the registers). My only problem is to adapt (modify) the API to match the microcontroller I want to use, namely the Amel ARM Cortex-M7. In my opinion the most important part to modify is the I2C communication interface. My question is: - I would like to have some headlines from your software developers. I would like to know what are the important spots of the software which have be modified in order to get the API working without having to rewrite the API and having to deal with the sensor at the lowest register level. The API should be adjustable for all platforms, at least it is written so on your website. I'd be very pleased if you would answer quickly. Thanks in advance #cortex-m #vl53l0x #atmel-studio |
|
相关推荐
6个回答
|
|
Hy Manuel,
我刚刚将软件移植到目标硬件(TI ARM)。这非常简单:我只需要将vl53l0x_platform.c和vl53l0x_platform.h调整到我的系统。 实际上,有一个陷阱:显然有两种不同的关于I2C地址的哲学:7位地址出现在位7..1的控制字中,因此在控制字中,地址向左移位一位。 ST.com命名总线上出现的I2C地址(0x52),我的I2C接口需要真正的I2C地址(0x29)。 其他任何工作都很好。 最好的祝福 哈拉尔 以上来自于谷歌翻译 以下为原文 Hy Manuel, I just went through porting the software to my target hardware (TI ARM). It was pretty straightforward: I just needed to adjust the vl53l0x_platform.c and vl53l0x_platform.h to my system. Actually, there is one pitfall: Apparently there are two different philosopies about I2C addresses: The 7 bit address appears in the control word on bit 7..1, so in the control word the address is shifted one bit left. ST.com names the I2C address as it appears on the bus (0x52), my I2C interface expects the real I2C address (0x29). Anything else works just fine. Best regards Harald |
|
|
|
来自Soren Karlsen:
嗨Harald,我在调整VL53L0X的平台代码方面遇到了同样的问题,正如你在这个帖子中回答的那样: https://community.st.com/0D50X00009XkdtPSAR 当你说你只需要调整文件到系统时,你实际做了什么,是否有可能向我展示和示例? 最好的祝福 萨恩 注意:原始帖子包含大量线程对话,只能迁移到第9级 以上来自于谷歌翻译 以下为原文 From Soren Karlsen: Hi Harald, I'm sitting with the same problem about adapting platform code for VL53L0X as you answered in this thread: https://community.st.com/0D50X00009XkdtPSAR When you say you just needed to adjust the files to your system, what did you actually do, and is it possible that you can show me and example? Best regards Søren Note: the original post contained a large number of threaded conversations and was only able to be migrated to the 9th level |
|
|
|
Hy Soren,
在开发过程中,我有一个工作 http://www.st.com/content/st_com/en/products/ecosystems/stm32-open-development-environment/stm32-nucleo-expansion-boards/stm32-ode-sense-hw/p-nucleo-53l0a1。 HTML 这有点帮助。把它移植到我自己的系统(TI ARM,3 x VL53L0X,离散关闭引脚)我首先将vl53l0x文件夹中的所有文件复制到我的项目中 vl53l0x Release_Notes.html VL53L0X_API_v1.0.0.4570_externalx.chm VL53L0X_API_v1.0.0.4570_externalx.chw vl53l0x_api.c vl53l0x_api.h vl53l0x_api_calibration.c vl53l0x_api_calibration.h vl53l0x_api_core.c vl53l0x_api_core.h vl53l0x_api_ranging.c vl53l0x_api_ranging.h vl53l0x_api_strings.c vl53l0x_api_strings.h vl53l0x_def.h vl53l0x_device.h vl53l0x_interrupt_threshold_settings.h vl53l0x_platform.c vl53l0x_platform.h vl53l0x_platform_log.c vl53l0x_platform_log.h vl53l0x_tuning.h vl53l0x_types.h然后我只需要调整文件'vl53l0x_platform.c'并重写其中的所有函数以适合我自己的硬件。对I2C地址的不同解释存在一个缺陷,但其余的工作都相当顺利。 然后我逐步测试并实现了功能:测试关闭引脚,测试读取签名字节,测试更改I2C地址,测试开始测量和读取结果。我最终使用了两个函数:startSingleMeas VL53L0X_Error startSingleMeas(VL53L0X_DEV Dev) { VL53L0X_Error状态= VL53L0X_ERROR_NONE; VL53L0X_DeviceModes DeviceMode; / *此功能将完成单个测距 *我们在这里修复模式! * / Status = VL53L0X_SetDeviceMode(Dev,VL53L0X_DEVICEMODE_SINGLE_RANGING); / *获取当前DeviceMode * / if(Status == VL53L0X_ERROR_NONE) Status = VL53L0X_GetDeviceMode(Dev,& DeviceMode); / *立即启动以运行单个测距测量 *单一测距或单一直方图* / if(Status == VL53L0X_ERROR_NONE &安培;&安培; DeviceMode == VL53L0X_DEVICEMODE_SINGLE_RANGING) Status = VL53L0X_StartMeasurement(Dev);返回状态; }和pollAndReadMeasurement / ** *轮询数据就绪并准备好读取数据 *如果读取数据则返回0,如果仍然忙则返回100而错误时返回负值 * / VL53L0X_Error pollAndReadMeasurement(VL53L0X_DEV Dev, VL53L0X_RangingMeasurementData_t * pRangingMeasurementData) { VL53L0X_Error状态= VL53L0X_ERROR_NONE; if(Status == VL53L0X_ERROR_NONE) { uint8_t NewDataReady = 0; Status = VL53L0X_GetMeasurementDataReady(Dev,& NewDataReady); if((Status == VL53L0X_ERROR_NONE)&&(NewDataReady == 0)) { 状态= 100; //还在测量 } } if(Status == VL53L0X_ERROR_NONE) { //完成测量,读出值 PALDevDataSet(Dev,PalState,VL53L0X_STATE_IDLE); Status = VL53L0X_GetRangingMeasurementData(Dev,pRangingMeasurementData); if(Status == VL53L0X_ERROR_NONE) Status = VL53L0X_ClearInterruptMask(Dev,0); } 返回状态; 也许这有帮助...... 最好的祝福 哈拉尔 以上来自于谷歌翻译 以下为原文 Hy Soren, during the development I had a working http://www.st.com/content/st_com/en/products/ecosystems/stm32-open-development-environment/stm32-nucleo-expansion-boards/stm32-ode-sense-hw/p-nucleo-53l0a1.html , that helped a lot.To port it into my own system (TI ARM, 3 x VL53L0X, discrete shut down pins) I first copied all files from vl53l0x folder into my project vl53l0x Release_Notes.html VL53L0X_API_v1.0.0.4570_externalx.chm VL53L0X_API_v1.0.0.4570_externalx.chw vl53l0x_api.c vl53l0x_api.h vl53l0x_api_calibration.c vl53l0x_api_calibration.h vl53l0x_api_core.c vl53l0x_api_core.h vl53l0x_api_ranging.c vl53l0x_api_ranging.h vl53l0x_api_strings.c vl53l0x_api_strings.h vl53l0x_def.h vl53l0x_device.h vl53l0x_interrupt_threshold_settings.h vl53l0x_platform.c vl53l0x_platform.h vl53l0x_platform_log.c vl53l0x_platform_log.h vl53l0x_tuning.h vl53l0x_types.hThen I needed to do adjust only the file 'vl53l0x_platform.c' and rewrite all functions in there to suit my own hardware. There is this one pitfall with the different interpretation of I2C addresses, but all the rest worked quite smoothly. Then I tested and implemented step by step the functionality: Test shutdown pins, test read of the signature byte, test changing the I2C address, test start a measurement and the read the result. I ended up using two functions: startSingleMeas VL53L0X_Error startSingleMeas(VL53L0X_DEV Dev) { VL53L0X_Error Status = VL53L0X_ERROR_NONE; VL53L0X_DeviceModes DeviceMode; /* This function will do a complete single ranging * Here we fix the mode! */ Status = VL53L0X_SetDeviceMode(Dev, VL53L0X_DEVICEMODE_SINGLE_RANGING); /* Get Current DeviceMode */ if (Status == VL53L0X_ERROR_NONE) Status = VL53L0X_GetDeviceMode(Dev, &DeviceMode); /* Start immediately to run a single ranging measurement in case of * single ranging or single histogram */ if (Status == VL53L0X_ERROR_NONE && DeviceMode == VL53L0X_DEVICEMODE_SINGLE_RANGING) Status = VL53L0X_StartMeasurement(Dev); return Status; }and pollAndReadMeasurement /** * polls for data ready and reads data if ready * returns 0 if data was read, 100 if still busy and negative on error */ VL53L0X_Error pollAndReadMeasurement(VL53L0X_DEV Dev, VL53L0X_RangingMeasurementData_t *pRangingMeasurementData) { VL53L0X_Error Status = VL53L0X_ERROR_NONE; if (Status == VL53L0X_ERROR_NONE) { uint8_t NewDataReady = 0; Status = VL53L0X_GetMeasurementDataReady(Dev, &NewDataReady); if ((Status == VL53L0X_ERROR_NONE) && (NewDataReady == 0)) { Status = 100; // still measuring } } if (Status == VL53L0X_ERROR_NONE) { // measurement done, read out values PALDevDataSet(Dev, PalState, VL53L0X_STATE_IDLE); Status = VL53L0X_GetRangingMeasurementData(Dev, pRangingMeasurementData); if (Status == VL53L0X_ERROR_NONE) Status = VL53L0X_ClearInterruptMask(Dev, 0); } return Status; }Maybe that helps... Best regards Harald |
|
|
|
好吧,我的第一次尝试无论如何都没有用(即使代码有效,也需要太多空间)。但是当你说你'调整vl53l0x_platform.c并重写其中的所有功能以适合我自己的硬件'你实际上做了什么?你调整了什么?
以上来自于谷歌翻译 以下为原文 Well, my first attempts didn't work anyway (even though the code works, it takes too much space). But when you say that you 'adjust vl53l0x_platform.c and rewrite all functions in there to suit my own hardware' what do you actually do? what do you adjust? |
|
|
|
大家好。让我问你一个愚蠢的问题,但我甚至无法使用VL53L0X API构建我的程序。我从ST网站(v 1.0.2)下载了它,并将所有.h和.c文件包含在项目工作区(来自'Api'文件夹)中。我目前使用的是Accleo F103板,使用的是Ac6 IDE。我只需要执行单个测距测量并根据结果执行某个操作,我不关心与任何GUI应用程序的某些奇特的串行通信。在构建时我得到一个< Windows.h>的错误。在vl53l0x.c库中找不到......好吧,即使我解决了这个问题,我的错误也会比一开始时多得多。我真的需要以某种方式调整此API以继续通过最简单的功能吗?有没有描述怎么做?在我看来,我已经检查过各处,传感器和api文档......
以上来自于谷歌翻译 以下为原文 Hello guys. Let me ask you maybe a silly question but I just can't get my program even building with the VL53L0X API. I downloaded it from the ST website (v 1.0.2) and included all .h and .c files into the project workspace (from the 'Api' folder). I currently work with the Nucleo F103 board, using the Ac6 IDE. All I need is just to perform a single ranging measurement and perform a certain action depending on the results, I do not care about some fancy serial communication with any GUI app. While building I get an error that the |
|
|
|
HI Harald,
你的代码 和 差不多了。我开始并在一段时间之后民意调查成真。现在我打印出整个输出结构: TimeStamp 0 MeasurementTimeUsec 0 RangeMilliMeter 0 RangeDMaxMilliMeter 2048 SignalRateRtnMegaCps 33553920 AmbientRateRtnMegaCps 33553920 EffectiveSpadRtnCount 65535 RangeFractionalPart 0 ZoneId 0 RangeStatus 5nd rangeStatus必须为0才能有效测量。知道为什么会这样吗? 以上来自于谷歌翻译 以下为原文 HI Harald, Your code and nearly works. Im starting and after some time the poll gets true. Now i printed the whole output structure: TimeStamp 0 MeasurementTimeUsec 0 RangeMilliMeter 0 RangeDMaxMilliMeter 2048 SignalRateRtnMegaCps 33553920 AmbientRateRtnMegaCps 33553920 EffectiveSpadRtnCount 65535 RangeFractionalPart 0 ZoneId 0 RangeStatus 5And rangeStatus has to be 0 to have a valid measurement. Any idea why this happens? |
|
|
|
只有小组成员才能发言,加入小组>>
请教:在使用UDE STK时,单片机使用SPC560D30L1,在配置文件怎么设置或选择?里面只有SPC560D40的选项
2805 浏览 1 评论
3258 浏览 1 评论
请问是否有通过UART连接的两个微处理器之间实现双向值交换的方法?
1833 浏览 1 评论
3684 浏览 6 评论
6083 浏览 21 评论
对H747I-DISCO写程序时将CN2的st-link复用为usart1,再次烧录时无法检测到stlink怎么解决?
386浏览 2评论
STM32G474RE芯片只是串口发个数据就发烫严重是怎么回事?
476浏览 2评论
STM32处理增量式编码器Z信号如何判断中断是正转的还是反向转的?
306浏览 2评论
使用STM32F407VET6的USB2.0功能,发现ctl后芯片无数据返回,是什么原因可能导致的呢?
224浏览 2评论
用STM32G431开发工程,1.50版本的Package包文件无法输出项目工程
328浏览 2评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2025-1-27 07:31 , Processed in 1.126952 second(s), Total 56, Slave 50 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号