ConOpSys V2970  P004.07
ANVILEX control operating system
P005_06_V2_0_DIO.h
Go to the documentation of this file.
1 //------------------------------------------------------------------------------
2 //! @file P005_06_V2_0_DIO.h
3 //! @brief Digital I/O board P005.06 V2.0 hardware driver header file.
4 //! @attention No special attention requered.
5 //! @copyright (C) 2015-2020 ANVILEX LLC
6 //! $HeadURL: https://192.168.3.4:8443/svn/P004_07/ConOpSys/Hardware/P005_06_V2_0_DIO/P005_06_V2_0_DIO.h $
7 //! $Revision: 2931 $
8 //! $Date: 2022-02-13 10:39:30 +0500 (So, 13 Feb 2022) $
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 standard libraries header files
48 //------------------------------------------------------------------------------
49 
50 //------------------------------------------------------------------------------
51 // Include thrid party header files
52 //------------------------------------------------------------------------------
53 
54 //------------------------------------------------------------------------------
55 // Include ConOpSys header files
56 //------------------------------------------------------------------------------
57 
58 #include "Function_Block_Base.h"
59 
60 //------------------------------------------------------------------------------
61 // Include ConOpSys application header files
62 //------------------------------------------------------------------------------
63 
64 //------------------------------------------------------------------------------
65 // Macros
66 //------------------------------------------------------------------------------
67 
68 //! @brief Digital I/O P005.06 V2.0 board TP005_06_V2_0_DIO class
70 {
71 
72  //--------------------------------------------------------------------------
73  // Public methods and variables
74  //--------------------------------------------------------------------------
75 
76  public:
77 
78  //! @brief Register structure for digital I/O access
79  typedef struct
80  {
81 
82  // Digital inputs
87 
88  // Digital outputs
93 
95 
96  //--------------------------------------------------------------------------
97  // Public methods
98  //--------------------------------------------------------------------------
99 
100  // Constructor and destructor
101  TP005_06_V2_0_DIO(); //!< Constrructor method
102  ~TP005_06_V2_0_DIO(); //!< Destructor method
103 
104  VOID Map( TP005_06_V2_0_DIO_Registers *struct_Registers_Base_Address ); //!< Map method
105  virtual VOID Init(); //!< Block initialization method
106  virtual VOID Execute(); //!< Block execution method
109 
110  //--------------------------------------------------------------------------
111  // Public variables
112  //--------------------------------------------------------------------------
113 
114  // Input signals
115 
124 
125  // Output signals
126 
136 
139 
140  //--------------------------------------------------------------------------
141  // Protected mathods and variables
142  //--------------------------------------------------------------------------
143 
144  protected:
145 
146  //----------------------------------------------------------------------------
147  // Private mathods and variables
148  //--------------------------------------------------------------------------
149 
150  private:
151 
152  // Structure for bit parsing
153  typedef union
154  {
156  struct
157  {
166  U16 :1;
167  U16 :1;
168  U16 :1;
169  U16 :1;
170  U16 :1;
171  U16 :1;
172  U16 :1;
173  U16 :1;
174  };
175  } TChannels;
176 
178 
179 };
180 
181 //------------------------------------------------------------------------------
182 // End Of File
183 //------------------------------------------------------------------------------
void VOID
Datatypesess datatype definition.
Definition: Defines.h:105
unsigned short U16
Binary 16-Bit unsigned integer datatype defenition.
Definition: Defines.h:193
Function block base class header file.
Function block input connector class.
Definition: Block_Input_Connector.h:83
Function block output connector class.
Definition: Block_Output_Connector.h:59
Function block base class for device.
Definition: Function_Block_Base.h:96
Digital I/O P005.06 V2.0 board TP005_06_V2_0_DIO class.
Definition: P005_06_V2_0_DIO.h:70
VOID Execute_Outputs()
Write state of the digital outputs.
Definition: P005_06_V2_0_DIO.cpp:198
TBlock_Input_Connector object_bool_Digital_Output_5
Definition: P005_06_V2_0_DIO.h:131
TBlock_Input_Connector object_bool_Digital_Output_9
Definition: P005_06_V2_0_DIO.h:135
TBlock_Input_Connector object_bool_Digital_Output_2
Definition: P005_06_V2_0_DIO.h:128
TP005_06_V2_0_DIO()
Constrructor method.
Definition: P005_06_V2_0_DIO.cpp:68
volatile TP005_06_V2_0_DIO_Registers * struct_Registers
Definition: P005_06_V2_0_DIO.h:177
TBlock_Output_Connector object_bool_Digital_Input_4
Definition: P005_06_V2_0_DIO.h:119
TBlock_Input_Connector object_bool_Digital_Output_3
Definition: P005_06_V2_0_DIO.h:129
TBlock_Output_Connector object_bool_Digital_Input_6
Definition: P005_06_V2_0_DIO.h:121
virtual VOID Execute()
Block execution method.
Definition: P005_06_V2_0_DIO.cpp:151
TBlock_Output_Connector object_u16_Digital_Outputs_Status
Definition: P005_06_V2_0_DIO.h:138
VOID Map(TP005_06_V2_0_DIO_Registers *struct_Registers_Base_Address)
Map method.
Definition: P005_06_V2_0_DIO.cpp:123
TBlock_Input_Connector object_bool_Digital_Output_6
Definition: P005_06_V2_0_DIO.h:132
TBlock_Output_Connector object_bool_Digital_Input_5
Definition: P005_06_V2_0_DIO.h:120
TBlock_Output_Connector object_bool_Digital_Input_8
Definition: P005_06_V2_0_DIO.h:123
TBlock_Output_Connector object_bool_Digital_Input_1
Definition: P005_06_V2_0_DIO.h:116
TBlock_Output_Connector object_u16_Digital_Inputs_Status
Definition: P005_06_V2_0_DIO.h:137
TBlock_Input_Connector object_bool_Digital_Output_4
Definition: P005_06_V2_0_DIO.h:130
VOID Execute_Inputs()
Read state of the digital inputs.
Definition: P005_06_V2_0_DIO.cpp:168
TBlock_Input_Connector object_bool_Digital_Output_7
Definition: P005_06_V2_0_DIO.h:133
~TP005_06_V2_0_DIO()
Destructor method.
Definition: P005_06_V2_0_DIO.cpp:112
TBlock_Output_Connector object_bool_Digital_Input_2
Definition: P005_06_V2_0_DIO.h:117
TBlock_Output_Connector object_bool_Digital_Input_3
Definition: P005_06_V2_0_DIO.h:118
TBlock_Input_Connector object_bool_Digital_Output_1
Definition: P005_06_V2_0_DIO.h:127
virtual VOID Init()
Block initialization method.
Definition: P005_06_V2_0_DIO.cpp:137
TBlock_Output_Connector object_bool_Digital_Input_7
Definition: P005_06_V2_0_DIO.h:122
TBlock_Input_Connector object_bool_Digital_Output_8
Definition: P005_06_V2_0_DIO.h:134
Register structure for digital I/O access.
Definition: P005_06_V2_0_DIO.h:80
U16 u16_Digital_Outputs_Reserve_1
Definition: P005_06_V2_0_DIO.h:90
U16 u16_Digital_Inputs_Reserve_2
Definition: P005_06_V2_0_DIO.h:85
U16 u16_Digital_Outputs
Definition: P005_06_V2_0_DIO.h:89
U16 u16_Digital_Inputs_Reserve_1
Definition: P005_06_V2_0_DIO.h:84
U16 u16_Digital_Outputs_Reserve_2
Definition: P005_06_V2_0_DIO.h:91
U16 u16_Digital_Inputs
Definition: P005_06_V2_0_DIO.h:83
U16 u16_Digital_Outputs_Reserve_3
Definition: P005_06_V2_0_DIO.h:92
U16 u16_Digital_Inputs_Reserve_3
Definition: P005_06_V2_0_DIO.h:86
U16 bool_Channel_5
Definition: P005_06_V2_0_DIO.h:162
U16 bool_Channel_1
Definition: P005_06_V2_0_DIO.h:158
U16 bool_Channel_4
Definition: P005_06_V2_0_DIO.h:161
U16 bool_Channel_8
Definition: P005_06_V2_0_DIO.h:165
U16 u16_Channels
Definition: P005_06_V2_0_DIO.h:155
U16 bool_Channel_2
Definition: P005_06_V2_0_DIO.h:159
U16 bool_Channel_6
Definition: P005_06_V2_0_DIO.h:163
U16 bool_Channel_3
Definition: P005_06_V2_0_DIO.h:160
U16 bool_Channel_7
Definition: P005_06_V2_0_DIO.h:164