|
|
@ -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__
|
|
|
|