INSAT Mini Project
Dependencies: ST_INTERFACES X_NUCLEO_COMMON
Fork of X_NUCLEO_6180XA1 by
Components/Interfaces/Component_class.h@47:2fc173b227d4, 2016-05-23 (annotated)
- 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?
User | Revision | Line number | New 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>© 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****/ |