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