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:
Mon May 23 09:59:39 2016 +0000
Revision:
47:2fc173b227d4
Aligned Component/Interface/Component_class.h to automatic conversion script output generating Component class instead of GenericSensor class.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
mapellil 47:2fc173b227d4 1 /**
mapellil 47:2fc173b227d4 2 ******************************************************************************
mapellil 47:2fc173b227d4 3 * @file Component_class.h
mapellil 47:2fc173b227d4 4 * @author Davide Aliprandi, STMicrolectronics
mapellil 47:2fc173b227d4 5 * @version V1.0.0
mapellil 47:2fc173b227d4 6 * @date April 13th, 2015
mapellil 47:2fc173b227d4 7 * @brief This file contains the abstract class describing the interface of a
mapellil 47:2fc173b227d4 8 * generic component.
mapellil 47:2fc173b227d4 9 ******************************************************************************
mapellil 47:2fc173b227d4 10 * @attention
mapellil 47:2fc173b227d4 11 *
mapellil 47:2fc173b227d4 12 * <h2><center>&copy; COPYRIGHT(c) 2015 STMicroelectronics</center></h2>
mapellil 47:2fc173b227d4 13 *
mapellil 47:2fc173b227d4 14 * Redistribution and use in source and binary forms, with or without modification,
mapellil 47:2fc173b227d4 15 * are permitted provided that the following conditions are met:
mapellil 47:2fc173b227d4 16 * 1. Redistributions of source code must retain the above copyright notice,
mapellil 47:2fc173b227d4 17 * this list of conditions and the following disclaimer.
mapellil 47:2fc173b227d4 18 * 2. Redistributions in binary form must reproduce the above copyright notice,
mapellil 47:2fc173b227d4 19 * this list of conditions and the following disclaimer in the documentation
mapellil 47:2fc173b227d4 20 * and/or other materials provided with the distribution.
mapellil 47:2fc173b227d4 21 * 3. Neither the name of STMicroelectronics nor the names of its contributors
mapellil 47:2fc173b227d4 22 * may be used to endorse or promote products derived from this software
mapellil 47:2fc173b227d4 23 * without specific prior written permission.
mapellil 47:2fc173b227d4 24 *
mapellil 47:2fc173b227d4 25 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
mapellil 47:2fc173b227d4 26 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
mapellil 47:2fc173b227d4 27 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
mapellil 47:2fc173b227d4 28 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
mapellil 47:2fc173b227d4 29 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
mapellil 47:2fc173b227d4 30 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
mapellil 47:2fc173b227d4 31 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
mapellil 47:2fc173b227d4 32 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
mapellil 47:2fc173b227d4 33 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
mapellil 47:2fc173b227d4 34 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
mapellil 47:2fc173b227d4 35 *
mapellil 47:2fc173b227d4 36 ******************************************************************************
mapellil 47:2fc173b227d4 37 */
mapellil 47:2fc173b227d4 38
mapellil 47:2fc173b227d4 39
mapellil 47:2fc173b227d4 40 /* Define to prevent from recursive inclusion --------------------------------*/
mapellil 47:2fc173b227d4 41
mapellil 47:2fc173b227d4 42 #ifndef __COMPONENT_CLASS_H
mapellil 47:2fc173b227d4 43 #define __COMPONENT_CLASS_H
mapellil 47:2fc173b227d4 44
mapellil 47:2fc173b227d4 45
mapellil 47:2fc173b227d4 46 /* Includes ------------------------------------------------------------------*/
mapellil 47:2fc173b227d4 47
mapellil 47:2fc173b227d4 48 #include <stdint.h>
mapellil 47:2fc173b227d4 49
mapellil 47:2fc173b227d4 50
mapellil 47:2fc173b227d4 51 /* Classes ------------------------------------------------------------------*/
mapellil 47:2fc173b227d4 52
mapellil 47:2fc173b227d4 53 /** An abstract class for Generic components.
mapellil 47:2fc173b227d4 54 */
mapellil 47:2fc173b227d4 55 class Component
mapellil 47:2fc173b227d4 56 {
mapellil 47:2fc173b227d4 57 public:
mapellil 47:2fc173b227d4 58 /**
mapellil 47:2fc173b227d4 59 * @brief Initializing the component.
mapellil 47:2fc173b227d4 60 * @param init Pointer to device specific initalization structure.
mapellil 47:2fc173b227d4 61 * @retval "0" in case of success, an error code otherwise.
mapellil 47:2fc173b227d4 62 */
mapellil 47:2fc173b227d4 63 virtual int Init(void *init) = 0;
mapellil 47:2fc173b227d4 64
mapellil 47:2fc173b227d4 65 /**
mapellil 47:2fc173b227d4 66 * @brief Getting the ID of the component.
mapellil 47:2fc173b227d4 67 * @param id Pointer to an allocated variable to store the ID into.
mapellil 47:2fc173b227d4 68 * @retval "0" in case of success, an error code otherwise.
mapellil 47:2fc173b227d4 69 */
mapellil 47:2fc173b227d4 70 virtual int ReadID(uint8_t *id) = 0;
mapellil 47:2fc173b227d4 71 };
mapellil 47:2fc173b227d4 72
mapellil 47:2fc173b227d4 73 #endif /* __COMPONENT_CLASS_H */
mapellil 47:2fc173b227d4 74
mapellil 47:2fc173b227d4 75 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/