ULTRA96/tof_demo/src/vl53l0x_i2c.c
//
// - - - - - - VL53L0X routines - - - - - - - - -
//
// Sets up the VL53L0X_Device and initializes the I2C interface
// for the WNC module.
//
Sets up the VL53L0X_Device and initializes the I2C interface
for the WNC module.
Sets up the VL53L0X_Device and initializes the I2C interface for the WNC module .
int VL53L0X_i2c_init(VL53L0X_Dev_t *pMyDevice)
{
    pMyDevice->I2cDevAddr      = VL53L0X_SAD;
    pMyDevice->comms_type      =  I2C_MODE;
    __gpioOpen(enPin);
    __gpioDirection(enPin, 1); 
    __gpioSet(enPin,0);
    _delay(10);                                  
    __gpioSet(enPin,1);
    return i2c_init()? VL53L0X_ERROR_NONE: VL53L0X_ERROR_CONTROL_INTERFACE;
}
int VL53L0X_i2c_init ( VL53L0X_Dev_t * pMyDevice ) { pMyDevice -> I2cDevAddr = VL53L0X_SAD ; pMyDevice -> comms_type = I2C_MODE ; __gpioOpen ( enPin ) ; __gpioDirection ( enPin , 1 ) ; __gpioSet ( enPin , 0 ) ; _delay ( 10 ) ; __gpioSet ( enPin , 1 ) ; return i2c_init ( ) ? VL53L0X_ERROR_NONE : VL53L0X_ERROR_CONTROL_INTERFACE ; }
- - - - - VL53L0X routines - - - - - - - 
Sets up the VL53L0X_Device and initializes the I2C interface
for the WNC module.
- - - - - VL53L0X routines - - - - - - - Sets up the VL53L0X_Device and initializes the I2C interface for the WNC module .
//    __gpioOpen(drPin); //    __gpioDirection(drPin, 0); // 1 for output, 0 for input // 1 for output, 0 for input //allow 10ms for reset to occur