blob: be41a11f8b6305c0a1b7bd634d6424794c881385 [file] [log] [blame]
Daniel Pettid6ff3d52014-01-02 11:24:39 -08001#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
8namespace bbb {
9
10class 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
Daniel Pettife475252014-01-05 14:15:16 -080021} // namespace bbb
Daniel Pettid6ff3d52014-01-02 11:24:39 -080022
23#endif