Rpi-hw  0.7.2
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Pages
spi-inl.hpp
1 /*
2  Title --- driver/spi-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_DRIVER_SPI_INL_HPP_
23 #define _RPI_HW_DRIVER_SPI_INL_HPP_
24 
25 namespace rpihw { // Begin main namespace
26 
27 namespace driver { // Begin drivers namespace
28 
29 inline uint8_t
30 spi::getMode() const {
31 
32  // Return the SPI mode
33  return m_mode;
34 }
35 
36 inline uint8_t
37 spi::getWordLen() const {
38 
39  // Return the device word length
40  return m_word_len;
41 }
42 
43 inline uint32_t
44 spi::getSpeed() const {
45 
46  // Return the device max speed
47  return m_speed;
48 }
49 
50 } // End of drivers namespace
51 
52 } // End of main namespace
53 
54 #endif /* _RPI_HW_DRIVER_SPI_INL_HPP_ */
uint32_t m_speed
Device max speed (hz).
Definition: spi.hpp:121
uint8_t m_mode
SPI mode.
Definition: spi.hpp:115
uint32_t getSpeed() const
Returns the device max speed.
Definition: spi-inl.hpp:44
uint8_t getWordLen() const
Returns the device word length.
Definition: spi-inl.hpp:37
uint8_t m_word_len
Device word length.
Definition: spi.hpp:118
uint8_t getMode() const
Returns the SPI mode.
Definition: spi-inl.hpp:30