37 #ifndef _VL53L0X_DEF_H_
38 #define _VL53L0X_DEF_H_
52 #define VL53L0X10_SPECIFICATION_VER_MAJOR 1
54 #define VL53L0X10_SPECIFICATION_VER_MINOR 2
56 #define VL53L0X10_SPECIFICATION_VER_SUB 7
58 #define VL53L0X10_SPECIFICATION_VER_REVISION 1440
61 #define VL53L0X10_IMPLEMENTATION_VER_MAJOR 1
63 #define VL53L0X10_IMPLEMENTATION_VER_MINOR 0
65 #define VL53L0X10_IMPLEMENTATION_VER_SUB 9
67 #define VL53L0X10_IMPLEMENTATION_VER_REVISION 3673
70 #define VL53L0X_SPECIFICATION_VER_MAJOR 1
72 #define VL53L0X_SPECIFICATION_VER_MINOR 2
74 #define VL53L0X_SPECIFICATION_VER_SUB 7
76 #define VL53L0X_SPECIFICATION_VER_REVISION 1440
79 #define VL53L0X_IMPLEMENTATION_VER_MAJOR 1
81 #define VL53L0X_IMPLEMENTATION_VER_MINOR 0
83 #define VL53L0X_IMPLEMENTATION_VER_SUB 2
85 #define VL53L0X_IMPLEMENTATION_VER_REVISION 4823
86 #define VL53L0X_DEFAULT_MAX_LOOP 2000
87 #define VL53L0X_MAX_STRING_LENGTH 32
133 #define VL53L0X_ERROR_NONE ((VL53L0X_Error) 0)
134 #define VL53L0X_ERROR_CALIBRATION_WARNING ((VL53L0X_Error) -1)
139 #define VL53L0X_ERROR_MIN_CLIPPED ((VL53L0X_Error) -2)
142 #define VL53L0X_ERROR_UNDEFINED ((VL53L0X_Error) -3)
144 #define VL53L0X_ERROR_INVALID_PARAMS ((VL53L0X_Error) -4)
146 #define VL53L0X_ERROR_NOT_SUPPORTED ((VL53L0X_Error) -5)
148 #define VL53L0X_ERROR_RANGE_ERROR ((VL53L0X_Error) -6)
150 #define VL53L0X_ERROR_TIME_OUT ((VL53L0X_Error) -7)
152 #define VL53L0X_ERROR_MODE_NOT_SUPPORTED ((VL53L0X_Error) -8)
154 #define VL53L0X_ERROR_BUFFER_TOO_SMALL ((VL53L0X_Error) -9)
156 #define VL53L0X_ERROR_GPIO_NOT_EXISTING ((VL53L0X_Error) -10)
158 #define VL53L0X_ERROR_GPIO_FUNCTIONALITY_NOT_SUPPORTED ((VL53L0X_Error) -11)
160 #define VL53L0X_ERROR_INTERRUPT_NOT_CLEARED ((VL53L0X_Error) -12)
162 #define VL53L0X_ERROR_CONTROL_INTERFACE ((VL53L0X_Error) -20)
164 #define VL53L0X_ERROR_INVALID_COMMAND ((VL53L0X_Error) -30)
167 #define VL53L0X_ERROR_DIVISION_BY_ZERO ((VL53L0X_Error) -40)
169 #define VL53L0X_ERROR_REF_SPAD_INIT ((VL53L0X_Error) -50)
171 #define VL53L0X_ERROR_NOT_IMPLEMENTED ((VL53L0X_Error) -99)
183 #define VL53L0X_DEVICEMODE_SINGLE_RANGING ((VL53L0X_DeviceModes) 0)
184 #define VL53L0X_DEVICEMODE_CONTINUOUS_RANGING ((VL53L0X_DeviceModes) 1)
185 #define VL53L0X_DEVICEMODE_SINGLE_HISTOGRAM ((VL53L0X_DeviceModes) 2)
186 #define VL53L0X_DEVICEMODE_CONTINUOUS_TIMED_RANGING ((VL53L0X_DeviceModes) 3)
187 #define VL53L0X_DEVICEMODE_SINGLE_ALS ((VL53L0X_DeviceModes) 10)
188 #define VL53L0X_DEVICEMODE_GPIO_DRIVE ((VL53L0X_DeviceModes) 20)
189 #define VL53L0X_DEVICEMODE_GPIO_OSC ((VL53L0X_DeviceModes) 21)
201 #define VL53L0X_HISTOGRAMMODE_DISABLED ((VL53L0X_HistogramModes) 0)
203 #define VL53L0X_HISTOGRAMMODE_REFERENCE_ONLY ((VL53L0X_HistogramModes) 1)
205 #define VL53L0X_HISTOGRAMMODE_RETURN_ONLY ((VL53L0X_HistogramModes) 2)
207 #define VL53L0X_HISTOGRAMMODE_BOTH ((VL53L0X_HistogramModes) 3)
220 #define VL53L0X_POWERMODE_STANDBY_LEVEL1 ((VL53L0X_PowerModes) 0)
222 #define VL53L0X_POWERMODE_STANDBY_LEVEL2 ((VL53L0X_PowerModes) 1)
224 #define VL53L0X_POWERMODE_IDLE_LEVEL1 ((VL53L0X_PowerModes) 2)
226 #define VL53L0X_POWERMODE_IDLE_LEVEL2 ((VL53L0X_PowerModes) 3)
275 #define VL53L0X_STATE_POWERDOWN ((VL53L0X_State) 0)
277 #define VL53L0X_STATE_WAIT_STATICINIT ((VL53L0X_State) 1)
279 #define VL53L0X_STATE_STANDBY ((VL53L0X_State) 2)
281 #define VL53L0X_STATE_IDLE ((VL53L0X_State) 3)
283 #define VL53L0X_STATE_RUNNING ((VL53L0X_State) 4)
285 #define VL53L0X_STATE_UNKNOWN ((VL53L0X_State) 98)
287 #define VL53L0X_STATE_ERROR ((VL53L0X_State) 99)
346 #define VL53L0X_HISTOGRAM_BUFFER_SIZE 24
368 #define VL53L0X_REF_SPAD_BUFFER_SIZE 6
498 #define VL53L0X_INTERRUPTPOLARITY_LOW ((VL53L0X_InterruptPolarity) 0)
500 #define VL53L0X_INTERRUPTPOLARITY_HIGH ((VL53L0X_InterruptPolarity) 1)
512 #define VL53L0X_VCSEL_PERIOD_PRE_RANGE ((VL53L0X_VcselPeriod) 0)
514 #define VL53L0X_VCSEL_PERIOD_FINAL_RANGE ((VL53L0X_VcselPeriod) 1)
542 #define VL53L0X_SEQUENCESTEP_TCC ((VL53L0X_VcselPeriod) 0)
544 #define VL53L0X_SEQUENCESTEP_DSS ((VL53L0X_VcselPeriod) 1)
546 #define VL53L0X_SEQUENCESTEP_MSRC ((VL53L0X_VcselPeriod) 2)
548 #define VL53L0X_SEQUENCESTEP_PRE_RANGE ((VL53L0X_VcselPeriod) 3)
550 #define VL53L0X_SEQUENCESTEP_FINAL_RANGE ((VL53L0X_VcselPeriod) 4)
553 #define VL53L0X_SEQUENCESTEP_NUMBER_OF_CHECKS 5
566 #define VL53L0X_SETPARAMETERFIELD(Dev, field, value) \
567 PALDevDataSet(Dev, CurrentParameters.field, value)
569 #define VL53L0X_GETPARAMETERFIELD(Dev, field, variable) \
570 variable = PALDevDataGet(Dev, CurrentParameters).field
573 #define VL53L0X_SETARRAYPARAMETERFIELD(Dev, field, index, value) \
574 PALDevDataSet(Dev, CurrentParameters.field[index], value)
576 #define VL53L0X_GETARRAYPARAMETERFIELD(Dev, field, index, variable) \
577 variable = PALDevDataGet(Dev, CurrentParameters).field[index]
580 #define VL53L0X_SETDEVICESPECIFICPARAMETER(Dev, field, value) \
581 PALDevDataSet(Dev, DeviceSpecificParameters.field, value)
583 #define VL53L0X_GETDEVICESPECIFICPARAMETER(Dev, field) \
584 PALDevDataGet(Dev, DeviceSpecificParameters).field
587 #define VL53L0X_FIXPOINT1616TOFIXPOINT97(Value) \
588 (uint16_t)((Value>>9)&0xFFFF)
589 #define VL53L0X_FIXPOINT97TOFIXPOINT1616(Value) \
590 (FixPoint1616_t)(Value<<9)
592 #define VL53L0X_FIXPOINT1616TOFIXPOINT88(Value) \
593 (uint16_t)((Value>>8)&0xFFFF)
594 #define VL53L0X_FIXPOINT88TOFIXPOINT1616(Value) \
595 (FixPoint1616_t)(Value<<8)
597 #define VL53L0X_FIXPOINT1616TOFIXPOINT412(Value) \
598 (uint16_t)((Value>>4)&0xFFFF)
599 #define VL53L0X_FIXPOINT412TOFIXPOINT1616(Value) \
600 (FixPoint1616_t)(Value<<4)
602 #define VL53L0X_FIXPOINT1616TOFIXPOINT313(Value) \
603 (uint16_t)((Value>>3)&0xFFFF)
604 #define VL53L0X_FIXPOINT313TOFIXPOINT1616(Value) \
605 (FixPoint1616_t)(Value<<3)
607 #define VL53L0X_FIXPOINT1616TOFIXPOINT08(Value) \
608 (uint8_t)((Value>>8)&0x00FF)
609 #define VL53L0X_FIXPOINT08TOFIXPOINT1616(Value) \
610 (FixPoint1616_t)(Value<<8)
612 #define VL53L0X_FIXPOINT1616TOFIXPOINT53(Value) \
613 (uint8_t)((Value>>13)&0x00FF)
614 #define VL53L0X_FIXPOINT53TOFIXPOINT1616(Value) \
615 (FixPoint1616_t)(Value<<13)
617 #define VL53L0X_FIXPOINT1616TOFIXPOINT102(Value) \
618 (uint16_t)((Value>>14)&0x0FFF)
619 #define VL53L0X_FIXPOINT102TOFIXPOINT1616(Value) \
620 (FixPoint1616_t)(Value<<12)
622 #define VL53L0X_MAKEUINT16(lsb, msb) (uint16_t)((((uint16_t)msb)<<8) + \
FixPoint1616_t SignalRateRtnMegaCps
FixPoint1616_t SignalRateMeasFixed400mm
VL53L0X_SpadData_t SpadData
int int32_t
Typedef defining 32 bit int type.
#define VL53L0X_MAX_STRING_LENGTH
Structure containing the Dmax computation parameters and data.
uint8_t ReadDataFromDeviceDone
uint8_t ProductRevisionMinor
int32_t Part2PartOffsetNVMMicroMeter
Defines all parameters for the device.
uint16_t SigmaEstEffAmbWidth
uint8_t VL53L0X_SequenceStepId
Defines the parameters of the Get Device Info Functions.
uint16_t EffectiveSpadRtnCount
VL53L0X_HistogramMeasurementData_t LastHistogramMeasure
VL53L0X_GpioFunctionality Pin0GpioFunctionality
uint8_t RangeFractionalEnable
uint8_t UseInternalTuningSettings
uint8_t * pTuningSettingsPointer
uint32_t MeasurementTimingBudgetMicroSeconds
uint16_t DmaxCalRangeMilliMeter
VL53L0X_PowerModes PowerMode
uint8_t PreRangeVcselPulsePeriod
int32_t AmbTuningWindowFactor_K
uint16_t SigmaEstEffPulseWidth
FixPoint1616_t SigmaEstimate
int32_t Part2PartOffsetAdjustmentNVMMicroMeter
uint8_t WrapAroundCheckEnable
uint8_t VL53L0X_InterruptPolarity
#define VL53L0X_REF_SPAD_BUFFER_SIZE
uint16_t LinearityCorrectiveGain
uint16_t XTalkCompensationRangeMilliMeter
VL53L0X_DeviceError ErrorStatus
FixPoint1616_t XTalkCompensationRateMegaCps
signed char int8_t
Typedef defining 8 bit char type.
uint32_t MeasurementTimeUsec
uint8_t ReferenceSpadType
uint8_t VL53L0X_GpioFunctionality
uint8_t VL53L0X_VcselPeriod
uint8_t RangeFractionalPart
unsigned short uint16_t
Typedef defining 16 bit unsigned short type.
uint16_t SigmaEstEffAmbWidth
FixPoint1616_t SignalEstimate
Defines the parameters of the Get Version Functions.
VL53L0X_DeviceSpecificParameters_t DeviceSpecificParameters
VL53L0X PAL device ST private data structure End user should never access any of these field directl...
int32_t RangeOffsetMicroMeters
FixPoint1616_t AmbientRateRtnMegaCps
uint8_t FinalRangeVcselPulsePeriod
uint32_t InterMeasurementPeriodMilliSeconds
uint16_t SigmaEstEffPulseWidth
unsigned int uint32_t
Typedef defining 32 bit unsigned int type.
uint8_t VL53L0X_DeviceError
uint32_t FinalRangeTimeoutMicroSecs
VL53L0X_DMaxData_t DMaxData
uint32_t FixPoint1616_t
use where fractional values are expected
unsigned char uint8_t
Typedef defining 8 bit unsigned char type.
uint8_t ProductRevisionMajor
uint8_t VL53L0X_PowerModes
FixPoint1616_t OscFrequencyMHz
#define VL53L0X_HISTOGRAM_BUFFER_SIZE
VL53L0X_HistogramModes HistogramMode
uint8_t ReferenceSpadCount
#define VL53L0X_CHECKENABLE_NUMBER_OF_CHECKS
uint8_t VL53L0X_HistogramModes
uint8_t XTalkCompensationEnable
VL53L0X_DeviceModes DeviceMode
uint16_t SigmaEstRefArray
uint32_t PreRangeTimeoutMicroSecs
uint16_t RangeDMaxMilliMeter
uint16_t SigmaEstRefArray
VL53L0X_RangingMeasurementData_t LastRangeMeasure
uint8_t VL53L0X_DeviceModes
uint8_t RefSpadsInitialised
FixPoint1616_t DmaxCalSignalRateRtnMegaCps
uint16_t LastEncodedTimeout
VL53L0X types definition.
FixPoint1616_t LastSignalRefMcps
VL53L0X_DeviceParameters_t CurrentParameters