Official interfaces for ST components.

Dependents:   X_NUCLEO_IKS01A1 mDot_X_NUCLEO_IKS01A1 53L0A1 X_NUCLEO_IKS01A1 ... more

Fork of ST_INTERFACES by Davide Aliprandi

This library contains all abstract classes which together constitute the common API to which all existing and future ST components will adhere to.

Committer:
Davidroid
Date:
Fri Mar 24 12:59:21 2017 +0000
Revision:
5:d3c9b33b992c
Parent:
3:b1bb477e115e
Changed a returned type in BDCMotor interface.

Who changed what in which revision?

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