added more funtions to pin interface

interrupts
polymurph 4 years ago
parent 68a25b0b64
commit 4cb7ec1772

@ -4,10 +4,20 @@
template <typename Derived> template <typename Derived>
struct Pin struct Pin
{ {
bool read()
{
return static_cast<Derived*>(this)->readImpl();
}
void write(bool logic) void write(bool logic)
{ {
static_cast<Derived*>(this)->writeImpl(logic); static_cast<Derived*>(this)->writeImpl(logic);
} }
void toggle()
{
static_cast<Derived*>(this)-toggleImpl();
}
}; };
#endif // __PIN_HPP__ #endif // __PIN_HPP__

Loading…
Cancel
Save