This commit is contained in:
Mysteo
2023-08-01 19:45:40 +03:00
parent 6aa7f836d3
commit 222f758a2b
5 changed files with 96 additions and 105 deletions

View File

@@ -103,7 +103,6 @@ void vl6180_init (void)
/* Enable Dmax calculation only if value is displayed (to save computation power) */
//VL6180_DMaxSetState(theVL6180Dev, DMaxDispTime>0);
VL6180_ClearAllInterrupt(theVL6180Dev);
VL6180_RangeStartContinuousMode(theVL6180Dev);
allowIT = 1;
}
@@ -275,4 +274,14 @@ void HAL_GPIO_EXTI_Falling_Callback(uint16_t GPIO_Pin)
}
}
}
/* USER CODE END 4 */
/* USER CODE END 4 */
uint8_t vl6180_single_shot ()
{
VL6180_RangeStartSingleShot(theVL6180Dev);
}
int32_t vl6180_is_ready ()
{
return VL6180_RangeWaitDeviceReady(theVL6180Dev, 3);
}

View File

@@ -10,4 +10,6 @@
#endif //MYPROJECT_VL6180_APP_H
void vl6180_init (void);
__weak void proximityMessureCompleted (void);
uint8_t getRange (VL6180_RangeData_t* range);
uint8_t getRange (VL6180_RangeData_t* range);
uint8_t vl6180_single_shot ();
int32_t vl6180_is_ready ();