Rpi-hw  0.7.2
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Pages
decoder-in.hpp
1 /*
2  Title --- iface/decoder-in.hpp
3 
4  Copyright (C) 2013 Giacomo Trudu - wicker25[at]gmail[dot]com
5 
6  This file is part of Rpi-hw.
7 
8  Rpi-hw is free software: you can redistribute it and/or modify
9  it under the terms of the GNU Lesser General Public License as published by
10  the Free Software Foundation version 3 of the License.
11 
12  Rpi-hw is distributed in the hope that it will be useful,
13  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  GNU Lesser General Public License for more details.
16 
17  You should have received a copy of the GNU Lesser General Public License
18  along with Rpi-hw. If not, see <http://www.gnu.org/licenses/>.
19 */
20 
21 
22 #ifndef _RPI_HW_IFACE_DECODER_IN_HPP_
23 #define _RPI_HW_IFACE_DECODER_IN_HPP_
24 
25 #include <initializer_list>
26 #include <vector>
27 
28 #include <rpi-hw/types.hpp>
29 #include <rpi-hw/exception.hpp>
30 #include <rpi-hw/math.hpp>
31 #include <rpi-hw/utils.hpp>
32 
33 #include <rpi-hw/iface/base.hpp>
34 #include <rpi-hw/iface/input.hpp>
35 
36 namespace rpihw { // Begin main namespace
37 
38 namespace iface { // Begin interfaces namespace
39 
40 /*!
41  @class decoderIn
42  @brief Decoder input interface.
43 */
44 class decoderIn : public iface::input {
45 
46 public:
47 
48  /*!
49  @brief Constructor method.
50  @param[in] pins Sequence of `uint8_t` containing the GPIO pins.
51  */
52  decoderIn( std::initializer_list< uint8_t > pins );
53 
54  /*!
55  @brief Constructor method.
56  @param[in] pins Vector containing the GPIO pins.
57  */
58  decoderIn( const std::vector< uint8_t > &pins );
59 
60  //! Destructor method.
61  virtual ~decoderIn();
62 
63  /*!
64  @brief Reads from the interface.
65  @return The data read from the interface.
66  */
67  virtual size_t read() const;
68 };
69 
70 } // End of interfaces namespace
71 
72 } // End of main namespace
73 
74 
75 // Include inline methods
76 #include <rpi-hw/iface/decoder-in-inl.hpp>
77 
78 #endif /* _RPI_HW_IFACE_DECODER_IN_HPP_ */
virtual ~decoderIn()
Destructor method.
Decoder input interface.
Definition: decoder-in.hpp:44
Input interface.
Definition: input.hpp:43
decoderIn(std::initializer_list< uint8_t > pins)
Constructor method.
virtual size_t read() const
Reads from the interface.