Rpi-hw  0.7.2
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Pages
shift-base-inl.hpp
1 /*
2  Title --- iface/shift-base-inl.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_SHIFT_BASE_INL_HPP_
23 #define _RPI_HW_IFACE_SHIFT_BASE_INL_HPP_
24 
25 namespace rpihw { // Begin main namespace
26 
27 namespace iface { // Begin interfaces namespace
28 
29 inline void
31 
32  // Toggle the clock
33  m_gpio->write( m_pins[ CLOCK ], HIGH );
35  m_gpio->write( m_pins[ CLOCK ], LOW );
36 }
37 
38 } // End of interfaces namespace
39 
40 } // End of main namespace
41 
42 #endif /* _RPI_HW_IFACE_SHIFT_BASE_INL_HPP_ */
virtual void strobe()
Toggles the clock.
void nsleep(size_t nseconds)
Waits some nanoseconds.
gpio * m_gpio
Virtual GPIO controller.
Definition: base.hpp:90
size_t m_delay
The delay time of the clock.
Definition: shift-base.hpp:80
std::vector< uint8_t > m_pins
Vector containing interface pins.
Definition: base.hpp:87
void write(uint8_t pin, bool value)
Sets the value of a output pin.