ConOpSys V2970  P004.07
ANVILEX control operating system
Digital_IO_Base.h
Go to the documentation of this file.
1 //------------------------------------------------------------------------------
2 //! @file Digital_IO_Base.h
3 //! @brief Digital I/O base class header file.
4 //! @attention No special attention requered.
5 //! @copyright (C) 2015-2021 ANVILEX LLC
6 //! $HeadURL: https://192.168.3.4:8443/svn/P004_07/ConOpSys/Engine/SPI_Master_Base.h $
7 //! $Revision: 2339 $
8 //! $Date: 2021-01-08 14:06:54 +0500 (Fr, 08 Jan 2021) $
9 //! $Author: minch $
10 //------------------------------------------------------------------------------
11 //
12 // Redistribution and use in source and binary forms, with or without
13 // modification, are permitted provided that the following conditions are met:
14 //
15 // 1. Redistributions of source code must retain the above copyright notice,
16 // this list of conditions and the following disclaimer.
17 //
18 // 2. Redistributions in binary form must reproduce the above copyright notice,
19 // this list of conditions and the following disclaimer in the documentation
20 // and/or other materials provided with the distribution.
21 //
22 // 3. Neither the name of ANVILEX nor the names of its contributors may be
23 // used to endorse or promote products derived from this software without
24 // specific prior written permission.
25 //
26 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
27 // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
28 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
29 // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
30 // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
31 // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
32 // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
33 // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
34 // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
35 // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
36 // POSSIBILITY OF SUCH DAMAGE.
37 //
38 //------------------------------------------------------------------------------
39 
40 //------------------------------------------------------------------------------
41 // Protecting header files from mutual, recursive inclusion.
42 //------------------------------------------------------------------------------
43 
44 #pragma once
45 
46 //------------------------------------------------------------------------------
47 // Include project files
48 //------------------------------------------------------------------------------
49 
50 #include "Defines.h"
51 
52 //------------------------------------------------------------------------------
53 // Class definitions
54 //------------------------------------------------------------------------------
55 
56 //! @brief Digital I/O base class
58 {
59 
60  //----------------------------------------------------------------------------
61  // Public defines, methods and variables
62  //----------------------------------------------------------------------------
63 
64  public:
65 
66  //--------------------------------------------------------------------------
67  // Public methods
68  //--------------------------------------------------------------------------
69 
70  //!-------------------------------------------------------------------------
71  //! @brief Class constructor method
72  //! @note None
73  //! \par Override
74  //! Not allowed
75  //! @attention Don't call this method directly.
76  //--------------------------------------------------------------------------
77 
79 
80  //!-------------------------------------------------------------------------
81  //! @brief Class destructor method
82  //! @note None
83  //! \par Override
84  //! Not allowed
85  //! @attention Don't call this method directly.
86  //--------------------------------------------------------------------------
87 
88  virtual ~TDigital_IO_Base();
89 
90  //!-------------------------------------------------------------------------
91  //! @brief Digital I/O initialisation method
92  //! @note None
93  //! @return None
94  //! \par Override
95  //! Requered
96  //! @attention None
97  //--------------------------------------------------------------------------
98 
99  virtual VOID Init() = 0;
100 
101  //!-------------------------------------------------------------------------
102  //! @brief Digital I/O finalisation method
103  //! @note Override method must initialise hardware dependent SPI bus unit and related GPIO.
104  //! @return None
105  //! \par Override
106  //! Requered
107  //! @attention None
108  //--------------------------------------------------------------------------
109 
110  virtual VOID Done() = 0;
111 
112  //!-------------------------------------------------------------------------
113  //! @brief PIO initialisation method
114  //! @note None
115  //! @return None
116  //! \par Override
117  //! Not allowed
118  //! @attention None
119  //--------------------------------------------------------------------------
120 
121  virtual VOID PIO_Init() = 0;
122 
123  //!-------------------------------------------------------------------------
124  //! @brief PIO reinitialisation as GPIO method
125  //! @note None
126  //! @return None
127  //! \par Override
128  //! Not allowed
129  //! @attention None
130  //--------------------------------------------------------------------------
131 
132  virtual VOID PIO_Done() = 0;
133 
134  //!-------------------------------------------------------------------------
135  //! @brief Get digital output state
136  //! @note None
137  //! @param [in] u8_Index - Index of digital input
138  //! @param [in] bool_State - Digital output state
139  //! @return BOOL - Operation status
140  //! @retval false - Operation failed, output not found
141  //! @retval true - Operation successed
142  //! \par Override
143  //! Requered
144  //! @attention None
145  //--------------------------------------------------------------------------
146 
147  virtual BOOL Set_Output( U8 u8_Index, BOOL bool_State ) = 0;
148 
149  //!-------------------------------------------------------------------------
150  //! @brief Get digital input state
151  //! @note None
152  //! @param [in] u8_Index - Index of digital input
153  //! @param [out] bool_State - Digital input state
154  //! @return BOOL - Operation status
155  //! @retval false - Operation failed, input not found
156  //! @retval true - Operation successed
157  //! \par Override
158  //! Requered
159  //! @attention None
160  //--------------------------------------------------------------------------
161 
162  virtual BOOL Get_Input( U8 u8_Index, BOOL *bool_State ) = 0;
163 
164  //----------------------------------------------------------------------------
165  // Protected defines, methods and variables
166  //----------------------------------------------------------------------------
167 
168  protected:
169 
170  //----------------------------------------------------------------------------
171  // Private defines, methods and variables
172  //----------------------------------------------------------------------------
173 
174  private:
175 
176 };
177 
178 //------------------------------------------------------------------------------
179 // End of file
180 //------------------------------------------------------------------------------
ConOpSys data type definitions header file.
int BOOL
Boolean datatype definition.
Definition: Defines.h:124
unsigned char U8
Binary 8-Bit unsigned integer datatype defenition.
Definition: Defines.h:183
void VOID
Datatypesess datatype definition.
Definition: Defines.h:105
Digital I/O base class.
Definition: Digital_IO_Base.h:58
virtual ~TDigital_IO_Base()
Class destructor method.
Definition: Digital_IO_Base.cpp:64
virtual VOID Init()=0
Digital I/O initialisation method.
virtual BOOL Set_Output(U8 u8_Index, BOOL bool_State)=0
Get digital output state.
virtual BOOL Get_Input(U8 u8_Index, BOOL *bool_State)=0
Get digital input state.
virtual VOID Done()=0
Digital I/O finalisation method.
virtual VOID PIO_Init()=0
PIO initialisation method.
TDigital_IO_Base()
Class constructor method.
Definition: Digital_IO_Base.cpp:56
virtual VOID PIO_Done()=0
PIO reinitialisation as GPIO method.