narf52/interfaces/gpio_interface.h

25 lines
496 B
C
Raw Normal View History

2020-03-29 16:05:34 +00:00
#ifndef __INTERFACES_GPIO_INTERFACE_H__
#define __INTERFACES_GPIO_INTERFACE_H__
#include <cstdint>
2020-03-31 18:28:36 +00:00
namespace pinetime::interfaces {
2020-03-29 16:05:34 +00:00
class GpioInterface
{
public:
enum class direction {IN, OUT};
2020-04-25 08:09:38 +00:00
virtual void set_direction(direction, bool) = 0;
2020-03-29 16:05:34 +00:00
virtual uint32_t get() = 0;
virtual void set() = 0;
virtual void clear() = 0;
virtual void toggle() = 0;
2020-04-25 08:09:38 +00:00
virtual void handle() = 0;
virtual uint32_t pin_number() = 0;
2020-03-29 16:05:34 +00:00
};
}
#endif