FastArduino v1.10
C++ library to build fast but small Arduino/AVR projects
|
Helper class to handle VL53L0X special fix-point 9.7 values. More...
#include <fastarduino/devices/vl53l0x_types.h>
Static Public Member Functions | |
static constexpr bool | is_valid (float value) |
Check that a float value is valid for conversion to 9.7 fix-point. More... | |
static constexpr uint16_t | convert (float value) |
Convert a float value into an 9.7 fix-point. More... | |
static constexpr float | convert (uint16_t value) |
Convert an 9.7 fix-point value into a float. More... | |
Helper class to handle VL53L0X special fix-point 9.7 values.
It provides 3 utility methods for conversion and validity checks. This class is used internally by vl53l0x::VL53L0X
class and is normally not useful to application developers. Representation of 9.7 fix-point values is done as an uint16_t
.
Definition at line 50 of file vl53l0x_types.h.
|
inlinestaticconstexpr |
Check that a float
value is valid for conversion to 9.7 fix-point.
value | the value to check (as float) |
true | if value is convertible to 9.7 fix-point. |
false | if value is not convertible to 9.7 fix-point (negative or too big). |
Definition at line 60 of file vl53l0x_types.h.
|
inlinestaticconstexpr |
Convert a float value into an 9.7 fix-point.
value | the value to covnert (as float) |
0 | if value is not covnertible to 9.7 fix-point |
value
if validDefinition at line 73 of file vl53l0x_types.h.
|
inlinestaticconstexpr |
Convert an 9.7 fix-point value into a float.
value | uint16_t 9.7 fix-point value to convert to float |
value
Definition at line 83 of file vl53l0x_types.h.