ST Expansion SW Team / Vl6180

Dependencies:   VL6180_Board

Dependents:   X_NUCLEO_6180

Committer:
charlesmn
Date:
Tue Nov 10 16:09:01 2020 +0000
Revision:
3:b01812cb5250
Used the correct version of RangeSensor.h which allows the program to build.

Who changed what in which revision?

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