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 | |
| 4 | #include "gpios.h" |
| 5 | |
| 6 | // Subclass of Pin for input pins. |
| 7 | |
| 8 | namespace bbb { |
| 9 | |
| 10 | class Gpi : public Pin { |
| 11 | public: |
| 12 | // See the base class for what these args mean. |
| 13 | Gpi(int bank, int pin); |
| 14 | |
| 15 | // Read the current value of the pin. |
| 16 | // Returns 1 if it reads high, 0 for low. |
| 17 | // Returns -1 if fails to read the pin for some reason. |
| 18 | int Read(); |
| 19 | }; |
| 20 | |
| 21 | } // namespace bbb |
| 22 | |
| 23 | #endif |