MCP23S17 Bufferd
ExioBufferedIn.h
- Committer:
- ryood
- Date:
- 2016-11-04
- Revision:
- 3:8be680035a08
- Child:
- 4:acd6e59f8544
File content as of revision 3:8be680035a08:
/* * ExioBufferdIn.h * * Created: 2016.11.05 * */ #ifndef _EXIOBUFFEREDIN_H_ #define _EXIOBUFFEREDIN_H_ #include "mbed.h" #include "rtos.h" #include "ExioInBuffer.h" class ExioBufferedIn { public: ExioBufferedIn(ExioInBuffer* buffer, int pin) : _buffer(buffer), _pin(pin) { } ~ExioBufferedIn() {} void mode(PinMode pull) { // Todo: impliment pullmode } int read() { uint8_t v = _buffer->readPort(); return (v & (1 << _pin)) ? 1 : 0; } protected: ExioInBuffer* _buffer; int _pin; }; #endif //_EXIOBUFFEREDIN_H_