Álvaro de Rada / X_NUCLEO_PLC01A1
Committer:
Davidroid
Date:
Tue Feb 23 10:40:17 2016 +0000
Revision:
2:1ec0dea195f8
Re-design to keep coherence with other expansion boards.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Davidroid 2:1ec0dea195f8 1 /**
Davidroid 2:1ec0dea195f8 2 ******************************************************************************
Davidroid 2:1ec0dea195f8 3 * @file component.h
Davidroid 2:1ec0dea195f8 4 * @author AST
Davidroid 2:1ec0dea195f8 5 * @version V1.0.0
Davidroid 2:1ec0dea195f8 6 * @date 1 April 2015
Davidroid 2:1ec0dea195f8 7 * @brief Generic header file containing a generic component's definitions
Davidroid 2:1ec0dea195f8 8 * and I/O functions.
Davidroid 2:1ec0dea195f8 9 ******************************************************************************
Davidroid 2:1ec0dea195f8 10 * @attention
Davidroid 2:1ec0dea195f8 11 *
Davidroid 2:1ec0dea195f8 12 * <h2><center>&copy; COPYRIGHT(c) 2015 STMicroelectronics</center></h2>
Davidroid 2:1ec0dea195f8 13 *
Davidroid 2:1ec0dea195f8 14 * Redistribution and use in source and binary forms, with or without modification,
Davidroid 2:1ec0dea195f8 15 * are permitted provided that the following conditions are met:
Davidroid 2:1ec0dea195f8 16 * 1. Redistributions of source code must retain the above copyright notice,
Davidroid 2:1ec0dea195f8 17 * this list of conditions and the following disclaimer.
Davidroid 2:1ec0dea195f8 18 * 2. Redistributions in binary form must reproduce the above copyright notice,
Davidroid 2:1ec0dea195f8 19 * this list of conditions and the following disclaimer in the documentation
Davidroid 2:1ec0dea195f8 20 * and/or other materials provided with the distribution.
Davidroid 2:1ec0dea195f8 21 * 3. Neither the name of STMicroelectronics nor the names of its contributors
Davidroid 2:1ec0dea195f8 22 * may be used to endorse or promote products derived from this software
Davidroid 2:1ec0dea195f8 23 * without specific prior written permission.
Davidroid 2:1ec0dea195f8 24 *
Davidroid 2:1ec0dea195f8 25 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
Davidroid 2:1ec0dea195f8 26 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
Davidroid 2:1ec0dea195f8 27 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
Davidroid 2:1ec0dea195f8 28 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
Davidroid 2:1ec0dea195f8 29 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
Davidroid 2:1ec0dea195f8 30 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
Davidroid 2:1ec0dea195f8 31 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
Davidroid 2:1ec0dea195f8 32 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
Davidroid 2:1ec0dea195f8 33 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
Davidroid 2:1ec0dea195f8 34 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Davidroid 2:1ec0dea195f8 35 *
Davidroid 2:1ec0dea195f8 36 ******************************************************************************
Davidroid 2:1ec0dea195f8 37 */
Davidroid 2:1ec0dea195f8 38
Davidroid 2:1ec0dea195f8 39
Davidroid 2:1ec0dea195f8 40 /* Define to prevent recursive inclusion -------------------------------------*/
Davidroid 2:1ec0dea195f8 41
Davidroid 2:1ec0dea195f8 42 #ifndef __COMPONENT_H
Davidroid 2:1ec0dea195f8 43 #define __COMPONENT_H
Davidroid 2:1ec0dea195f8 44
Davidroid 2:1ec0dea195f8 45
Davidroid 2:1ec0dea195f8 46 /* Types ---------------------------------------------------------------------*/
Davidroid 2:1ec0dea195f8 47
Davidroid 2:1ec0dea195f8 48 /**
Davidroid 2:1ec0dea195f8 49 * @brief Component's Context structure definition.
Davidroid 2:1ec0dea195f8 50 */
Davidroid 2:1ec0dea195f8 51 typedef struct
Davidroid 2:1ec0dea195f8 52 {
Davidroid 2:1ec0dea195f8 53 /* Identity. */
Davidroid 2:1ec0dea195f8 54 uint8_t who_am_i;
Davidroid 2:1ec0dea195f8 55
Davidroid 2:1ec0dea195f8 56 /* ACTION ----------------------------------------------------------------*/
Davidroid 2:1ec0dea195f8 57 /* There should be only a unique identifier for each component, which */
Davidroid 2:1ec0dea195f8 58 /* should be the "who_am_i" parameter, hence this parameter is optional. */
Davidroid 2:1ec0dea195f8 59 /* -----------------------------------------------------------------------*/
Davidroid 2:1ec0dea195f8 60 /* Type. */
Davidroid 2:1ec0dea195f8 61 uint8_t type;
Davidroid 2:1ec0dea195f8 62
Davidroid 2:1ec0dea195f8 63 /* Configuration. */
Davidroid 2:1ec0dea195f8 64 uint8_t address;
Davidroid 2:1ec0dea195f8 65
Davidroid 2:1ec0dea195f8 66 /* Pointer to the Data. */
Davidroid 2:1ec0dea195f8 67 void *pData;
Davidroid 2:1ec0dea195f8 68
Davidroid 2:1ec0dea195f8 69 /* Pointer to the Virtual Table. */
Davidroid 2:1ec0dea195f8 70 void *pVTable;
Davidroid 2:1ec0dea195f8 71
Davidroid 2:1ec0dea195f8 72 /* ACTION ----------------------------------------------------------------*/
Davidroid 2:1ec0dea195f8 73 /* There should be only a unique virtual table for each component, which */
Davidroid 2:1ec0dea195f8 74 /* should be the "pVTable" parameter, hence this parameter is optional. */
Davidroid 2:1ec0dea195f8 75 /* -----------------------------------------------------------------------*/
Davidroid 2:1ec0dea195f8 76 /* Pointer to the Extended Virtual Table. */
Davidroid 2:1ec0dea195f8 77 void *pExtVTable;
Davidroid 2:1ec0dea195f8 78 } DrvContextTypeDef;;
Davidroid 2:1ec0dea195f8 79
Davidroid 2:1ec0dea195f8 80 /**
Davidroid 2:1ec0dea195f8 81 * @brief Component's Status enumerator definition.
Davidroid 2:1ec0dea195f8 82 */
Davidroid 2:1ec0dea195f8 83 typedef enum
Davidroid 2:1ec0dea195f8 84 {
Davidroid 2:1ec0dea195f8 85 COMPONENT_OK = 0,
Davidroid 2:1ec0dea195f8 86 COMPONENT_ERROR,
Davidroid 2:1ec0dea195f8 87 COMPONENT_TIMEOUT,
Davidroid 2:1ec0dea195f8 88 COMPONENT_NOT_IMPLEMENTED
Davidroid 2:1ec0dea195f8 89 } DrvStatusTypeDef;
Davidroid 2:1ec0dea195f8 90
Davidroid 2:1ec0dea195f8 91 #endif /* __COMPONENT_H */
Davidroid 2:1ec0dea195f8 92
Davidroid 2:1ec0dea195f8 93 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/