ATTSK2/tof_demo/vl53l0x_i2c.c
//
// 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;
    gpio_init(GPIO_PIN_96, &drPin);
    gpio_dir(drPin, GPIO_DIR_INPUT);             
    gpio_init(GPIO_PIN_2, &enPin);
    gpio_dir(enPin, GPIO_DIR_OUTPUT);
    gpio_write(enPin,  GPIO_LEVEL_LOW );         
    _delay(10);                                  
    gpio_write(enPin,  GPIO_LEVEL_HIGH );        
    return i2c_bus_init(I2C_BUS_I, &i2c_handle);
}
int VL53L0X_i2c_init ( VL53L0X_Dev_t * pMyDevice ) { pMyDevice -> I2cDevAddr = VL53L0X_SAD ; pMyDevice -> comms_type = I2C_MODE ; gpio_init ( GPIO_PIN_96 , & drPin ) ; gpio_dir ( drPin , GPIO_DIR_INPUT ) ; gpio_init ( GPIO_PIN_2 , & enPin ) ; gpio_dir ( enPin , GPIO_DIR_OUTPUT ) ; gpio_write ( enPin , GPIO_LEVEL_LOW ) ; _delay ( 10 ) ; gpio_write ( enPin , GPIO_LEVEL_HIGH ) ; return i2c_bus_init ( I2C_BUS_I , & i2c_handle ) ; }
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 .
// Data Ready Input (used as interrupt input) //allow 10ms for reset to occur //then ENABLE 