mbed library for STMicroelectronics' X-NUCLEO-IKA01A1 expansion board.

Dependents:   HelloWorld_IKA01A1

Fork of X_NUCLEO_IKA01A1 by ST Expansion SW Team

Library for STMicroelectronics' X-NUCLEO-IKA01A1 multifunctional expansion board based on operational amplifiers.

Committer:
Davidroid
Date:
Thu Jul 13 15:46:02 2017 +0000
Revision:
23:807f66b435d6
Parent:
22:ff8d071bf79e
Adapting to ARM mbed coding style.

Who changed what in which revision?

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