Library to handle the X-NUCLEO-6180XA1 Proximity and ambient light sensor expansion board based on VL6180X.

Dependencies:   X_NUCLEO_COMMON ST_INTERFACES

Dependents:   HelloWorld_6180XA1 SunTracker_BLE Servo_6180XA1 BLE_HR_Light ... more

Fork of X_NUCLEO_6180XA1 by ST Expansion SW Team

X-NUCLEO-6180XA1 Proximity and Ambient Light Sensor Expansion Board Firmware Package

Introduction

This firmware package includes Components Device Drivers and Board Support Package for STMicroelectronics' X-NUCLEO-6180XA1 Proximity and ambient light sensor expansion board based on VL6180X.

Firmware Library

Class X_NUCLEO_6180XA1 is intended to represent the Proximity and ambient light sensor expansion board with the same name.

The expansion board is providing the support of the following components:

  1. on-board VL6180X proximity and ambient light sensor,
  2. up to three additional VL6180X Satellites,
  3. on-board 4-digit display

It is intentionally implemented as a singleton because only one X-NUCLEO-VL6180XA1 at a time might be deployed in a HW component stack. In order to get the singleton instance you have to call class method `Instance()`, e.g.:

// Sensors expansion board singleton instance
static X_NUCLEO_6180XA1 *6180X_expansion_board = X_NUCLEO_6180XA1::Instance();

Arduino Connector Compatibility Warning

Using the X-NUCLEO-6180XA1 expansion board with the NUCLEO-F429ZI requires adopting the following patch:

  • to remove R46 resistor connected to A3 pin;
  • to solder R47 resistor connected to A5 pin.

Alternatively, you can route the Nucleo board’s A5 pin directly to the expansion board’s A3 pin with a wire. In case you patch your expansion board or route the pin, the interrupt signal for the front sensor will be driven on A5 pin rather than on A3 pin.


Example Applications

Revision:
57:fa4c622b04a7
Parent:
35:407b0b127eb8
--- a/Components/VL6180X/vl6180x_cfg.h	Mon Mar 13 17:57:03 2017 +0100
+++ b/Components/VL6180X/vl6180x_cfg.h	Mon Mar 13 19:08:10 2017 +0000
@@ -31,13 +31,13 @@
  */
  
 /**
- * @file VL6180x_cfg.h
+ * @file VL6180X_cfg.h
  *
  * Proximity and ALS configuration
  */
 
-#ifndef VL6180x_CFG_H_
-#define VL6180x_CFG_H_
+#ifndef VL6180X_CFG_H_
+#define VL6180X_CFG_H_
 
 /** @defgroup api_config Configuration
  *  @brief API static configuration
@@ -50,42 +50,42 @@
 
 
 /**
- * @def VL6180x_UPSCALE_SUPPORT
+ * @def VL6180X_UPSCALE_SUPPORT
  * @brief Configure up-scale capabilities and default up-scale factor for ranging operations
  * 
  * @li 1 : Fixed scaling by 1 (no up-scaling support)
  * @li 2 : Fixed scaling by 2
  * @li 3 : Fixed scaling by 3
- * @li  -1 -2 -3 : Run time programmable through @a VL6180x_UpscaleSetScaling(). Default scaling factore is -VL6180x_UPSCALE_SUPPORT \n
+ * @li  -1 -2 -3 : Run time programmable through @a VL6180X_UpscaleSetScaling(). Default scaling factore is -VL6180X_UPSCALE_SUPPORT \n
  */
-//#define VL6180x_UPSCALE_SUPPORT -1
+//#define VL6180X_UPSCALE_SUPPORT -1
 
 /**
- * @def VL6180x_ALS_SUPPORT
+ * @def VL6180X_ALS_SUPPORT
  * @brief Enable ALS support
  *
  * Set to 0 if ALS is not used in application. This can help reducing code size if it is a concern.
  */
-#define VL6180x_ALS_SUPPORT      1
+#define VL6180X_ALS_SUPPORT      1
 
 /**
- * @def VL6180x_HAVE_DMAX_RANGING
+ * @def VL6180X_HAVE_DMAX_RANGING
  * @brief Enable DMax calculation for ranging applications.
  *  
- * When set to 1, __Dmax__ is returned by API typically when  @a VL6180x_RangePollMeasurement() high level
- * function is called (this is returned in @a VL6180x_RangeData_t structure).
+ * When set to 1, __Dmax__ is returned by API typically when  @a VL6180X_RangePollMeasurement() high level
+ * function is called (this is returned in @a VL6180X_RangeData_t structure).
  * __Dmax__ is an estimation of the maximum distance (in mm) the product can report a valid distance of a 17% target for 
  * the current ambient light conditions (__Dmax__ decreases when ambient light increases). __Dmax__ should be used only
  * when the product is not able to return a valid distance (no object or object is too far from the ranging sensor).
- * Typically, this is done by checking the __errorStatus__ field of the @a VL6180x_RangeData_t structure returned by 
- * the @a VL6180x_RangePollMeasurement() function.
+ * Typically, this is done by checking the __errorStatus__ field of the @a VL6180X_RangeData_t structure returned by 
+ * the @a VL6180X_RangePollMeasurement() function.
  * You may refer to ::RangeError_u to get full list of supported error codes.
  * @warning Dmax is estimated for a 17% grey target. If the real target has a reflectance lower than 17%, report Dmax could be over-estimated 
  */
-#define VL6180x_HAVE_DMAX_RANGING   1
+#define VL6180X_HAVE_DMAX_RANGING   1
 
 /**
- * @def VL6180x_WRAP_AROUND_FILTER_SUPPORT
+ * @def VL6180X_WRAP_AROUND_FILTER_SUPPORT
  * @brief Enable wrap around filter (WAF) feature
  *  
  * In specific conditions, when targeting a mirror or a very reflective metal, a __wrap around__ effect can occur internally to the
@@ -95,35 +95,35 @@
  * 
  * @li 0 : Filter is not supported, no filtering code is included in API
  * @li 1 : Filter is supported and active by default
- * @li -1 : Filter is supported but is not active by default @a VL6180x_FilterSetState() can turn it on and off at any time
+ * @li -1 : Filter is supported but is not active by default @a VL6180X_FilterSetState() can turn it on and off at any time
  */
-#define VL6180x_WRAP_AROUND_FILTER_SUPPORT   1
+#define VL6180X_WRAP_AROUND_FILTER_SUPPORT   1
 
 /**
- * @def VL6180x_EXTENDED_RANGE
+ * @def VL6180X_EXTENDED_RANGE
  * @brief Enable extended ranging support
  *
  * Device that do not formally support extended ranging should only be used with a scaling factor of 1.
  * Correct operation with scaling factor other than 1 (>200mm ) is not granted by ST.
  */
-//#define VL6180x_EXTENDED_RANGE 0
+//#define VL6180X_EXTENDED_RANGE 0
 
 #define EXTENDED_RANGE_50CM     0
 //#define EXTENDED_RANGE_50CM     1
 
 #if EXTENDED_RANGE_50CM
-#define VL6180x_UPSCALE_SUPPORT -3
-#define VL6180x_EXTENDED_RANGE  1
+#define VL6180X_UPSCALE_SUPPORT -3
+#define VL6180X_EXTENDED_RANGE  1
 #else
-#define VL6180x_UPSCALE_SUPPORT -1
-#define VL6180x_EXTENDED_RANGE  0
+#define VL6180X_UPSCALE_SUPPORT -1
+#define VL6180X_EXTENDED_RANGE  0
 #endif
 
-#if (VL6180x_EXTENDED_RANGE) && (VL6180x_ALS_SUPPORT)
+#if (VL6180X_EXTENDED_RANGE) && (VL6180X_ALS_SUPPORT)
 #warning "Als support should be OFF for extended range"
 #endif
 
 #endif
 /** @} */ // end of api_config
 
-/* VL6180x_CFG_H_ */
+/* VL6180X_CFG_H_ */