Simple VL6180x demo for VL6180x Explorer shield with Nucleo F401 adapted from SparkFun example.

Dependents:   VL6180X VL6180X_Explorer VL6180X_Explorer VL6180X ... more

Committer:
highroads
Date:
Sun May 10 19:09:30 2015 +0000
Revision:
2:31313127c530
Parent:
1:3ebf8893b7e0
Child:
3:4a20f2102acf
Documentation tidied up

Who changed what in which revision?

UserRevisionLine numberNew contents of line
highroads 2:31313127c530 1 /**
highroads 2:31313127c530 2 * @file VL6180x.h
highroads 2:31313127c530 3 * @brief Library for VL6180x time of flight range finder.
highroads 0:4a5d4b4a40c4 4 * Casey Kuhns @ SparkFun Electronics
highroads 0:4a5d4b4a40c4 5 * 10/29/2014
highroads 0:4a5d4b4a40c4 6 * https://github.com/sparkfun/
highroads 0:4a5d4b4a40c4 7 *
highroads 0:4a5d4b4a40c4 8 * The VL6180x by ST micro is a time of flight range finder that
highroads 0:4a5d4b4a40c4 9 * uses pulsed IR light to determine distances from object at close
highroads 0:4a5d4b4a40c4 10 * range. The average range of a sensor is between 0-200mm
highroads 0:4a5d4b4a40c4 11 *
highroads 0:4a5d4b4a40c4 12 * In this file are the function prototypes in the VL6180x class
highroads 0:4a5d4b4a40c4 13 *
highroads 0:4a5d4b4a40c4 14 * Resources:
highroads 0:4a5d4b4a40c4 15 * This library uses the Arduino Wire.h to complete I2C transactions.
highroads 0:4a5d4b4a40c4 16 *
highroads 0:4a5d4b4a40c4 17 * Development environment specifics:
highroads 0:4a5d4b4a40c4 18 * IDE: Arduino 1.0.5
highroads 0:4a5d4b4a40c4 19 * Hardware Platform: Arduino Pro 3.3V/8MHz
highroads 0:4a5d4b4a40c4 20 * VL6180x Breakout Version: 1.0
highroads 0:4a5d4b4a40c4 21 *
highroads 0:4a5d4b4a40c4 22 * Some settings and initial values come from code written by Kris Winer
highroads 0:4a5d4b4a40c4 23 * VL6180X_t3 Basic Example Code
highroads 0:4a5d4b4a40c4 24 * by: Kris Winer
highroads 0:4a5d4b4a40c4 25 * date: September 1, 2014
highroads 0:4a5d4b4a40c4 26 * license: Beerware - Use this code however you'd like. If you
highroads 0:4a5d4b4a40c4 27 * find it useful you can buy me a beer some time.
highroads 0:4a5d4b4a40c4 28 *
highroads 0:4a5d4b4a40c4 29 * This code is beerware. If you see me (or any other SparkFun employee) at the
highroads 0:4a5d4b4a40c4 30 * local pub, and you've found our code helpful, please buy us a round!
highroads 0:4a5d4b4a40c4 31 *
highroads 0:4a5d4b4a40c4 32 * Distributed as-is; no warranty is given.
highroads 2:31313127c530 33 */
highroads 0:4a5d4b4a40c4 34 #include "mbed.h"
highroads 0:4a5d4b4a40c4 35 #ifndef VL6180x_h
highroads 0:4a5d4b4a40c4 36 #define VL6180x_h
highroads 0:4a5d4b4a40c4 37
highroads 0:4a5d4b4a40c4 38 #define VL6180x_FAILURE_RESET -1
highroads 0:4a5d4b4a40c4 39
highroads 0:4a5d4b4a40c4 40 #define VL6180X_IDENTIFICATION_MODEL_ID 0x0000
highroads 0:4a5d4b4a40c4 41 #define VL6180X_IDENTIFICATION_MODEL_REV_MAJOR 0x0001
highroads 0:4a5d4b4a40c4 42 #define VL6180X_IDENTIFICATION_MODEL_REV_MINOR 0x0002
highroads 0:4a5d4b4a40c4 43 #define VL6180X_IDENTIFICATION_MODULE_REV_MAJOR 0x0003
highroads 0:4a5d4b4a40c4 44 #define VL6180X_IDENTIFICATION_MODULE_REV_MINOR 0x0004
highroads 0:4a5d4b4a40c4 45 #define VL6180X_IDENTIFICATION_DATE 0x0006 //16bit value
highroads 0:4a5d4b4a40c4 46 #define VL6180X_IDENTIFICATION_TIME 0x0008 //16bit value
highroads 0:4a5d4b4a40c4 47
highroads 0:4a5d4b4a40c4 48 #define VL6180X_SYSTEM_MODE_GPIO0 0x0010
highroads 0:4a5d4b4a40c4 49 #define VL6180X_SYSTEM_MODE_GPIO1 0x0011
highroads 0:4a5d4b4a40c4 50 #define VL6180X_SYSTEM_HISTORY_CTRL 0x0012
highroads 0:4a5d4b4a40c4 51 #define VL6180X_SYSTEM_INTERRUPT_CONFIG_GPIO 0x0014
highroads 0:4a5d4b4a40c4 52 #define VL6180X_SYSTEM_INTERRUPT_CLEAR 0x0015
highroads 0:4a5d4b4a40c4 53 #define VL6180X_SYSTEM_FRESH_OUT_OF_RESET 0x0016
highroads 0:4a5d4b4a40c4 54 #define VL6180X_SYSTEM_GROUPED_PARAMETER_HOLD 0x0017
highroads 0:4a5d4b4a40c4 55
highroads 0:4a5d4b4a40c4 56 #define VL6180X_SYSRANGE_START 0x0018
highroads 0:4a5d4b4a40c4 57 #define VL6180X_SYSRANGE_THRESH_HIGH 0x0019
highroads 0:4a5d4b4a40c4 58 #define VL6180X_SYSRANGE_THRESH_LOW 0x001A
highroads 0:4a5d4b4a40c4 59 #define VL6180X_SYSRANGE_INTERMEASUREMENT_PERIOD 0x001B
highroads 0:4a5d4b4a40c4 60 #define VL6180X_SYSRANGE_MAX_CONVERGENCE_TIME 0x001C
highroads 0:4a5d4b4a40c4 61 #define VL6180X_SYSRANGE_CROSSTALK_COMPENSATION_RATE 0x001E
highroads 0:4a5d4b4a40c4 62 #define VL6180X_SYSRANGE_CROSSTALK_VALID_HEIGHT 0x0021
highroads 0:4a5d4b4a40c4 63 #define VL6180X_SYSRANGE_EARLY_CONVERGENCE_ESTIMATE 0x0022
highroads 0:4a5d4b4a40c4 64 #define VL6180X_SYSRANGE_PART_TO_PART_RANGE_OFFSET 0x0024
highroads 0:4a5d4b4a40c4 65 #define VL6180X_SYSRANGE_RANGE_IGNORE_VALID_HEIGHT 0x0025
highroads 0:4a5d4b4a40c4 66 #define VL6180X_SYSRANGE_RANGE_IGNORE_THRESHOLD 0x0026
highroads 0:4a5d4b4a40c4 67 #define VL6180X_SYSRANGE_MAX_AMBIENT_LEVEL_MULT 0x002C
highroads 0:4a5d4b4a40c4 68 #define VL6180X_SYSRANGE_RANGE_CHECK_ENABLES 0x002D
highroads 0:4a5d4b4a40c4 69 #define VL6180X_SYSRANGE_VHV_RECALIBRATE 0x002E
highroads 0:4a5d4b4a40c4 70 #define VL6180X_SYSRANGE_VHV_REPEAT_RATE 0x0031
highroads 0:4a5d4b4a40c4 71
highroads 0:4a5d4b4a40c4 72 #define VL6180X_SYSALS_START 0x0038
highroads 0:4a5d4b4a40c4 73 #define VL6180X_SYSALS_THRESH_HIGH 0x003A
highroads 0:4a5d4b4a40c4 74 #define VL6180X_SYSALS_THRESH_LOW 0x003C
highroads 0:4a5d4b4a40c4 75 #define VL6180X_SYSALS_INTERMEASUREMENT_PERIOD 0x003E
highroads 0:4a5d4b4a40c4 76 #define VL6180X_SYSALS_ANALOGUE_GAIN 0x003F
highroads 0:4a5d4b4a40c4 77 #define VL6180X_SYSALS_INTEGRATION_PERIOD 0x0040
highroads 0:4a5d4b4a40c4 78
highroads 0:4a5d4b4a40c4 79 #define VL6180X_RESULT_RANGE_STATUS 0x004D
highroads 0:4a5d4b4a40c4 80 #define VL6180X_RESULT_ALS_STATUS 0x004E
highroads 0:4a5d4b4a40c4 81 #define VL6180X_RESULT_INTERRUPT_STATUS_GPIO 0x004F
highroads 0:4a5d4b4a40c4 82 #define VL6180X_RESULT_ALS_VAL 0x0050
highroads 0:4a5d4b4a40c4 83 #define VL6180X_RESULT_HISTORY_BUFFER 0x0052
highroads 0:4a5d4b4a40c4 84 #define VL6180X_RESULT_RANGE_VAL 0x0062
highroads 0:4a5d4b4a40c4 85 #define VL6180X_RESULT_RANGE_RAW 0x0064
highroads 0:4a5d4b4a40c4 86 #define VL6180X_RESULT_RANGE_RETURN_RATE 0x0066
highroads 0:4a5d4b4a40c4 87 #define VL6180X_RESULT_RANGE_REFERENCE_RATE 0x0068
highroads 0:4a5d4b4a40c4 88 #define VL6180X_RESULT_RANGE_RETURN_SIGNAL_COUNT 0x006C
highroads 0:4a5d4b4a40c4 89 #define VL6180X_RESULT_RANGE_REFERENCE_SIGNAL_COUNT 0x0070
highroads 0:4a5d4b4a40c4 90 #define VL6180X_RESULT_RANGE_RETURN_AMB_COUNT 0x0074
highroads 0:4a5d4b4a40c4 91 #define VL6180X_RESULT_RANGE_REFERENCE_AMB_COUNT 0x0078
highroads 0:4a5d4b4a40c4 92 #define VL6180X_RESULT_RANGE_RETURN_CONV_TIME 0x007C
highroads 0:4a5d4b4a40c4 93 #define VL6180X_RESULT_RANGE_REFERENCE_CONV_TIME 0x0080
highroads 0:4a5d4b4a40c4 94
highroads 0:4a5d4b4a40c4 95 #define VL6180X_READOUT_AVERAGING_SAMPLE_PERIOD 0x010A
highroads 0:4a5d4b4a40c4 96 #define VL6180X_FIRMWARE_BOOTUP 0x0119
highroads 0:4a5d4b4a40c4 97 #define VL6180X_FIRMWARE_RESULT_SCALER 0x0120
highroads 0:4a5d4b4a40c4 98 #define VL6180X_I2C_SLAVE_DEVICE_ADDRESS 0x0212
highroads 0:4a5d4b4a40c4 99 #define VL6180X_INTERLEAVED_MODE_ENABLE 0x02A3
highroads 0:4a5d4b4a40c4 100
highroads 2:31313127c530 101 /**
highroads 2:31313127c530 102 * gain settings for ALS
highroads 2:31313127c530 103 *Data sheet shows gain values as binary list
highroads 2:31313127c530 104 */
highroads 2:31313127c530 105 enum vl6180x_als_gain {
highroads 0:4a5d4b4a40c4 106
highroads 0:4a5d4b4a40c4 107 GAIN_20 = 0, // Actual ALS Gain of 20
highroads 0:4a5d4b4a40c4 108 GAIN_10, // Actual ALS Gain of 10.32
highroads 0:4a5d4b4a40c4 109 GAIN_5, // Actual ALS Gain of 5.21
highroads 0:4a5d4b4a40c4 110 GAIN_2_5, // Actual ALS Gain of 2.60
highroads 0:4a5d4b4a40c4 111 GAIN_1_67, // Actual ALS Gain of 1.72
highroads 0:4a5d4b4a40c4 112 GAIN_1_25, // Actual ALS Gain of 1.28
highroads 0:4a5d4b4a40c4 113 GAIN_1 , // Actual ALS Gain of 1.01
highroads 0:4a5d4b4a40c4 114 GAIN_40, // Actual ALS Gain of 40
highroads 0:4a5d4b4a40c4 115
highroads 0:4a5d4b4a40c4 116 };
highroads 2:31313127c530 117 /**
highroads 2:31313127c530 118 * VL6180xIdentification
highroads 2:31313127c530 119 * @brief structure to hold module identification
highroads 2:31313127c530 120 *
highroads 2:31313127c530 121 * @param idModel Model number
highroads 2:31313127c530 122 * @param idModelRevMajor Major revision
highroads 2:31313127c530 123 * @param idModelRevMinor Minor revision
highroads 2:31313127c530 124 * @param idModuleRevMajor Module Major revision
highroads 2:31313127c530 125 * @param idModuleRevMinor Module Minor revision
highroads 2:31313127c530 126 * @param idDate Date of manufacture
highroads 2:31313127c530 127 * @param idTime Seconds after midnight manufacture
highroads 2:31313127c530 128 */
highroads 2:31313127c530 129 struct VL6180xIdentification {
highroads 0:4a5d4b4a40c4 130 uint8_t idModel;
highroads 0:4a5d4b4a40c4 131 uint8_t idModelRevMajor;
highroads 0:4a5d4b4a40c4 132 uint8_t idModelRevMinor;
highroads 0:4a5d4b4a40c4 133 uint8_t idModuleRevMajor;
highroads 0:4a5d4b4a40c4 134 uint8_t idModuleRevMinor;
highroads 0:4a5d4b4a40c4 135 uint16_t idDate;
highroads 0:4a5d4b4a40c4 136 uint16_t idTime;
highroads 0:4a5d4b4a40c4 137 };
highroads 2:31313127c530 138 /**
highroads 2:31313127c530 139 * VL6180x tof/als sensor example
highroads 2:31313127c530 140 *
highroads 2:31313127c530 141 * @code
highroads 2:31313127c530 142 #include "mbed.h"
highroads 2:31313127c530 143 #include <VL6180x.h>
highroads 0:4a5d4b4a40c4 144
highroads 2:31313127c530 145 const float GAIN_1 = 1.01; // Actual ALS Gain of 1.01
highroads 2:31313127c530 146 const float GAIN_1_25 = 1.28; // Actual ALS Gain of 1.28
highroads 2:31313127c530 147 const float GAIN_1_67 = 1.72; // Actual ALS Gain of 1.72
highroads 2:31313127c530 148 const float GAIN_2_5 = 2.6; // Actual ALS Gain of 2.60
highroads 2:31313127c530 149 const float GAIN_5 = 5.21; // Actual ALS Gain of 5.21
highroads 2:31313127c530 150 const float GAIN_10 = 10.32; // Actual ALS Gain of 10.32
highroads 2:31313127c530 151 const float GAIN_20 = 20; // Actual ALS Gain of 20
highroads 2:31313127c530 152 const float GAIN_40 = 40; // Actual ALS Gain of 40
highroads 2:31313127c530 153
highroads 2:31313127c530 154
highroads 2:31313127c530 155 #define VL6180X_ADDRESS 0x29
highroads 2:31313127c530 156
highroads 2:31313127c530 157 VL6180xIdentification identification;
highroads 2:31313127c530 158 // mbed uses 8bit addresses shift address by 1 bit left
highroads 2:31313127c530 159 VL6180x sensor(D14, D15, VL6180X_ADDRESS<<1);
highroads 2:31313127c530 160
highroads 2:31313127c530 161 void printIdentification(struct VL6180xIdentification *temp){
highroads 2:31313127c530 162 printf("Model ID = ");
highroads 2:31313127c530 163 printf("%d\n",temp->idModel);
highroads 2:31313127c530 164
highroads 2:31313127c530 165 printf("Model Rev = ");
highroads 2:31313127c530 166 printf("%d",temp->idModelRevMajor);
highroads 2:31313127c530 167 printf(".");
highroads 2:31313127c530 168 printf("%d\n",temp->idModelRevMinor);
highroads 2:31313127c530 169
highroads 2:31313127c530 170 printf("Module Rev = ");
highroads 2:31313127c530 171 printf("%d",temp->idModuleRevMajor);
highroads 2:31313127c530 172 printf(".");
highroads 2:31313127c530 173 printf("%d\n",temp->idModuleRevMinor);
highroads 2:31313127c530 174
highroads 2:31313127c530 175 printf("Manufacture Date = ");
highroads 2:31313127c530 176 printf("%d",((temp->idDate >> 3) & 0x001F));
highroads 2:31313127c530 177 printf("/");
highroads 2:31313127c530 178 printf("%d",((temp->idDate >> 8) & 0x000F));
highroads 2:31313127c530 179 printf("/1");
highroads 2:31313127c530 180 printf("%d\n",((temp->idDate >> 12) & 0x000F));
highroads 2:31313127c530 181 printf(" Phase: ");
highroads 2:31313127c530 182 printf("%d\n",(temp->idDate & 0x0007));
highroads 2:31313127c530 183
highroads 2:31313127c530 184 printf("Manufacture Time (s)= ");
highroads 2:31313127c530 185 printf("%d\n",(temp->idTime * 2));
highroads 2:31313127c530 186 printf("\n\n");
highroads 2:31313127c530 187 }
highroads 2:31313127c530 188 int main() {
highroads 2:31313127c530 189
highroads 2:31313127c530 190 wait_ms(100); // delay .1s
highroads 2:31313127c530 191
highroads 2:31313127c530 192 sensor.getIdentification(&identification); // Retrieve manufacture info from device memory
highroads 2:31313127c530 193 printIdentification(&identification); // Helper function to print all the Module information
highroads 2:31313127c530 194
highroads 2:31313127c530 195 if(sensor.VL6180xInit() != 0){
highroads 2:31313127c530 196 printf("FAILED TO INITALIZE\n"); //Initialize device and check for errors
highroads 2:31313127c530 197 };
highroads 2:31313127c530 198
highroads 2:31313127c530 199 sensor.VL6180xDefautSettings(); //Load default settings to get started.
highroads 2:31313127c530 200
highroads 2:31313127c530 201 wait_ms(1000); // delay 1s
highroads 2:31313127c530 202
highroads 2:31313127c530 203
highroads 2:31313127c530 204
highroads 2:31313127c530 205 while(1) {
highroads 2:31313127c530 206 //Get Ambient Light level and report in LUX
highroads 2:31313127c530 207 printf("Ambient Light Level (Lux) = ");
highroads 2:31313127c530 208
highroads 2:31313127c530 209 //Input GAIN for light levels,
highroads 2:31313127c530 210 // GAIN_20 // Actual ALS Gain of 20
highroads 2:31313127c530 211 // GAIN_10 // Actual ALS Gain of 10.32
highroads 2:31313127c530 212 // GAIN_5 // Actual ALS Gain of 5.21
highroads 2:31313127c530 213 // GAIN_2_5 // Actual ALS Gain of 2.60
highroads 2:31313127c530 214 // GAIN_1_67 // Actual ALS Gain of 1.72
highroads 2:31313127c530 215 // GAIN_1_25 // Actual ALS Gain of 1.28
highroads 2:31313127c530 216 // GAIN_1 // Actual ALS Gain of 1.01
highroads 2:31313127c530 217 // GAIN_40 // Actual ALS Gain of 40
highroads 2:31313127c530 218
highroads 2:31313127c530 219 printf("%f\n",sensor.getAmbientLight(GAIN_1) );
highroads 2:31313127c530 220
highroads 2:31313127c530 221 //Get Distance and report in mm
highroads 2:31313127c530 222 printf("Distance measured (mm) = ");
highroads 2:31313127c530 223 printf("%d\n", sensor.getDistance() );
highroads 2:31313127c530 224
highroads 2:31313127c530 225 wait_ms(500);
highroads 2:31313127c530 226 }
highroads 2:31313127c530 227 }
highroads 2:31313127c530 228 * @endcode
highroads 2:31313127c530 229 */
highroads 0:4a5d4b4a40c4 230 class VL6180x
highroads 0:4a5d4b4a40c4 231 {
highroads 0:4a5d4b4a40c4 232 public:
highroads 2:31313127c530 233 /**
highroads 2:31313127c530 234 * VL6180x constructor
highroads 2:31313127c530 235 *
highroads 2:31313127c530 236 * @param sda SDA pin
highroads 2:31313127c530 237 * @param sdl SCL pin
highroads 2:31313127c530 238 * @param addr addr of the I2C peripheral
highroads 2:31313127c530 239 */
highroads 0:4a5d4b4a40c4 240 VL6180x(PinName sda, PinName scl, uint8_t addr);
highroads 2:31313127c530 241 /**
highroads 2:31313127c530 242 * VL6180x destructor
highroads 2:31313127c530 243 */
highroads 0:4a5d4b4a40c4 244 ~VL6180x();
highroads 2:31313127c530 245 /**
highroads 2:31313127c530 246 * Send mandatory settings as stated in ST datasheet.
highroads 2:31313127c530 247 * http://www.st.com/st-web-ui/static/active/en/resource/technical/document/application_note/DM00122600.pdf (Section 1.3)
highroads 2:31313127c530 248 * @returns 0 if ok
highroads 2:31313127c530 249 * @returns -1 on error*/
highroads 2:31313127c530 250 int VL6180xInit(void);
highroads 2:31313127c530 251 /**
highroads 2:31313127c530 252 * Use default settings from ST data sheet section 9.
highroads 2:31313127c530 253 *
highroads 2:31313127c530 254 * http://www.st.com/st-web-ui/static/active/en/resource/technical/document/application_note/DM00122600.pdf
highroads 2:31313127c530 255 */
highroads 0:4a5d4b4a40c4 256 void VL6180xDefautSettings(void);
highroads 2:31313127c530 257 /**
highroads 2:31313127c530 258 * Get Range distance in (mm)
highroads 2:31313127c530 259 * @returns TOF distance in mm
highroads 2:31313127c530 260 */
highroads 0:4a5d4b4a40c4 261 uint8_t getDistance();
highroads 2:31313127c530 262 /**
highroads 2:31313127c530 263 * Get ALS level in Lux
highroads 2:31313127c530 264 * @param vl6180x_als_gain gain setting for sensor
highroads 2:31313127c530 265 * @param sdl SCL pin
highroads 2:31313127c530 266 * @param addr addr of the I2C peripheral
highroads 2:31313127c530 267 * @returns light level in Lux
highroads 2:31313127c530 268 */
highroads 0:4a5d4b4a40c4 269 float getAmbientLight(vl6180x_als_gain VL6180X_ALS_GAIN);
highroads 2:31313127c530 270 /**
highroads 2:31313127c530 271 * Load structure provided by the user with identification info
highroads 2:31313127c530 272 * Structure example:
highroads 2:31313127c530 273 * struct VL6180xIdentification
highroads 2:31313127c530 274 */
highroads 0:4a5d4b4a40c4 275 void getIdentification(struct VL6180xIdentification *temp);
highroads 0:4a5d4b4a40c4 276
highroads 2:31313127c530 277 /**
highroads 2:31313127c530 278 * Change the default address of the device to allow multiple
highroads 2:31313127c530 279 * sensors on the bus. Can use up to 127 sensors. New address
highroads 2:31313127c530 280 * is saved in non-volatile device memory.
highroads 2:31313127c530 281 * @param old_address current address
highroads 2:31313127c530 282 * @param new_address desired new address
highroads 2:31313127c530 283 * @returns new address
highroads 2:31313127c530 284 */
highroads 0:4a5d4b4a40c4 285 uint8_t changeAddress(uint8_t old_address, uint8_t new_address);
highroads 0:4a5d4b4a40c4 286
highroads 0:4a5d4b4a40c4 287
highroads 0:4a5d4b4a40c4 288 private:
highroads 0:4a5d4b4a40c4 289 //Store address given when the class is initialized.
highroads 0:4a5d4b4a40c4 290 //This value can be changed by the changeAddress() function
highroads 0:4a5d4b4a40c4 291 I2C m_i2c;
highroads 0:4a5d4b4a40c4 292 int m_addr;
highroads 2:31313127c530 293 /**
highroads 2:31313127c530 294 * read 8 bit register
highroads 2:31313127c530 295 * @param registerAddr address for register
highroads 2:31313127c530 296 * @returns contents of register
highroads 2:31313127c530 297 */
highroads 0:4a5d4b4a40c4 298 uint8_t VL6180x_getRegister(uint16_t registerAddr);
highroads 2:31313127c530 299 /**
highroads 2:31313127c530 300 * read 16 bit register
highroads 2:31313127c530 301 * @param registerAddr address for register
highroads 2:31313127c530 302 * @param returns contents of register
highroads 2:31313127c530 303 */
highroads 2:31313127c530 304 uint16_t VL6180x_getRegister16bit(uint16_t registerAddr);
highroads 2:31313127c530 305 /**
highroads 2:31313127c530 306 * write 8 bit register
highroads 2:31313127c530 307 * @param registerAddr address for register
highroads 2:31313127c530 308 * @returns ERROR
highroads 2:31313127c530 309 */
highroads 0:4a5d4b4a40c4 310 void VL6180x_setRegister(uint16_t registerAddr, uint8_t data);
highroads 2:31313127c530 311 /**
highroads 2:31313127c530 312 * write 16 bit register
highroads 2:31313127c530 313 * @param registerAddr address for register
highroads 2:31313127c530 314 * @returns ERROR
highroads 2:31313127c530 315 */
highroads 0:4a5d4b4a40c4 316 void VL6180x_setRegister16bit(uint16_t registerAddr, uint16_t data);
highroads 0:4a5d4b4a40c4 317 };
highroads 0:4a5d4b4a40c4 318
highroads 0:4a5d4b4a40c4 319 #endif