Makes the VL53L0X library compatible with MAX32630FTHR definitions. Adjusts default sensor settings to fastest reading (20ms) vs. default (30ms).
Dependencies: ST_INTERFACES X_NUCLEO_COMMON
Fork of VL53L0X by
Revision 2:d07edeaff6f1, committed 2017-10-13
- Comitter:
- Davidroid
- Date:
- Fri Oct 13 15:31:04 2017 +0000
- Parent:
- 1:834986cdde0a
- Child:
- 3:e9269ff624ed
- Commit message:
- Astyle reformatting.
Changed in this revision
--- a/VL53L0X.cpp Wed Oct 04 13:21:38 2017 +0000
+++ b/VL53L0X.cpp Fri Oct 13 15:31:04 2017 +0000
@@ -438,9 +438,9 @@
offset_calibration_data_micro_meter = c_max_offset_micro_meter;
} else {
if (offset_calibration_data_micro_meter < c_min_offset_micro_meter) {
- offset_calibration_data_micro_meter = c_min_offset_micro_meter;
- }
- }
+ offset_calibration_data_micro_meter = c_min_offset_micro_meter;
+ }
+ }
/* The offset register is 10.2 format and units are mm
* therefore conversion is applied by a division of
@@ -2077,7 +2077,7 @@
if (status == VL53L0X_ERROR_NONE) {
status = VL53L0X_perform_phase_calibration(
dev, p_phase_cal, get_data_enable, 0);
- }
+ }
if (status == VL53L0X_ERROR_NONE) {
@@ -2152,7 +2152,7 @@
quadrant = spad_index >> 6;
if (refArrayQuadrants[quadrant] == REF_ARRAY_SPAD_0) {
is_aperture = 0;
- }
+ }
return is_aperture;
}
@@ -3299,7 +3299,7 @@
status = VL53L0X_get_limit_check_enable(dev,
VL53L0X_CHECKENABLE_SIGMA_FINAL_RANGE,
&sigma_limit_check_enable);
- }
+ }
if ((sigma_limit_check_enable != 0) && (status == VL53L0X_ERROR_NONE)) {
/*
@@ -3375,11 +3375,11 @@
* EffectiveSpadRtnCount has a format 8.8
* If (Return signal rate < (1.5 x Xtalk x number of Spads)) : FAIL
*/
- if (status == VL53L0X_ERROR_NONE){
+ if (status == VL53L0X_ERROR_NONE) {
status = VL53L0X_get_limit_check_enable(dev,
VL53L0X_CHECKENABLE_RANGE_IGNORE_THRESHOLD,
&range_ignore_threshold_limit_check_enable);
- }
+ }
if ((range_ignore_threshold_limit_check_enable != 0) &&
(status == VL53L0X_ERROR_NONE)) {
@@ -3702,11 +3702,11 @@
status = VL53L0X_read_word(dev,
VL53L0X_REG_RESULT_PEAK_SIGNAL_RATE_REF,
p_ref_signal_rate);
- }
+ }
if (status == VL53L0X_ERROR_NONE) {
status = VL53L0X_write_byte(dev, 0xFF, 0x00);
- }
+ }
if (status == VL53L0X_ERROR_NONE) {
/* restore the previous Sequence Config */
@@ -3790,7 +3790,7 @@
if (status == VL53L0X_ERROR_NONE) {
status = VL53L0X_write_byte(dev,
VL53L0X_REG_DYNAMIC_SPAD_NUM_REQUESTED_REF_SPAD, 0x2C);
- }
+ }
if (status == VL53L0X_ERROR_NONE) {
status = VL53L0X_write_byte(dev, 0xFF, 0x00);
@@ -3800,18 +3800,18 @@
status = VL53L0X_write_byte(dev,
VL53L0X_REG_GLOBAL_CONFIG_REF_EN_START_SELECT,
start_select);
- }
+ }
if (status == VL53L0X_ERROR_NONE) {
status = VL53L0X_write_byte(dev,
VL53L0X_REG_POWER_MANAGEMENT_GO1_POWER_FORCE, 0);
- }
+ }
/* Perform ref calibration */
if (status == VL53L0X_ERROR_NONE) {
status = VL53L0X_perform_ref_calibration(dev, &vhv_settings,
&phase_cal, 0);
- }
+ }
if (status == VL53L0X_ERROR_NONE) {
/* Enable Minimum NON-APERTURE Spads */
@@ -4016,26 +4016,26 @@
if (status == VL53L0X_ERROR_NONE) {
status = VL53L0X_write_byte(dev,
VL53L0X_REG_DYNAMIC_SPAD_REF_EN_START_OFFSET, 0x00);
- }
+ }
if (status == VL53L0X_ERROR_NONE) {
status = VL53L0X_write_byte(dev,
VL53L0X_REG_DYNAMIC_SPAD_NUM_REQUESTED_REF_SPAD, 0x2C);
- }
+ }
if (status == VL53L0X_ERROR_NONE) {
status = VL53L0X_write_byte(dev, 0xFF, 0x00);
- }
+ }
if (status == VL53L0X_ERROR_NONE) {
status = VL53L0X_write_byte(dev,
VL53L0X_REG_GLOBAL_CONFIG_REF_EN_START_SELECT,
start_select);
- }
+ }
for (index = 0; index < spad_array_size; index++) {
dev->Data.SpadData.RefSpadEnables[index] = 0;
- }
+ }
if (is_aperture_spads) {
/* Increment to the first APERTURE spad */
@@ -4138,78 +4138,78 @@
VL53L0X_REG_GPIO_HV_MUX_ACTIVE_HIGH, data);
} else {
- if (device_mode == VL53L0X_DEVICEMODE_GPIO_OSC) {
-
- status |= VL53L0X_write_byte(dev, 0xff, 0x01);
- status |= VL53L0X_write_byte(dev, 0x00, 0x00);
-
- status |= VL53L0X_write_byte(dev, 0xff, 0x00);
- status |= VL53L0X_write_byte(dev, 0x80, 0x01);
- status |= VL53L0X_write_byte(dev, 0x85, 0x02);
-
- status |= VL53L0X_write_byte(dev, 0xff, 0x04);
- status |= VL53L0X_write_byte(dev, 0xcd, 0x00);
- status |= VL53L0X_write_byte(dev, 0xcc, 0x11);
-
- status |= VL53L0X_write_byte(dev, 0xff, 0x07);
- status |= VL53L0X_write_byte(dev, 0xbe, 0x00);
-
- status |= VL53L0X_write_byte(dev, 0xff, 0x06);
- status |= VL53L0X_write_byte(dev, 0xcc, 0x09);
-
- status |= VL53L0X_write_byte(dev, 0xff, 0x00);
- status |= VL53L0X_write_byte(dev, 0xff, 0x01);
- status |= VL53L0X_write_byte(dev, 0x00, 0x00);
-
- } else {
-
- if (status == VL53L0X_ERROR_NONE) {
- switch (functionality) {
- case VL53L0X_GPIOFUNCTIONALITY_OFF:
- data = 0x00;
- break;
- case VL53L0X_GPIOFUNCTIONALITY_THRESHOLD_CROSSED_LOW:
- data = 0x01;
- break;
- case VL53L0X_GPIOFUNCTIONALITY_THRESHOLD_CROSSED_HIGH:
- data = 0x02;
- break;
- case VL53L0X_GPIOFUNCTIONALITY_THRESHOLD_CROSSED_OUT:
- data = 0x03;
- break;
- case VL53L0X_GPIOFUNCTIONALITY_NEW_MEASURE_READY:
- data = 0x04;
- break;
- default:
- status =
- VL53L0X_ERROR_GPIO_FUNCTIONALITY_NOT_SUPPORTED;
- }
- }
-
- if (status == VL53L0X_ERROR_NONE) {
- status = VL53L0X_write_byte(dev,
- VL53L0X_REG_SYSTEM_INTERRUPT_CONFIG_GPIO, data);
- }
-
- if (status == VL53L0X_ERROR_NONE) {
- if (polarity == VL53L0X_INTERRUPTPOLARITY_LOW) {
- data = 0;
- } else {
- data = (uint8_t)(1 << 4);
- }
- status = VL53L0X_update_byte(dev,
- VL53L0X_REG_GPIO_HV_MUX_ACTIVE_HIGH, 0xEF, data);
- }
-
- if (status == VL53L0X_ERROR_NONE) {
- VL53L0X_SETDEVICESPECIFICPARAMETER(dev,
- Pin0GpioFunctionality, functionality);
- }
-
- if (status == VL53L0X_ERROR_NONE) {
- status = VL53L0X_clear_interrupt_mask(dev, 0);
- }
- }
+ if (device_mode == VL53L0X_DEVICEMODE_GPIO_OSC) {
+
+ status |= VL53L0X_write_byte(dev, 0xff, 0x01);
+ status |= VL53L0X_write_byte(dev, 0x00, 0x00);
+
+ status |= VL53L0X_write_byte(dev, 0xff, 0x00);
+ status |= VL53L0X_write_byte(dev, 0x80, 0x01);
+ status |= VL53L0X_write_byte(dev, 0x85, 0x02);
+
+ status |= VL53L0X_write_byte(dev, 0xff, 0x04);
+ status |= VL53L0X_write_byte(dev, 0xcd, 0x00);
+ status |= VL53L0X_write_byte(dev, 0xcc, 0x11);
+
+ status |= VL53L0X_write_byte(dev, 0xff, 0x07);
+ status |= VL53L0X_write_byte(dev, 0xbe, 0x00);
+
+ status |= VL53L0X_write_byte(dev, 0xff, 0x06);
+ status |= VL53L0X_write_byte(dev, 0xcc, 0x09);
+
+ status |= VL53L0X_write_byte(dev, 0xff, 0x00);
+ status |= VL53L0X_write_byte(dev, 0xff, 0x01);
+ status |= VL53L0X_write_byte(dev, 0x00, 0x00);
+
+ } else {
+
+ if (status == VL53L0X_ERROR_NONE) {
+ switch (functionality) {
+ case VL53L0X_GPIOFUNCTIONALITY_OFF:
+ data = 0x00;
+ break;
+ case VL53L0X_GPIOFUNCTIONALITY_THRESHOLD_CROSSED_LOW:
+ data = 0x01;
+ break;
+ case VL53L0X_GPIOFUNCTIONALITY_THRESHOLD_CROSSED_HIGH:
+ data = 0x02;
+ break;
+ case VL53L0X_GPIOFUNCTIONALITY_THRESHOLD_CROSSED_OUT:
+ data = 0x03;
+ break;
+ case VL53L0X_GPIOFUNCTIONALITY_NEW_MEASURE_READY:
+ data = 0x04;
+ break;
+ default:
+ status =
+ VL53L0X_ERROR_GPIO_FUNCTIONALITY_NOT_SUPPORTED;
+ }
+ }
+
+ if (status == VL53L0X_ERROR_NONE) {
+ status = VL53L0X_write_byte(dev,
+ VL53L0X_REG_SYSTEM_INTERRUPT_CONFIG_GPIO, data);
+ }
+
+ if (status == VL53L0X_ERROR_NONE) {
+ if (polarity == VL53L0X_INTERRUPTPOLARITY_LOW) {
+ data = 0;
+ } else {
+ data = (uint8_t)(1 << 4);
+ }
+ status = VL53L0X_update_byte(dev,
+ VL53L0X_REG_GPIO_HV_MUX_ACTIVE_HIGH, 0xEF, data);
+ }
+
+ if (status == VL53L0X_ERROR_NONE) {
+ VL53L0X_SETDEVICESPECIFICPARAMETER(dev,
+ Pin0GpioFunctionality, functionality);
+ }
+
+ if (status == VL53L0X_ERROR_NONE) {
+ status = VL53L0X_clear_interrupt_mask(dev, 0);
+ }
+ }
}
LOG_FUNCTION_END(status);
return status;
@@ -4865,12 +4865,12 @@
if (status == VL53L0X_ERROR_NONE) {
status = VL53L0X_set_sequence_step_enable(dev,
VL53L0X_SEQUENCESTEP_TCC, 0);
- }
+ }
if (status == VL53L0X_ERROR_NONE) {
status = VL53L0X_set_sequence_step_enable(dev,
VL53L0X_SEQUENCESTEP_MSRC, 0);
- }
+ }
/* Set PAL State to standby */
if (status == VL53L0X_ERROR_NONE) {
--- a/VL53L0X.h Wed Oct 04 13:21:38 2017 +0000
+++ b/VL53L0X.h Fri Oct 13 15:31:04 2017 +0000
@@ -355,9 +355,9 @@
*_gpio0 = 1;
} else {
if (_expgpio0) {
- *_expgpio0 = 1;
- }
- }
+ *_expgpio0 = 1;
+ }
+ }
wait_ms(10);
}
@@ -372,12 +372,12 @@
*_gpio0 = 0;
} else {
if (_expgpio0) {
- *_expgpio0 = 0;
- }
- }
+ *_expgpio0 = 0;
+ }
+ }
wait_ms(10);
}
-
+
/**
* @brief Initialize the sensor with default values
@@ -1941,8 +1941,8 @@
VL53L0X_Error VL53L0X_check_part_used(VL53L0X_DEV dev,
uint8_t *revision,
VL53L0X_DeviceInfo_t *p_VL53L0X_device_info);
-
- /* Read function of the ID device */
+
+ /* Read function of the ID device */
// virtual int read_id();
virtual int read_id(uint8_t *id);
--- a/VL53L0X_def.h Wed Oct 04 13:21:38 2017 +0000
+++ b/VL53L0X_def.h Fri Oct 13 15:31:04 2017 +0000
@@ -98,28 +98,28 @@
/** @brief Defines the parameters of the Get Version Functions
*/
typedef struct {
- uint32_t revision; /*!< revision number */
- uint8_t major; /*!< major number */
- uint8_t minor; /*!< minor number */
- uint8_t build; /*!< build number */
+ uint32_t revision; /*!< revision number */
+ uint8_t major; /*!< major number */
+ uint8_t minor; /*!< minor number */
+ uint8_t build; /*!< build number */
} VL53L0X_Version_t;
/** @brief Defines the parameters of the Get Device Info Functions
*/
typedef struct {
- char Name[VL53L0X_MAX_STRING_LENGTH];
- /*!< Name of the Device e.g. Left_Distance */
- char Type[VL53L0X_MAX_STRING_LENGTH];
- /*!< Type of the Device e.g VL53L0X */
- char ProductId[VL53L0X_MAX_STRING_LENGTH];
- /*!< Product Identifier String */
- uint8_t ProductType;
- /*!< Product Type, VL53L0X = 1, VL53L1 = 2 */
- uint8_t ProductRevisionMajor;
- /*!< Product revision major */
- uint8_t ProductRevisionMinor;
- /*!< Product revision minor */
+ char Name[VL53L0X_MAX_STRING_LENGTH];
+ /*!< Name of the Device e.g. Left_Distance */
+ char Type[VL53L0X_MAX_STRING_LENGTH];
+ /*!< Type of the Device e.g VL53L0X */
+ char ProductId[VL53L0X_MAX_STRING_LENGTH];
+ /*!< Product Identifier String */
+ uint8_t ProductType;
+ /*!< Product Type, VL53L0X = 1, VL53L1 = 2 */
+ uint8_t ProductRevisionMajor;
+ /*!< Product revision major */
+ uint8_t ProductRevisionMinor;
+ /*!< Product revision minor */
} VL53L0X_DeviceInfo_t;
@@ -132,45 +132,45 @@
#define VL53L0X_ERROR_NONE ((VL53L0X_Error) 0)
#define VL53L0X_ERROR_CALIBRATION_WARNING ((VL53L0X_Error) -1)
- /*!< Warning invalid calibration data may be in used
- \a VL53L0X_InitData()
- \a VL53L0X_GetOffsetCalibrationData
- \a VL53L0X_SetOffsetCalibrationData */
+/*!< Warning invalid calibration data may be in used
+ \a VL53L0X_InitData()
+ \a VL53L0X_GetOffsetCalibrationData
+ \a VL53L0X_SetOffsetCalibrationData */
#define VL53L0X_ERROR_MIN_CLIPPED ((VL53L0X_Error) -2)
- /*!< Warning parameter passed was clipped to min before to be applied */
+/*!< Warning parameter passed was clipped to min before to be applied */
#define VL53L0X_ERROR_UNDEFINED ((VL53L0X_Error) -3)
- /*!< Unqualified error */
+/*!< Unqualified error */
#define VL53L0X_ERROR_INVALID_PARAMS ((VL53L0X_Error) -4)
- /*!< Parameter passed is invalid or out of range */
+/*!< Parameter passed is invalid or out of range */
#define VL53L0X_ERROR_NOT_SUPPORTED ((VL53L0X_Error) -5)
- /*!< Function is not supported in current mode or configuration */
+/*!< Function is not supported in current mode or configuration */
#define VL53L0X_ERROR_RANGE_ERROR ((VL53L0X_Error) -6)
- /*!< Device report a ranging error interrupt status */
+/*!< Device report a ranging error interrupt status */
#define VL53L0X_ERROR_TIME_OUT ((VL53L0X_Error) -7)
- /*!< Aborted due to time out */
+/*!< Aborted due to time out */
#define VL53L0X_ERROR_MODE_NOT_SUPPORTED ((VL53L0X_Error) -8)
- /*!< Asked mode is not supported by the device */
+/*!< Asked mode is not supported by the device */
#define VL53L0X_ERROR_BUFFER_TOO_SMALL ((VL53L0X_Error) -9)
- /*!< ... */
+/*!< ... */
#define VL53L0X_ERROR_GPIO_NOT_EXISTING ((VL53L0X_Error) -10)
- /*!< User tried to setup a non-existing GPIO pin */
+/*!< User tried to setup a non-existing GPIO pin */
#define VL53L0X_ERROR_GPIO_FUNCTIONALITY_NOT_SUPPORTED ((VL53L0X_Error) -11)
- /*!< unsupported GPIO functionality */
+/*!< unsupported GPIO functionality */
#define VL53L0X_ERROR_INTERRUPT_NOT_CLEARED ((VL53L0X_Error) -12)
- /*!< Error during interrupt clear */
+/*!< Error during interrupt clear */
#define VL53L0X_ERROR_CONTROL_INTERFACE ((VL53L0X_Error) -20)
- /*!< error reported from IO functions */
+/*!< error reported from IO functions */
#define VL53L0X_ERROR_INVALID_COMMAND ((VL53L0X_Error) -30)
- /*!< The command is not allowed in the current device state
- * (power down) */
+/*!< The command is not allowed in the current device state
+ * (power down) */
#define VL53L0X_ERROR_DIVISION_BY_ZERO ((VL53L0X_Error) -40)
- /*!< In the function a division by zero occurs */
+/*!< In the function a division by zero occurs */
#define VL53L0X_ERROR_REF_SPAD_INIT ((VL53L0X_Error) -50)
- /*!< Error during reference SPAD initialization */
+/*!< Error during reference SPAD initialization */
#define VL53L0X_ERROR_NOT_IMPLEMENTED ((VL53L0X_Error) -99)
- /*!< Tells requested functionality has not been implemented yet or
- * not compatible with the device */
+/*!< Tells requested functionality has not been implemented yet or
+ * not compatible with the device */
/** @} VL53L0X_define_Error_group */
@@ -187,7 +187,7 @@
#define VL53L0X_DEVICEMODE_SINGLE_ALS ((VL53L0X_DeviceModes) 10)
#define VL53L0X_DEVICEMODE_GPIO_DRIVE ((VL53L0X_DeviceModes) 20)
#define VL53L0X_DEVICEMODE_GPIO_OSC ((VL53L0X_DeviceModes) 21)
- /* ... Modes to be added depending on device */
+/* ... Modes to be added depending on device */
/** @} VL53L0X_define_DeviceModes_group */
@@ -199,14 +199,14 @@
typedef uint8_t VL53L0X_HistogramModes;
#define VL53L0X_HISTOGRAMMODE_DISABLED ((VL53L0X_HistogramModes) 0)
- /*!< Histogram Disabled */
+/*!< Histogram Disabled */
#define VL53L0X_HISTOGRAMMODE_REFERENCE_ONLY ((VL53L0X_HistogramModes) 1)
- /*!< Histogram Reference array only */
+/*!< Histogram Reference array only */
#define VL53L0X_HISTOGRAMMODE_RETURN_ONLY ((VL53L0X_HistogramModes) 2)
- /*!< Histogram Return array only */
+/*!< Histogram Return array only */
#define VL53L0X_HISTOGRAMMODE_BOTH ((VL53L0X_HistogramModes) 3)
- /*!< Histogram both Reference and Return Arrays */
- /* ... Modes to be added depending on device */
+/*!< Histogram both Reference and Return Arrays */
+/* ... Modes to be added depending on device */
/** @} VL53L0X_define_HistogramModes_group */
@@ -218,13 +218,13 @@
typedef uint8_t VL53L0X_PowerModes;
#define VL53L0X_POWERMODE_STANDBY_LEVEL1 ((VL53L0X_PowerModes) 0)
- /*!< Standby level 1 */
+/*!< Standby level 1 */
#define VL53L0X_POWERMODE_STANDBY_LEVEL2 ((VL53L0X_PowerModes) 1)
- /*!< Standby level 2 */
+/*!< Standby level 2 */
#define VL53L0X_POWERMODE_IDLE_LEVEL1 ((VL53L0X_PowerModes) 2)
- /*!< Idle level 1 */
+/*!< Idle level 1 */
#define VL53L0X_POWERMODE_IDLE_LEVEL2 ((VL53L0X_PowerModes) 3)
- /*!< Idle level 2 */
+/*!< Idle level 2 */
/** @} VL53L0X_define_PowerModes_group */
@@ -232,36 +232,36 @@
/** @brief Defines all parameters for the device
*/
typedef struct {
- VL53L0X_DeviceModes DeviceMode;
- /*!< Defines type of measurement to be done for the next measure */
- VL53L0X_HistogramModes HistogramMode;
- /*!< Defines type of histogram measurement to be done for the next
- * measure */
- uint32_t MeasurementTimingBudgetMicroSeconds;
- /*!< Defines the allowed total time for a single measurement */
- uint32_t InterMeasurementPeriodMilliSeconds;
- /*!< Defines time between two consecutive measurements (between two
- * measurement starts). If set to 0 means back-to-back mode */
- uint8_t XTalkCompensationEnable;
- /*!< Tells if Crosstalk compensation shall be enable or not */
- uint16_t XTalkCompensationRangeMilliMeter;
- /*!< CrossTalk compensation range in millimeter */
- FixPoint1616_t XTalkCompensationRateMegaCps;
- /*!< CrossTalk compensation rate in Mega counts per seconds.
- * Expressed in 16.16 fixed point format. */
- int32_t RangeOffsetMicroMeters;
- /*!< Range offset adjustment (mm). */
+ VL53L0X_DeviceModes DeviceMode;
+ /*!< Defines type of measurement to be done for the next measure */
+ VL53L0X_HistogramModes HistogramMode;
+ /*!< Defines type of histogram measurement to be done for the next
+ * measure */
+ uint32_t MeasurementTimingBudgetMicroSeconds;
+ /*!< Defines the allowed total time for a single measurement */
+ uint32_t InterMeasurementPeriodMilliSeconds;
+ /*!< Defines time between two consecutive measurements (between two
+ * measurement starts). If set to 0 means back-to-back mode */
+ uint8_t XTalkCompensationEnable;
+ /*!< Tells if Crosstalk compensation shall be enable or not */
+ uint16_t XTalkCompensationRangeMilliMeter;
+ /*!< CrossTalk compensation range in millimeter */
+ FixPoint1616_t XTalkCompensationRateMegaCps;
+ /*!< CrossTalk compensation rate in Mega counts per seconds.
+ * Expressed in 16.16 fixed point format. */
+ int32_t RangeOffsetMicroMeters;
+ /*!< Range offset adjustment (mm). */
- uint8_t LimitChecksEnable[VL53L0X_CHECKENABLE_NUMBER_OF_CHECKS];
- /*!< This Array store all the Limit Check enable for this device. */
- uint8_t LimitChecksStatus[VL53L0X_CHECKENABLE_NUMBER_OF_CHECKS];
- /*!< This Array store all the Status of the check linked to last
- * measurement. */
- FixPoint1616_t LimitChecksValue[VL53L0X_CHECKENABLE_NUMBER_OF_CHECKS];
- /*!< This Array store all the Limit Check value for this device */
+ uint8_t LimitChecksEnable[VL53L0X_CHECKENABLE_NUMBER_OF_CHECKS];
+ /*!< This Array store all the Limit Check enable for this device. */
+ uint8_t LimitChecksStatus[VL53L0X_CHECKENABLE_NUMBER_OF_CHECKS];
+ /*!< This Array store all the Status of the check linked to last
+ * measurement. */
+ FixPoint1616_t LimitChecksValue[VL53L0X_CHECKENABLE_NUMBER_OF_CHECKS];
+ /*!< This Array store all the Limit Check value for this device */
- uint8_t WrapAroundCheckEnable;
- /*!< Tells if Wrap Around Check shall be enable or not */
+ uint8_t WrapAroundCheckEnable;
+ /*!< Tells if Wrap Around Check shall be enable or not */
} VL53L0X_DeviceParameters_t;
@@ -273,19 +273,19 @@
typedef uint8_t VL53L0X_State;
#define VL53L0X_STATE_POWERDOWN ((VL53L0X_State) 0)
- /*!< Device is in HW reset */
+/*!< Device is in HW reset */
#define VL53L0X_STATE_WAIT_STATICINIT ((VL53L0X_State) 1)
- /*!< Device is initialized and wait for static initialization */
+/*!< Device is initialized and wait for static initialization */
#define VL53L0X_STATE_STANDBY ((VL53L0X_State) 2)
- /*!< Device is in Low power Standby mode */
+/*!< Device is in Low power Standby mode */
#define VL53L0X_STATE_IDLE ((VL53L0X_State) 3)
- /*!< Device has been initialized and ready to do measurements */
+/*!< Device has been initialized and ready to do measurements */
#define VL53L0X_STATE_RUNNING ((VL53L0X_State) 4)
- /*!< Device is performing measurement */
+/*!< Device is performing measurement */
#define VL53L0X_STATE_UNKNOWN ((VL53L0X_State) 98)
- /*!< Device is in unknown state and need to be rebooted */
+/*!< Device is in unknown state and need to be rebooted */
#define VL53L0X_STATE_ERROR ((VL53L0X_State) 99)
- /*!< Device is in error state and need to be rebooted */
+/*!< Device is in error state and need to be rebooted */
/** @} VL53L0X_define_State_group */
@@ -293,10 +293,10 @@
/** @brief Structure containing the Dmax computation parameters and data
*/
typedef struct {
- int32_t AmbTuningWindowFactor_K;
- /*!< internal algo tuning (*1000) */
- int32_t RetSignalAt0mm;
- /*!< intermediate dmax computation value caching */
+ int32_t AmbTuningWindowFactor_K;
+ /*!< internal algo tuning (*1000) */
+ int32_t RetSignalAt0mm;
+ /*!< intermediate dmax computation value caching */
} VL53L0X_DMaxData_t;
/**
@@ -304,42 +304,42 @@
* @brief Range measurement data.
*/
typedef struct {
- uint32_t TimeStamp; /*!< 32-bit time stamp. */
- uint32_t MeasurementTimeUsec;
- /*!< Give the Measurement time needed by the device to do the
- * measurement.*/
+ uint32_t TimeStamp; /*!< 32-bit time stamp. */
+ uint32_t MeasurementTimeUsec;
+ /*!< Give the Measurement time needed by the device to do the
+ * measurement.*/
- uint16_t RangeMilliMeter; /*!< range distance in millimeter. */
+ uint16_t RangeMilliMeter; /*!< range distance in millimeter. */
- uint16_t RangeDMaxMilliMeter;
- /*!< Tells what is the maximum detection distance of the device
- * in current setup and environment conditions (Filled when
- * applicable) */
+ uint16_t RangeDMaxMilliMeter;
+ /*!< Tells what is the maximum detection distance of the device
+ * in current setup and environment conditions (Filled when
+ * applicable) */
- FixPoint1616_t SignalRateRtnMegaCps;
- /*!< Return signal rate (MCPS)\n these is a 16.16 fix point
- * value, which is effectively a measure of target
- * reflectance.*/
- FixPoint1616_t AmbientRateRtnMegaCps;
- /*!< Return ambient rate (MCPS)\n these is a 16.16 fix point
- * value, which is effectively a measure of the ambien
- * t light.*/
+ FixPoint1616_t SignalRateRtnMegaCps;
+ /*!< Return signal rate (MCPS)\n these is a 16.16 fix point
+ * value, which is effectively a measure of target
+ * reflectance.*/
+ FixPoint1616_t AmbientRateRtnMegaCps;
+ /*!< Return ambient rate (MCPS)\n these is a 16.16 fix point
+ * value, which is effectively a measure of the ambien
+ * t light.*/
- uint16_t EffectiveSpadRtnCount;
- /*!< Return the effective SPAD count for the return signal.
- * To obtain Real value it should be divided by 256 */
+ uint16_t EffectiveSpadRtnCount;
+ /*!< Return the effective SPAD count for the return signal.
+ * To obtain Real value it should be divided by 256 */
- uint8_t ZoneId;
- /*!< Denotes which zone and range scheduler stage the range
- * data relates to. */
- uint8_t RangeFractionalPart;
- /*!< Fractional part of range distance. Final value is a
- * FixPoint168 value. */
- uint8_t RangeStatus;
- /*!< Range Status for the current measurement. This is device
- * dependent. Value = 0 means value is valid.
- * See \ref RangeStatusPage */
+ uint8_t ZoneId;
+ /*!< Denotes which zone and range scheduler stage the range
+ * data relates to. */
+ uint8_t RangeFractionalPart;
+ /*!< Fractional part of range distance. Final value is a
+ * FixPoint168 value. */
+ uint8_t RangeStatus;
+ /*!< Range Status for the current measurement. This is device
+ * dependent. Value = 0 means value is valid.
+ * See \ref RangeStatusPage */
} VL53L0X_RangingMeasurementData_t;
@@ -350,19 +350,19 @@
* @brief Histogram measurement data.
*/
typedef struct {
- /* Histogram Measurement data */
- uint32_t HistogramData[VL53L0X_HISTOGRAM_BUFFER_SIZE];
- /*!< Histogram data */
- uint8_t HistogramType; /*!< Indicate the types of histogram data :
+ /* Histogram Measurement data */
+ uint32_t HistogramData[VL53L0X_HISTOGRAM_BUFFER_SIZE];
+ /*!< Histogram data */
+ uint8_t HistogramType; /*!< Indicate the types of histogram data :
Return only, Reference only, both Return and Reference */
- uint8_t FirstBin; /*!< First Bin value */
- uint8_t BufferSize; /*!< Buffer Size - Set by the user.*/
- uint8_t NumberOfBins;
- /*!< Number of bins filled by the histogram measurement */
+ uint8_t FirstBin; /*!< First Bin value */
+ uint8_t BufferSize; /*!< Buffer Size - Set by the user.*/
+ uint8_t NumberOfBins;
+ /*!< Number of bins filled by the histogram measurement */
- VL53L0X_DeviceError ErrorStatus;
- /*!< Error status of the current measurement. \n
- see @a ::VL53L0X_DeviceError @a VL53L0X_GetStatusErrorString() */
+ VL53L0X_DeviceError ErrorStatus;
+ /*!< Error status of the current measurement. \n
+ see @a ::VL53L0X_DeviceError @a VL53L0X_GetStatusErrorString() */
} VL53L0X_HistogramMeasurementData_t;
#define VL53L0X_REF_SPAD_BUFFER_SIZE 6
@@ -372,52 +372,52 @@
* @brief Spad Configuration Data.
*/
typedef struct {
- uint8_t RefSpadEnables[VL53L0X_REF_SPAD_BUFFER_SIZE];
- /*!< Reference Spad Enables */
- uint8_t RefGoodSpadMap[VL53L0X_REF_SPAD_BUFFER_SIZE];
- /*!< Reference Spad Good Spad Map */
+ uint8_t RefSpadEnables[VL53L0X_REF_SPAD_BUFFER_SIZE];
+ /*!< Reference Spad Enables */
+ uint8_t RefGoodSpadMap[VL53L0X_REF_SPAD_BUFFER_SIZE];
+ /*!< Reference Spad Good Spad Map */
} VL53L0X_SpadData_t;
typedef struct {
- FixPoint1616_t OscFrequencyMHz; /* Frequency used */
+ FixPoint1616_t OscFrequencyMHz; /* Frequency used */
- uint16_t LastEncodedTimeout;
- /* last encoded Time out used for timing budget*/
+ uint16_t LastEncodedTimeout;
+ /* last encoded Time out used for timing budget*/
- VL53L0X_GpioFunctionality Pin0GpioFunctionality;
- /* store the functionality of the GPIO: pin0 */
+ VL53L0X_GpioFunctionality Pin0GpioFunctionality;
+ /* store the functionality of the GPIO: pin0 */
- uint32_t FinalRangeTimeoutMicroSecs;
- /*!< Execution time of the final range*/
- uint8_t FinalRangeVcselPulsePeriod;
- /*!< Vcsel pulse period (pll clocks) for the final range measurement*/
- uint32_t PreRangeTimeoutMicroSecs;
- /*!< Execution time of the final range*/
- uint8_t PreRangeVcselPulsePeriod;
- /*!< Vcsel pulse period (pll clocks) for the pre-range measurement*/
+ uint32_t FinalRangeTimeoutMicroSecs;
+ /*!< Execution time of the final range*/
+ uint8_t FinalRangeVcselPulsePeriod;
+ /*!< Vcsel pulse period (pll clocks) for the final range measurement*/
+ uint32_t PreRangeTimeoutMicroSecs;
+ /*!< Execution time of the final range*/
+ uint8_t PreRangeVcselPulsePeriod;
+ /*!< Vcsel pulse period (pll clocks) for the pre-range measurement*/
- uint16_t SigmaEstRefArray;
- /*!< Reference array sigma value in 1/100th of [mm] e.g. 100 = 1mm */
- uint16_t SigmaEstEffPulseWidth;
- /*!< Effective Pulse width for sigma estimate in 1/100th
- * of ns e.g. 900 = 9.0ns */
- uint16_t SigmaEstEffAmbWidth;
- /*!< Effective Ambient width for sigma estimate in 1/100th of ns
- * e.g. 500 = 5.0ns */
+ uint16_t SigmaEstRefArray;
+ /*!< Reference array sigma value in 1/100th of [mm] e.g. 100 = 1mm */
+ uint16_t SigmaEstEffPulseWidth;
+ /*!< Effective Pulse width for sigma estimate in 1/100th
+ * of ns e.g. 900 = 9.0ns */
+ uint16_t SigmaEstEffAmbWidth;
+ /*!< Effective Ambient width for sigma estimate in 1/100th of ns
+ * e.g. 500 = 5.0ns */
- uint8_t ReadDataFromDeviceDone; /* Indicate if read from device has
+ uint8_t ReadDataFromDeviceDone; /* Indicate if read from device has
been done (==1) or not (==0) */
- uint8_t ModuleId; /* Module ID */
- uint8_t Revision; /* test Revision */
- char ProductId[VL53L0X_MAX_STRING_LENGTH];
- /* Product Identifier String */
- uint8_t ReferenceSpadCount; /* used for ref spad management */
- uint8_t ReferenceSpadType; /* used for ref spad management */
- uint8_t RefSpadsInitialised; /* reports if ref spads are initialised. */
- uint32_t PartUIDUpper; /*!< Unique Part ID Upper */
- uint32_t PartUIDLower; /*!< Unique Part ID Lower */
- FixPoint1616_t SignalRateMeasFixed400mm; /*!< Peek Signal rate
+ uint8_t ModuleId; /* Module ID */
+ uint8_t Revision; /* test Revision */
+ char ProductId[VL53L0X_MAX_STRING_LENGTH];
+ /* Product Identifier String */
+ uint8_t ReferenceSpadCount; /* used for ref spad management */
+ uint8_t ReferenceSpadType; /* used for ref spad management */
+ uint8_t RefSpadsInitialised; /* reports if ref spads are initialised. */
+ uint32_t PartUIDUpper; /*!< Unique Part ID Upper */
+ uint32_t PartUIDLower; /*!< Unique Part ID Lower */
+ FixPoint1616_t SignalRateMeasFixed400mm; /*!< Peek Signal rate
at 400 mm*/
} VL53L0X_DeviceSpecificParameters_t;
@@ -431,59 +431,59 @@
* These must never access directly but only via macro
*/
typedef struct {
- VL53L0X_DMaxData_t DMaxData;
- /*!< Dmax Data */
- int32_t Part2PartOffsetNVMMicroMeter;
- /*!< backed up NVM value */
- int32_t Part2PartOffsetAdjustmentNVMMicroMeter;
- /*!< backed up NVM value representing additional offset adjustment */
- VL53L0X_DeviceParameters_t CurrentParameters;
- /*!< Current Device Parameter */
- VL53L0X_RangingMeasurementData_t LastRangeMeasure;
- /*!< Ranging Data */
- VL53L0X_HistogramMeasurementData_t LastHistogramMeasure;
- /*!< Histogram Data */
- VL53L0X_DeviceSpecificParameters_t DeviceSpecificParameters;
- /*!< Parameters specific to the device */
- VL53L0X_SpadData_t SpadData;
- /*!< Spad Data */
- uint8_t SequenceConfig;
- /*!< Internal value for the sequence config */
- uint8_t RangeFractionalEnable;
- /*!< Enable/Disable fractional part of ranging data */
- VL53L0X_State PalState;
- /*!< Current state of the PAL for this device */
- VL53L0X_PowerModes PowerMode;
- /*!< Current Power Mode */
- uint16_t SigmaEstRefArray;
- /*!< Reference array sigma value in 1/100th of [mm] e.g. 100 = 1mm */
- uint16_t SigmaEstEffPulseWidth;
- /*!< Effective Pulse width for sigma estimate in 1/100th
- * of ns e.g. 900 = 9.0ns */
- uint16_t SigmaEstEffAmbWidth;
- /*!< Effective Ambient width for sigma estimate in 1/100th of ns
- * e.g. 500 = 5.0ns */
- uint8_t StopVariable;
- /*!< StopVariable used during the stop sequence */
- uint16_t targetRefRate;
- /*!< Target Ambient Rate for Ref spad management */
- FixPoint1616_t SigmaEstimate;
- /*!< Sigma Estimate - based on ambient & VCSEL rates and
- * signal_total_events */
- FixPoint1616_t SignalEstimate;
- /*!< Signal Estimate - based on ambient & VCSEL rates and cross talk */
- FixPoint1616_t LastSignalRefMcps;
- /*!< Latest Signal ref in Mcps */
- uint8_t *pTuningSettingsPointer;
- /*!< Pointer for Tuning Settings table */
- uint8_t UseInternalTuningSettings;
- /*!< Indicate if we use Tuning Settings table */
- uint16_t LinearityCorrectiveGain;
- /*!< Linearity Corrective Gain value in x1000 */
- uint16_t DmaxCalRangeMilliMeter;
- /*!< Dmax Calibration Range millimeter */
- FixPoint1616_t DmaxCalSignalRateRtnMegaCps;
- /*!< Dmax Calibration Signal Rate Return MegaCps */
+ VL53L0X_DMaxData_t DMaxData;
+ /*!< Dmax Data */
+ int32_t Part2PartOffsetNVMMicroMeter;
+ /*!< backed up NVM value */
+ int32_t Part2PartOffsetAdjustmentNVMMicroMeter;
+ /*!< backed up NVM value representing additional offset adjustment */
+ VL53L0X_DeviceParameters_t CurrentParameters;
+ /*!< Current Device Parameter */
+ VL53L0X_RangingMeasurementData_t LastRangeMeasure;
+ /*!< Ranging Data */
+ VL53L0X_HistogramMeasurementData_t LastHistogramMeasure;
+ /*!< Histogram Data */
+ VL53L0X_DeviceSpecificParameters_t DeviceSpecificParameters;
+ /*!< Parameters specific to the device */
+ VL53L0X_SpadData_t SpadData;
+ /*!< Spad Data */
+ uint8_t SequenceConfig;
+ /*!< Internal value for the sequence config */
+ uint8_t RangeFractionalEnable;
+ /*!< Enable/Disable fractional part of ranging data */
+ VL53L0X_State PalState;
+ /*!< Current state of the PAL for this device */
+ VL53L0X_PowerModes PowerMode;
+ /*!< Current Power Mode */
+ uint16_t SigmaEstRefArray;
+ /*!< Reference array sigma value in 1/100th of [mm] e.g. 100 = 1mm */
+ uint16_t SigmaEstEffPulseWidth;
+ /*!< Effective Pulse width for sigma estimate in 1/100th
+ * of ns e.g. 900 = 9.0ns */
+ uint16_t SigmaEstEffAmbWidth;
+ /*!< Effective Ambient width for sigma estimate in 1/100th of ns
+ * e.g. 500 = 5.0ns */
+ uint8_t StopVariable;
+ /*!< StopVariable used during the stop sequence */
+ uint16_t targetRefRate;
+ /*!< Target Ambient Rate for Ref spad management */
+ FixPoint1616_t SigmaEstimate;
+ /*!< Sigma Estimate - based on ambient & VCSEL rates and
+ * signal_total_events */
+ FixPoint1616_t SignalEstimate;
+ /*!< Signal Estimate - based on ambient & VCSEL rates and cross talk */
+ FixPoint1616_t LastSignalRefMcps;
+ /*!< Latest Signal ref in Mcps */
+ uint8_t *pTuningSettingsPointer;
+ /*!< Pointer for Tuning Settings table */
+ uint8_t UseInternalTuningSettings;
+ /*!< Indicate if we use Tuning Settings table */
+ uint16_t LinearityCorrectiveGain;
+ /*!< Linearity Corrective Gain value in x1000 */
+ uint16_t DmaxCalRangeMilliMeter;
+ /*!< Dmax Calibration Range millimeter */
+ FixPoint1616_t DmaxCalSignalRateRtnMegaCps;
+ /*!< Dmax Calibration Signal Rate Return MegaCps */
} VL53L0X_DevData_t;
@@ -523,11 +523,11 @@
* i.e. enabled/disabled.
*/
typedef struct {
- uint8_t TccOn; /*!<Reports if Target Centre Check On */
- uint8_t MsrcOn; /*!<Reports if MSRC On */
- uint8_t DssOn; /*!<Reports if DSS On */
- uint8_t PreRangeOn; /*!<Reports if Pre-Range On */
- uint8_t FinalRangeOn; /*!<Reports if Final-Range On */
+ uint8_t TccOn; /*!<Reports if Target Centre Check On */
+ uint8_t MsrcOn; /*!<Reports if MSRC On */
+ uint8_t DssOn; /*!<Reports if DSS On */
+ uint8_t PreRangeOn; /*!<Reports if Pre-Range On */
+ uint8_t FinalRangeOn; /*!<Reports if Final-Range On */
} VL53L0X_SchedulerSequenceSteps_t;
/** @} VL53L0X_define_SchedulerSequence_group */
--- a/VL53L0X_device.h Wed Oct 04 13:21:38 2017 +0000
+++ b/VL53L0X_device.h Fri Oct 13 15:31:04 2017 +0000
@@ -54,7 +54,7 @@
typedef uint8_t VL53L0X_DeviceError;
#define VL53L0X_DEVICEERROR_NONE ((VL53L0X_DeviceError) 0)
- /*!< 0 NoError */
+/*!< 0 NoError */
#define VL53L0X_DEVICEERROR_VCSELCONTINUITYTESTFAILURE ((VL53L0X_DeviceError) 1)
#define VL53L0X_DEVICEERROR_VCSELWATCHDOGTESTFAILURE ((VL53L0X_DeviceError) 2)
#define VL53L0X_DEVICEERROR_NOVHVVALUEFOUND ((VL53L0X_DeviceError) 3)
@@ -107,7 +107,7 @@
((VL53L0X_GpioFunctionality) 2) /*!< Level High (value > thresh_high) */
#define VL53L0X_GPIOFUNCTIONALITY_THRESHOLD_CROSSED_OUT \
((VL53L0X_GpioFunctionality) 3)
- /*!< Out Of Window (value < thresh_low OR value > thresh_high) */
+/*!< Out Of Window (value < thresh_low OR value > thresh_high) */
#define VL53L0X_GPIOFUNCTIONALITY_NEW_MEASURE_READY \
((VL53L0X_GpioFunctionality) 4) /*!< New Sample Ready */
@@ -121,22 +121,22 @@
* @{
*/
#define VL53L0X_REG_SYSRANGE_START 0x000
- /** mask existing bit in #VL53L0X_REG_SYSRANGE_START*/
- #define VL53L0X_REG_SYSRANGE_MODE_MASK 0x0F
- /** bit 0 in #VL53L0X_REG_SYSRANGE_START write 1 toggle state in
- * continuous mode and arm next shot in single shot mode */
- #define VL53L0X_REG_SYSRANGE_MODE_START_STOP 0x01
- /** bit 1 write 0 in #VL53L0X_REG_SYSRANGE_START set single shot mode */
- #define VL53L0X_REG_SYSRANGE_MODE_SINGLESHOT 0x00
- /** bit 1 write 1 in #VL53L0X_REG_SYSRANGE_START set back-to-back
- * operation mode */
- #define VL53L0X_REG_SYSRANGE_MODE_BACKTOBACK 0x02
- /** bit 2 write 1 in #VL53L0X_REG_SYSRANGE_START set timed operation
- * mode */
- #define VL53L0X_REG_SYSRANGE_MODE_TIMED 0x04
- /** bit 3 write 1 in #VL53L0X_REG_SYSRANGE_START set histogram operation
- * mode */
- #define VL53L0X_REG_SYSRANGE_MODE_HISTOGRAM 0x08
+/** mask existing bit in #VL53L0X_REG_SYSRANGE_START*/
+#define VL53L0X_REG_SYSRANGE_MODE_MASK 0x0F
+/** bit 0 in #VL53L0X_REG_SYSRANGE_START write 1 toggle state in
+ * continuous mode and arm next shot in single shot mode */
+#define VL53L0X_REG_SYSRANGE_MODE_START_STOP 0x01
+/** bit 1 write 0 in #VL53L0X_REG_SYSRANGE_START set single shot mode */
+#define VL53L0X_REG_SYSRANGE_MODE_SINGLESHOT 0x00
+/** bit 1 write 1 in #VL53L0X_REG_SYSRANGE_START set back-to-back
+ * operation mode */
+#define VL53L0X_REG_SYSRANGE_MODE_BACKTOBACK 0x02
+/** bit 2 write 1 in #VL53L0X_REG_SYSRANGE_START set timed operation
+ * mode */
+#define VL53L0X_REG_SYSRANGE_MODE_TIMED 0x04
+/** bit 3 write 1 in #VL53L0X_REG_SYSRANGE_START set histogram operation
+ * mode */
+#define VL53L0X_REG_SYSRANGE_MODE_HISTOGRAM 0x08
#define VL53L0X_REG_SYSTEM_THRESH_HIGH 0x000C
--- a/VL53L0X_i2c_platform.h Wed Oct 04 13:21:38 2017 +0000 +++ b/VL53L0X_i2c_platform.h Fri Oct 13 15:31:04 2017 +0000 @@ -73,20 +73,20 @@ */ int32_t VL53L0X_comms_initialise(uint8_t comms_type, - uint16_t comms_speed_khz); + uint16_t comms_speed_khz); - /** - * @brief Initialise platform serial comms. - * - * @param comPortStr - String to indicate the comm port - * @param baudRate - Bau rate - * - * @return status - status 0 = ok, 1 = error - * - */ +/** +* @brief Initialise platform serial comms. +* +* @param comPortStr - String to indicate the comm port +* @param baudRate - Bau rate +* +* @return status - status 0 = ok, 1 = error +* +*/ int VL53L0_i2c_init(char *comPortStr, unsigned int baudRate); - + /** * @brief Close platform comms. * @@ -139,7 +139,7 @@ * Wrapper for SystemVerilog Read Multi task * * @code - * + * * Example: * * uint8_t buffer[COMMS_BUFFER_SIZE]; @@ -166,7 +166,7 @@ * Wrapper for SystemVerilog Write Byte task * * @code - * + * * Example: * * uint8_t page_number = MAIN_SELECT_PAGE;
--- a/VL53L0X_interrupt_threshold_settings.h Wed Oct 04 13:21:38 2017 +0000
+++ b/VL53L0X_interrupt_threshold_settings.h Fri Oct 13 15:31:04 2017 +0000
@@ -38,153 +38,153 @@
uint8_t InterruptThresholdSettings[] = {
- /* Start of Interrupt Threshold Settings */
- 0x1, 0xff, 0x00,
- 0x1, 0x80, 0x01,
- 0x1, 0xff, 0x01,
- 0x1, 0x00, 0x00,
- 0x1, 0xff, 0x01,
- 0x1, 0x4f, 0x02,
- 0x1, 0xFF, 0x0E,
- 0x1, 0x00, 0x03,
- 0x1, 0x01, 0x84,
- 0x1, 0x02, 0x0A,
- 0x1, 0x03, 0x03,
- 0x1, 0x04, 0x08,
- 0x1, 0x05, 0xC8,
- 0x1, 0x06, 0x03,
- 0x1, 0x07, 0x8D,
- 0x1, 0x08, 0x08,
- 0x1, 0x09, 0xC6,
- 0x1, 0x0A, 0x01,
- 0x1, 0x0B, 0x02,
- 0x1, 0x0C, 0x00,
- 0x1, 0x0D, 0xD5,
- 0x1, 0x0E, 0x18,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0x1, 0x5E, 0x0C,
+ 0x1, 0x5F, 0x3C,
+ 0x1, 0x60, 0x00,
+ 0x1, 0x61, 0xD0,
+ 0x1, 0x62, 0x0B,
+ 0x1, 0x63, 0x03,
+ 0x1, 0x64, 0x28,
+ 0x1, 0x65, 0x10,
+ 0x1, 0x66, 0x2A,
+ 0x1, 0x67, 0x39,
+ 0x1, 0x68, 0x0B,
+ 0x1, 0x69, 0x02,
+ 0x1, 0x6A, 0x28,
+ 0x1, 0x6B, 0x10,
+ 0x1, 0x6C, 0x2A,
+ 0x1, 0x6D, 0x61,
+ 0x1, 0x6E, 0x0C,
+ 0x1, 0x6F, 0x00,
+ 0x1, 0x70, 0x0F,
+ 0x1, 0x71, 0x79,
+ 0x1, 0x72, 0x00,
+ 0x1, 0x73, 0x0B,
+ 0x1, 0x74, 0x00,
+ 0x1, 0x75, 0x0B,
+ 0x1, 0x76, 0x00,
+ 0x1, 0x77, 0xA1,
+ 0x1, 0x78, 0x00,
+ 0x1, 0x79, 0xA0,
+ 0x1, 0x7A, 0x00,
+ 0x1, 0x7B, 0x04,
+ 0x1, 0xFF, 0x04,
+ 0x1, 0x79, 0x1D,
+ 0x1, 0x7B, 0x27,
+ 0x1, 0x96, 0x0E,
+ 0x1, 0x97, 0xFE,
+ 0x1, 0x98, 0x03,
+ 0x1, 0x99, 0xEF,
+ 0x1, 0x9A, 0x02,
+ 0x1, 0x9B, 0x44,
+ 0x1, 0x73, 0x07,
+ 0x1, 0x70, 0x01,
+ 0x1, 0xff, 0x01,
+ 0x1, 0x00, 0x01,
+ 0x1, 0xff, 0x00,
+ 0x00, 0x00, 0x00
};
#ifdef __cplusplus
--- a/VL53L0X_platform.h Wed Oct 04 13:21:38 2017 +0000 +++ b/VL53L0X_platform.h Fri Oct 13 15:31:04 2017 +0000 @@ -43,7 +43,7 @@ * * @brief All end user OS/platform/application porting */ - + /** * @defgroup VL53L0X_platform_group VL53L0 Platform Functions * @brief VL53L0 Platform Functions @@ -70,7 +70,7 @@ * @brief Declare the device Handle as a pointer of the structure @a VL53L0X_Dev_t. * */ -typedef VL53L0X_Dev_t* VL53L0X_DEV; +typedef VL53L0X_Dev_t *VL53L0X_DEV; /** * @def PALDevDataGet @@ -214,7 +214,7 @@ /** @} end of VL53L0X_registerAccess_group */ - + /** * @brief execute delay in all polling API call *
--- a/VL53L0X_platform_log.h Wed Oct 04 13:21:38 2017 +0000 +++ b/VL53L0X_platform_log.h Fri Oct 13 15:31:04 2017 +0000 @@ -100,10 +100,10 @@ #define VL53L0X_ErrLog( fmt, ...) fprintf(stderr, "VL53L0X_ErrLog %s" fmt "\n", __func__, ##__VA_ARGS__) #else /* VL53L0X_LOG_ENABLE no logging */ - #define VL53L0X_ErrLog(...) (void)0 - #define _LOG_FUNCTION_START(module, fmt, ... ) (void)0 - #define _LOG_FUNCTION_END(module, status, ... ) (void)0 - #define _LOG_FUNCTION_END_FMT(module, status, fmt, ... ) (void)0 +#define VL53L0X_ErrLog(...) (void)0 +#define _LOG_FUNCTION_START(module, fmt, ... ) (void)0 +#define _LOG_FUNCTION_END(module, status, ... ) (void)0 +#define _LOG_FUNCTION_END_FMT(module, status, fmt, ... ) (void)0 #endif /* else */ #define VL53L0X_COPYSTRING(str, ...) strcpy(str, ##__VA_ARGS__)
--- a/VL53L0X_tuning.h Wed Oct 04 13:21:38 2017 +0000
+++ b/VL53L0X_tuning.h Fri Oct 13 15:31:04 2017 +0000
@@ -40,103 +40,103 @@
uint8_t DefaultTuningSettings[] = {
- /* update 02/11/2015_v36 */
- 0x01, 0xFF, 0x01,
- 0x01, 0x00, 0x00,
+ /* update 02/11/2015_v36 */
+ 0x01, 0xFF, 0x01,
+ 0x01, 0x00, 0x00,
- 0x01, 0xFF, 0x00,
- 0x01, 0x09, 0x00,
- 0x01, 0x10, 0x00,
- 0x01, 0x11, 0x00,
+ 0x01, 0xFF, 0x00,
+ 0x01, 0x09, 0x00,
+ 0x01, 0x10, 0x00,
+ 0x01, 0x11, 0x00,
- 0x01, 0x24, 0x01,
- 0x01, 0x25, 0xff,
- 0x01, 0x75, 0x00,
+ 0x01, 0x24, 0x01,
+ 0x01, 0x25, 0xff,
+ 0x01, 0x75, 0x00,
- 0x01, 0xFF, 0x01,
- 0x01, 0x4e, 0x2c,
- 0x01, 0x48, 0x00,
- 0x01, 0x30, 0x20,
+ 0x01, 0xFF, 0x01,
+ 0x01, 0x4e, 0x2c,
+ 0x01, 0x48, 0x00,
+ 0x01, 0x30, 0x20,
- 0x01, 0xFF, 0x00,
- 0x01, 0x30, 0x09, /* mja changed from 0x64. */
- 0x01, 0x54, 0x00,
- 0x01, 0x31, 0x04,
- 0x01, 0x32, 0x03,
- 0x01, 0x40, 0x83,
- 0x01, 0x46, 0x25,
- 0x01, 0x60, 0x00,
- 0x01, 0x27, 0x00,
- 0x01, 0x50, 0x06,
- 0x01, 0x51, 0x00,
- 0x01, 0x52, 0x96,
- 0x01, 0x56, 0x08,
- 0x01, 0x57, 0x30,
- 0x01, 0x61, 0x00,
- 0x01, 0x62, 0x00,
- 0x01, 0x64, 0x00,
- 0x01, 0x65, 0x00,
- 0x01, 0x66, 0xa0,
+ 0x01, 0xFF, 0x00,
+ 0x01, 0x30, 0x09, /* mja changed from 0x64. */
+ 0x01, 0x54, 0x00,
+ 0x01, 0x31, 0x04,
+ 0x01, 0x32, 0x03,
+ 0x01, 0x40, 0x83,
+ 0x01, 0x46, 0x25,
+ 0x01, 0x60, 0x00,
+ 0x01, 0x27, 0x00,
+ 0x01, 0x50, 0x06,
+ 0x01, 0x51, 0x00,
+ 0x01, 0x52, 0x96,
+ 0x01, 0x56, 0x08,
+ 0x01, 0x57, 0x30,
+ 0x01, 0x61, 0x00,
+ 0x01, 0x62, 0x00,
+ 0x01, 0x64, 0x00,
+ 0x01, 0x65, 0x00,
+ 0x01, 0x66, 0xa0,
- 0x01, 0xFF, 0x01,
- 0x01, 0x22, 0x32,
- 0x01, 0x47, 0x14,
- 0x01, 0x49, 0xff,
- 0x01, 0x4a, 0x00,
+ 0x01, 0xFF, 0x01,
+ 0x01, 0x22, 0x32,
+ 0x01, 0x47, 0x14,
+ 0x01, 0x49, 0xff,
+ 0x01, 0x4a, 0x00,
- 0x01, 0xFF, 0x00,
- 0x01, 0x7a, 0x0a,
- 0x01, 0x7b, 0x00,
- 0x01, 0x78, 0x21,
+ 0x01, 0xFF, 0x00,
+ 0x01, 0x7a, 0x0a,
+ 0x01, 0x7b, 0x00,
+ 0x01, 0x78, 0x21,
- 0x01, 0xFF, 0x01,
- 0x01, 0x23, 0x34,
- 0x01, 0x42, 0x00,
- 0x01, 0x44, 0xff,
- 0x01, 0x45, 0x26,
- 0x01, 0x46, 0x05,
- 0x01, 0x40, 0x40,
- 0x01, 0x0E, 0x06,
- 0x01, 0x20, 0x1a,
- 0x01, 0x43, 0x40,
+ 0x01, 0xFF, 0x01,
+ 0x01, 0x23, 0x34,
+ 0x01, 0x42, 0x00,
+ 0x01, 0x44, 0xff,
+ 0x01, 0x45, 0x26,
+ 0x01, 0x46, 0x05,
+ 0x01, 0x40, 0x40,
+ 0x01, 0x0E, 0x06,
+ 0x01, 0x20, 0x1a,
+ 0x01, 0x43, 0x40,
- 0x01, 0xFF, 0x00,
- 0x01, 0x34, 0x03,
- 0x01, 0x35, 0x44,
+ 0x01, 0xFF, 0x00,
+ 0x01, 0x34, 0x03,
+ 0x01, 0x35, 0x44,
- 0x01, 0xFF, 0x01,
- 0x01, 0x31, 0x04,
- 0x01, 0x4b, 0x09,
- 0x01, 0x4c, 0x05,
- 0x01, 0x4d, 0x04,
+ 0x01, 0xFF, 0x01,
+ 0x01, 0x31, 0x04,
+ 0x01, 0x4b, 0x09,
+ 0x01, 0x4c, 0x05,
+ 0x01, 0x4d, 0x04,
- 0x01, 0xFF, 0x00,
- 0x01, 0x44, 0x00,
- 0x01, 0x45, 0x20,
- 0x01, 0x47, 0x08,
- 0x01, 0x48, 0x28,
- 0x01, 0x67, 0x00,
- 0x01, 0x70, 0x04,
- 0x01, 0x71, 0x01,
- 0x01, 0x72, 0xfe,
- 0x01, 0x76, 0x00,
- 0x01, 0x77, 0x00,
+ 0x01, 0xFF, 0x00,
+ 0x01, 0x44, 0x00,
+ 0x01, 0x45, 0x20,
+ 0x01, 0x47, 0x08,
+ 0x01, 0x48, 0x28,
+ 0x01, 0x67, 0x00,
+ 0x01, 0x70, 0x04,
+ 0x01, 0x71, 0x01,
+ 0x01, 0x72, 0xfe,
+ 0x01, 0x76, 0x00,
+ 0x01, 0x77, 0x00,
- 0x01, 0xFF, 0x01,
- 0x01, 0x0d, 0x01,
+ 0x01, 0xFF, 0x01,
+ 0x01, 0x0d, 0x01,
- 0x01, 0xFF, 0x00,
- 0x01, 0x80, 0x01,
- 0x01, 0x01, 0xF8,
+ 0x01, 0xFF, 0x00,
+ 0x01, 0x80, 0x01,
+ 0x01, 0x01, 0xF8,
- 0x01, 0xFF, 0x01,
- 0x01, 0x8e, 0x01,
- 0x01, 0x00, 0x01,
- 0x01, 0xFF, 0x00,
- 0x01, 0x80, 0x00,
+ 0x01, 0xFF, 0x01,
+ 0x01, 0x8e, 0x01,
+ 0x01, 0x00, 0x01,
+ 0x01, 0xFF, 0x00,
+ 0x01, 0x80, 0x00,
- 0x00, 0x00, 0x00
+ 0x00, 0x00, 0x00
};
#ifdef __cplusplus
--- a/VL53L0X_types.h Wed Oct 04 13:21:38 2017 +0000
+++ b/VL53L0X_types.h Fri Oct 13 15:31:04 2017 +0000
@@ -53,13 +53,13 @@
#if ! defined(STDINT_H) && !defined(_GCC_STDINT_H) &&!defined(__STDINT_DECLS) && !defined(_GCC_WRAP_STDINT_H)
- #pragma message("Please review type definition of STDINT define for your platform and add to list above ")
+#pragma message("Please review type definition of STDINT define for your platform and add to list above ")
- /*
- * target platform do not provide stdint or use a different #define than above
- * to avoid seeing the message below addapt the #define list above or implement
- * all type and delete these pragma
- */
+/*
+ * target platform do not provide stdint or use a different #define than above
+ * to avoid seeing the message below addapt the #define list above or implement
+ * all type and delete these pragma
+ */
/** \ingroup VL53L0X_portingType_group
* @{
