INSAT Mini Project

Dependencies:   ST_INTERFACES X_NUCLEO_COMMON

Fork of X_NUCLEO_6180XA1 by ST

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