Skip to content

Commit 6f985bb

Browse files
authored
Merge pull request #11 from cparata/master
Add VL53L1X_SetROICenter VL53L1X_GetROICenter APIs for people countin…
2 parents 5b65497 + 64d5732 commit 6f985bb

File tree

4 files changed

+30
-1
lines changed

4 files changed

+30
-1
lines changed

keywords.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@ VL53L1X_GetDistanceThresholdLow KEYWORD2
5555
VL53L1X_GetDistanceThresholdHigh KEYWORD2
5656
VL53L1X_SetROI KEYWORD2
5757
VL53L1X_GetROI_XY KEYWORD2
58+
VL53L1X_SetROICenter KEYWORD2
59+
VL53L1X_GetROICenter KEYWORD2
5860
VL53L1X_SetSignalThreshold KEYWORD2
5961
VL53L1X_GetSignalThreshold KEYWORD2
6062
VL53L1X_SetSigmaThreshold KEYWORD2

library.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name=STM32duino VL53L1X
2-
version=1.0.3
2+
version=1.1.0
33
author=AST
44
maintainer=stm32duino
55
sentence=Allows controlling the VL53L1X (Time-of-Flight and gesture detection sensor)

src/vl53l1x_class.cpp

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -786,6 +786,22 @@ VL53L1X_ERROR VL53L1X::VL53L1X_GetROI_XY(uint16_t *ROI_X, uint16_t *ROI_Y)
786786
return status;
787787
}
788788

789+
VL53L1X_ERROR VL53L1X::VL53L1X_SetROICenter(uint8_t ROICenter)
790+
{
791+
VL53L1X_ERROR status = 0;
792+
status = VL53L1_WrByte(Device,ROI_CONFIG__USER_ROI_CENTRE_SPAD,ROICenter);
793+
return status;
794+
}
795+
796+
VL53L1X_ERROR VL53L1X::VL53L1X_GetROICenter(uint8_t *ROICenter)
797+
{
798+
VL53L1X_ERROR status = 0;
799+
uint8_t tmp;
800+
status = VL53L1_RdByte(Device,ROI_CONFIG__USER_ROI_CENTRE_SPAD,&tmp);
801+
*ROICenter = tmp;
802+
return status;
803+
}
804+
789805
VL53L1X_ERROR VL53L1X::VL53L1X_SetSignalThreshold(uint16_t Signal)
790806
{
791807
VL53L1X_ERROR status = 0;

src/vl53l1x_class.h

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -469,6 +469,17 @@ class VL53L1X : public RangeSensor
469469
*/
470470
VL53L1X_ERROR VL53L1X_GetROI_XY(uint16_t *ROI_X, uint16_t *ROI_Y);
471471

472+
/**
473+
*@brief This function programs the new user ROI center, please to be aware that there is no check in this function.
474+
*if the ROI center vs ROI size is out of border the ranging function return error #13
475+
*/
476+
VL53L1X_ERROR VL53L1X_SetROICenter(uint8_t ROICenter);
477+
478+
/**
479+
*@brief This function returns the current user ROI center
480+
*/
481+
VL53L1X_ERROR VL53L1X_GetROICenter(uint8_t *ROICenter);
482+
472483
/**
473484
* @brief This function programs a new signal threshold in kcps (default=1024 kcps\n
474485
*/

0 commit comments

Comments
 (0)