Daniel Petti | d6ff3d5 | 2014-01-02 11:24:39 -0800 | [diff] [blame^] | 1 | #ifndef BBB_CAPE_SRC_BBB_GPO_H_ |
| 2 | #define BBB_CAPE_SRC_BBB_GPO_H_ |
| 3 | |
| 4 | #include "gpios.h" |
| 5 | |
| 6 | namespace bbb { |
| 7 | |
| 8 | // Gpios subclass for output pins. |
| 9 | class Gpo : public Pin { |
| 10 | public: |
| 11 | // See the base class for what these args mean. |
| 12 | Gpo(int bank, int pin); |
| 13 | |
| 14 | // Methods set the pin to read either high or low. |
| 15 | inline bool SetHigh() { |
| 16 | return DoSet(1); |
| 17 | } |
| 18 | inline bool SetLow() { |
| 19 | return DoSet(0); |
| 20 | } |
| 21 | |
| 22 | private: |
| 23 | // Does the actual pin setting. |
| 24 | bool DoSet(const int value); |
| 25 | }; |
| 26 | |
| 27 | } // namespace bbb |
| 28 | |
| 29 | #endif |