You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
364 B
24 lines
364 B
#ifndef __PIN_HPP__
|
|
#define __PIN_HPP__
|
|
|
|
template <typename Derived>
|
|
struct Pin
|
|
{
|
|
void set(bool logic)
|
|
{
|
|
static_cast<Derived*>(this)->setImp(logic);
|
|
}
|
|
|
|
void toggle()
|
|
{
|
|
static_cast<Derived*>(this)->toggleImp();
|
|
}
|
|
|
|
bool get(void)
|
|
{
|
|
return static_cast<Derived*>(this)->getImp();
|
|
}
|
|
};
|
|
|
|
#endif // __PIN_HPP__
|