2023-05-29 06:14 AM
Hi,
I would like to know if we can configure GPIO0 or GPIO1 as a logic output mode. In datasheet, we can configure in INT mode. But we need to clear the flag each time we have a value. So we have a wrong value during the clearing.
I would like to configure the sensor for exemple 40cm detection, and have "1" when we detect somthing, and "0" when not without clearing or something else. Is that possible ?
2023-06-05 01:25 AM
Hi
Yes, it is possible, as you have seen the GPIO configuration in datasheet, I suggest you choose GPIO1 for this function, as GPIO0 is normally used as chip enable function. from the datasheet you can configure GPIO with SYSTEM__MODE_GPIO1(0x011), you can select Active-high and configure GPIO as interrupt output function.
Beyond GPIO configuration, you need also confige the interrupt mode, please refer SYSTEM__INTERRUPT_CONFIG_GPIO()0X014 OR VL6180x_RangeConfigInterrupt() for mor detail. you can choose below Level Low function.
• New sample ready
• Level low (range/ALS value < low threshold)
• Level high (range/ALS value > high threshold)
• Out of window (range/ALS value < low threshold) OR (range/ALS value > high
threshold)
Br
Zhiyuan.Han