Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: ST_INTERFACES X_NUCLEO_COMMON
Fork of X_NUCLEO_6180XA1 by
Components/VL6180X/vl6180x_class.h
- Committer:
- gallonm
- Date:
- 2015-09-11
- Revision:
- 3:454541a079f4
- Parent:
- 1:1de1ea2994d9
- Child:
- 4:a5abf7757947
File content as of revision 3:454541a079f4:
/**
******************************************************************************
* @file vl6180x_class.h
* @author AST / EST
* @version V0.0.1
* @date 14-April-2015
* @brief Header file for component VL6180X
******************************************************************************
* @attention
*
* <h2><center>© COPYRIGHT(c) 2015 STMicroelectronics</center></h2>
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* 3. Neither the name of STMicroelectronics nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
******************************************************************************
*/
#ifndef __VL6180X_CLASS_H
#define __VL6180X_CLASS_H
/* Includes ------------------------------------------------------------------*/
#include "RangeSensor.h"
#include "LightSensor.h"
#include "vl6180x_api.h"
#include "vl6180x_cfg.h"
#include "vl6180x_def.h"
#include "vl6180x_i2c.h"
#include "vl6180x_types.h"
#include "vl6180x_platform.h"
#include "vl6180x_appcfg.h"
/* Classes -------------------------------------------------------------------*/
/** Class representing a VL6180X sensor component
*/
class VL6180X : public RangeSensor, public LightSensor {
public:
/** Constructor
* @param[in] i2c device I2C to be used for communication
*/
VL6180X(DevI2C &i2c) : RangeSensor(), LightSensor(), dev_i2c(i2c) {}
/** Destructor
*/
virtual ~VL6180X() {}
/*** Interface Methods ***/
virtual int Init(void *init_struct) {
return VL6180x_InitData(VL6180xDev_t dev);
}
virtual int ReadID(uint8_t *rl_id) {
return VL6180X_ReadID(rl_id);
}
/*
virtual int GetRange(int *piData) {
return VL6180X_GetRange(piData);
}
virtual int GetLight(int *piData) {
return VL6180X_GetLight(piData);
}
*/
private:
/*** Methods ***/
int VL6180X_IO_Read(uint8_t *pBuffer, uint8_t RegisterAddress, uint16 NumByteToRead);
/*** Instance Variables ***/
/* IO Device */
DevI2C &dev_i2c;
};
#endif // __VL6180X_CLASS_H
