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

Files at this revision

API Documentation at this revision

Comitter:
mapellil
Date:
Mon Nov 09 09:38:34 2015 +0000
Parent:
29:6d6b67e2e212
Child:
31:f99c53a51917
Commit message:
fixed some doxygen comments

Changed in this revision

Components/VL6180X/vl6180x_class.h Show annotated file Show diff for this revision Revisions of this file
--- a/Components/VL6180X/vl6180x_class.h	Fri Nov 06 08:39:27 2015 +0100
+++ b/Components/VL6180X/vl6180x_class.h	Mon Nov 09 09:38:34 2015 +0000
@@ -3,7 +3,7 @@
  * @file    vl6180x_class.h
  * @author  AST / EST
  * @version V0.0.1
- * @date    14-April-2015
+ * @date    9-November-2015
  * @brief   Header file for component VL6180X
  ******************************************************************************
  * @attention
@@ -96,11 +96,11 @@
 class VL6180X : public RangeSensor, public LightSensor 
 {
  public:
-    /** Constructor
-     * @param[in] i2c device I2C to be used for communication
-     * @param[in] digital out pin/STMPE1600DigiOut pin to be used for GPIO expander communication
-     * @param[in] gpio1 pin
-     * @param[in] device address, 0x29 by default  
+    /** Constructor 1
+     * @param[in] &i2c device I2C to be used for communication
+     * @param[in] &pin Mbed DigitalOut pin to be used as component GPIO_0 CE
+     * @param[in] pin_gpio1 pin Mbed InterruptIn PinName to be used as component GPIO_1 INT
+     * @param[in] DevAddr device address, 0x29 by default  
      */
     VL6180X(DevI2C &i2c, DigitalOut &pin, PinName pin_gpio1, uint8_t DevAddr=DEFAULT_DEVICE_ADDRESS) : RangeSensor(), LightSensor(), dev_i2c(i2c), gpio0(&pin), interrupt_measure(pin_gpio1)
     {
@@ -110,7 +110,12 @@
        Device=&MyDevice;;
        expgpio0=NULL;
     }  
-		
+    /** Constructor 2
+     * @param[in] i2c device I2C to be used for communication
+     * @param[in] &pin Gpio Expander STMPE1600DigiOut pin to be used as component GPIO_0 CE
+     * @param[in] pin_gpio1 pin Mbed InterruptIn PinName to be used as component GPIO_1 INT
+     * @param[in] device address, 0x29 by default  
+     */		
     VL6180X(DevI2C &i2c, STMPE1600DigiOut &pin, PinName pin_gpio1, uint8_t DevAddr=DEFAULT_DEVICE_ADDRESS) : RangeSensor(), LightSensor(), dev_i2c(i2c), expgpio0(&pin), interrupt_measure(pin_gpio1)
     {
        MyDevice.I2cAddr=DevAddr;		 
@@ -122,7 +127,7 @@
     
    /** Destructor
     */
-    //virtual ~VL6180X(){} 
+    virtual ~VL6180X(){} 
     /* warning: VL6180X class inherits from GenericSensor, RangeSensor and LightSensor, that haven`t a destructor.
        The warning should request to introduce a virtual destructor to make sure to delete the object */