Condensed Version of Public VL53L0X
Diff: VL53L0X.h
- Revision:
- 1:834986cdde0a
- Parent:
- 0:a1a69d32f310
- Child:
- 2:d07edeaff6f1
--- a/VL53L0X.h Fri Sep 29 15:38:50 2017 +0000 +++ b/VL53L0X.h Wed Oct 04 13:21:38 2017 +0000 @@ -284,7 +284,7 @@ } OperatingMode; /** default device address */ -#define DEFAULT_DEVICE_ADDRESS 0x52 /* (8-bit) */ +#define VL53L0X_DEFAULT_ADDRESS 0x52 /* (8-bit) */ /* Classes -------------------------------------------------------------------*/ /** Class representing a VL53L0 sensor component @@ -297,7 +297,7 @@ * @param[in] &pin_gpio1 pin Mbed InterruptIn PinName to be used as component GPIO_1 INT * @param[in] dev_addr device address, 0x29 by default */ - VL53L0X(DevI2C *i2c, DigitalOut *pin, PinName pin_gpio1, uint8_t dev_addr = DEFAULT_DEVICE_ADDRESS) : _dev_i2c(i2c), + VL53L0X(DevI2C *i2c, DigitalOut *pin, PinName pin_gpio1, uint8_t dev_addr = VL53L0X_DEFAULT_ADDRESS) : _dev_i2c(i2c), _gpio0(pin) { _my_device.I2cDevAddr = dev_addr; @@ -319,7 +319,7 @@ * @param[in] device address, 0x29 by default */ VL53L0X(DevI2C *i2c, Stmpe1600DigiOut *pin, PinName pin_gpio1, - uint8_t dev_addr = DEFAULT_DEVICE_ADDRESS) : _dev_i2c(i2c), _expgpio0(pin) + uint8_t dev_addr = VL53L0X_DEFAULT_ADDRESS) : _dev_i2c(i2c), _expgpio0(pin) { _my_device.I2cDevAddr = dev_addr; _my_device.comms_type = 1; // VL53L0X_COMMS_I2C @@ -377,6 +377,7 @@ } wait_ms(10); } + /** * @brief Initialize the sensor with default values @@ -499,18 +500,18 @@ uint8_t phase_cal; if (status == VL53L0X_ERROR_NONE) { - printf("Call of VL53L0X_StaticInit\r\n"); + //printf("Call of VL53L0X_StaticInit\r\n"); status = VL53L0X_static_init(_device); // Device Initialization } if (status == VL53L0X_ERROR_NONE) { - printf("Call of VL53L0X_PerformRefCalibration\r\n"); + //printf("Call of VL53L0X_PerformRefCalibration\r\n"); status = VL53L0X_perform_ref_calibration(_device, &vhv_settings, &phase_cal); // Device Initialization } if (status == VL53L0X_ERROR_NONE) { - printf("Call of VL53L0X_PerformRefSpadManagement\r\n"); + //printf("Call of VL53L0X_PerformRefSpadManagement\r\n"); status = VL53L0X_perform_ref_spad_management(_device, &ref_spad_count, &is_aperture_spads); // Device Initialization // printf ("refSpadCount = %d, isApertureSpads = %d\r\n", refSpadCount, isApertureSpads); @@ -531,7 +532,7 @@ status = VL53L0X_set_device_mode(_device, VL53L0X_DEVICEMODE_CONTINUOUS_RANGING); if (status == VL53L0X_ERROR_NONE) { - printf ("Call of VL53L0X_StartMeasurement\r\n"); + //printf ("Call of VL53L0X_StartMeasurement\r\n"); status = VL53L0X_start_measurement(_device); } @@ -1940,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);