ST / X_NUCLEO_6180XA1

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

Committer:
mapellil
Date:
Fri Sep 09 09:50:12 2016 +0000
Revision:
50:18e064bfb156
Parent:
Components/Interfaces/RangeSensor.h@47:2fc173b227d4
Added the GetDistance and GetLux API doing  respectively a synchronous  range_single_shot_polling and als_single_shot_polling measure in blocking mode

Who changed what in which revision?

UserRevisionLine numberNew contents of line
gallonm 1:1de1ea2994d9 1 /**
gallonm 1:1de1ea2994d9 2 ******************************************************************************
mapellil 50:18e064bfb156 3 * @file DistanceSensor.h
gallonm 1:1de1ea2994d9 4 * @author AST / EST
gallonm 1:1de1ea2994d9 5 * @version V0.0.1
mapellil 50:18e064bfb156 6 * @date 08-September-2016
gallonm 1:1de1ea2994d9 7 * @brief This file contains the abstract class describing in general
mapellil 50:18e064bfb156 8 * the interfaces of a distance sensor
gallonm 1:1de1ea2994d9 9 ******************************************************************************
gallonm 1:1de1ea2994d9 10 * @attention
gallonm 1:1de1ea2994d9 11 *
gallonm 1:1de1ea2994d9 12 * <h2><center>&copy; COPYRIGHT(c) 2015 STMicroelectronics</center></h2>
gallonm 1:1de1ea2994d9 13 *
gallonm 1:1de1ea2994d9 14 * Redistribution and use in source and binary forms, with or without modification,
gallonm 1:1de1ea2994d9 15 * are permitted provided that the following conditions are met:
gallonm 1:1de1ea2994d9 16 * 1. Redistributions of source code must retain the above copyright notice,
gallonm 1:1de1ea2994d9 17 * this list of conditions and the following disclaimer.
gallonm 1:1de1ea2994d9 18 * 2. Redistributions in binary form must reproduce the above copyright notice,
gallonm 1:1de1ea2994d9 19 * this list of conditions and the following disclaimer in the documentation
gallonm 1:1de1ea2994d9 20 * and/or other materials provided with the distribution.
gallonm 1:1de1ea2994d9 21 * 3. Neither the name of STMicroelectronics nor the names of its contributors
gallonm 1:1de1ea2994d9 22 * may be used to endorse or promote products derived from this software
gallonm 1:1de1ea2994d9 23 * without specific prior written permission.
gallonm 1:1de1ea2994d9 24 *
gallonm 1:1de1ea2994d9 25 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
gallonm 1:1de1ea2994d9 26 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
gallonm 1:1de1ea2994d9 27 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
gallonm 1:1de1ea2994d9 28 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
gallonm 1:1de1ea2994d9 29 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
gallonm 1:1de1ea2994d9 30 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
gallonm 1:1de1ea2994d9 31 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
gallonm 1:1de1ea2994d9 32 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
gallonm 1:1de1ea2994d9 33 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
gallonm 1:1de1ea2994d9 34 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
gallonm 1:1de1ea2994d9 35 *
gallonm 1:1de1ea2994d9 36 ******************************************************************************
gallonm 1:1de1ea2994d9 37 */
gallonm 1:1de1ea2994d9 38
gallonm 1:1de1ea2994d9 39 /* Define to prevent from recursive inclusion --------------------------------*/
mapellil 50:18e064bfb156 40 #ifndef __DISTANCE_SENSOR_CLASS_H
mapellil 50:18e064bfb156 41 #define __DISTANCE_SENSOR_CLASS_H
gallonm 1:1de1ea2994d9 42
gallonm 1:1de1ea2994d9 43 /* Includes ------------------------------------------------------------------*/
mapellil 50:18e064bfb156 44 #include "ComponentObject.h"
gallonm 1:1de1ea2994d9 45
gallonm 1:1de1ea2994d9 46 /* Classes ------------------------------------------------------------------*/
mapellil 50:18e064bfb156 47 /** An abstract class for distance sensors
gallonm 1:1de1ea2994d9 48 */
mapellil 50:18e064bfb156 49 class DistanceSensor : public ComponentObject
gallonm 1:1de1ea2994d9 50 {
gallonm 1:1de1ea2994d9 51 public:
gallonm 1:1de1ea2994d9 52 /**
mapellil 50:18e064bfb156 53 * @brief Get current distance [mm]
mapellil 50:18e064bfb156 54 * @param[out] piData Pointer to where to store distance to
gallonm 1:1de1ea2994d9 55 * @return 0 in case of success, an error code otherwise
gallonm 1:1de1ea2994d9 56 */
mapellil 50:18e064bfb156 57 virtual int GetDistance(uint32_t *piData) = 0;
gallonm 1:1de1ea2994d9 58 };
gallonm 1:1de1ea2994d9 59
mapellil 50:18e064bfb156 60 #endif /* __DISTANCE_SENSOR_CLASS_H */