7 class Pin
: public Notifiable
10 Pin(bool value
=false) : value(value
) {
18 NotifierHandle
connect(Event type
, Notifier notifier
) {
19 return Notifiable::connect(type
, notifier
);
22 bool get(void) const {
26 void set(bool value
) {
27 if (value
&& !this->value
) {
29 this->notify(RISING_EDGE
);
30 } else if (!value
&& this->value
) {
32 this->notify(FALLING_EDGE
);
44 void pickle(Marshaller
*m
, const char *name
) {
45 bool value
= this->get();
46 m
->start_struct("Pin", name
);
47 marshal(m
, "value", &value
);
49 this->set(this->value
);