Daniel Petti | d6ff3d5 | 2014-01-02 11:24:39 -0800 | [diff] [blame] | 1 | #ifndef BBB_CAPE_SRC_BBB_GPI_H_ |
2 | #define BBB_CAPE_SRC_BBB_GPI_H_ | ||||
3 | |||||
Brian Silverman | 0aa48a9 | 2014-01-25 17:10:17 -0800 | [diff] [blame] | 4 | #include "bbb/gpios.h" |
Daniel Petti | d6ff3d5 | 2014-01-02 11:24:39 -0800 | [diff] [blame] | 5 | |
6 | namespace bbb { | ||||
7 | |||||
Brian Silverman | 0aa48a9 | 2014-01-25 17:10:17 -0800 | [diff] [blame] | 8 | // Subclass of Pin for input pins. |
9 | class Gpi : public GpioPin { | ||||
Daniel Petti | d6ff3d5 | 2014-01-02 11:24:39 -0800 | [diff] [blame] | 10 | public: |
Daniel Petti | d6ff3d5 | 2014-01-02 11:24:39 -0800 | [diff] [blame] | 11 | Gpi(int bank, int pin); |
12 | |||||
13 | // Read the current value of the pin. | ||||
Brian Silverman | 0aa48a9 | 2014-01-25 17:10:17 -0800 | [diff] [blame] | 14 | // Returns true if it's high and false if it's low. |
15 | bool Read(); | ||||
Daniel Petti | d6ff3d5 | 2014-01-02 11:24:39 -0800 | [diff] [blame] | 16 | }; |
17 | |||||
Daniel Petti | fe47525 | 2014-01-05 14:15:16 -0800 | [diff] [blame] | 18 | } // namespace bbb |
Daniel Petti | d6ff3d5 | 2014-01-02 11:24:39 -0800 | [diff] [blame] | 19 | |
20 | #endif |