Archived
1
0
This repo is archived. You can view files and clone it, but cannot push or open issues or pull requests.
keybrd/src/PortInterface.h

25 lines
803 B
C
Raw Normal View History

#ifndef PORTINTERFACE_H
#define PORTINTERFACE_H
2016-05-09 14:05:08 +00:00
#include <Arduino.h>
#include <inttypes.h>
#include <PortWriteInterface.h>
2016-05-09 14:05:08 +00:00
/*
2016-07-15 05:15:38 +00:00
Port classes are the keybrd library's interface to microcontroller ports or I/O expander ports.
Port classes that can read and write, inherit from PortInterface.
Port classes that can only write, inherit from PortWriteInterface.
2016-11-05 20:07:56 +00:00
write() interface emulates Arduino's digitalWrite().
2016-05-09 14:05:08 +00:00
*/
class PortInterface : public PortWriteInterface
2016-05-09 14:05:08 +00:00
{
public:
2016-09-24 17:26:08 +00:00
virtual void beginProtocol()=0; //SPI bus or I2C bus
2016-11-16 01:41:05 +00:00
virtual void begin(const uint8_t activeState)=0; //configure GPIO pins
virtual void writeLow(const uint8_t pin)=0;
virtual void writeHigh(const uint8_t pin)=0;
virtual uint8_t read()=0;
2016-05-09 14:05:08 +00:00
};
#endif