EVENT_T * GroveExample::attach_event_reporter_for_fire(CALLBACK_T reporter) { this->event1 = (EVENT_T *)malloc(sizeof(EVENT_T)); suli_event_init(event1, reporter, NULL); suli_pin_attach_interrupt_handler(pin, &pin_interrupt_handler, SULI_RISE, this); return this->event1; }
bool GroveMagneticSwitch::attach_event_reporter(CALLBACK_T reporter) { this->event = (EVENT_T *)malloc(sizeof(EVENT_T)); suli_event_init(event, reporter); suli_pin_attach_interrupt_handler(io, &mag_approach_interrupt_handler, SULI_RISE, this); return true; }
bool GroveIRDistanceInterrupter::attach_event_reporter(CALLBACK_T reporter) { this->event = (EVENT_T *)malloc(sizeof(EVENT_T)); suli_event_init(event, reporter); suli_pin_attach_interrupt_handler(io, &approach_interrupt_handler, SULI_FALL, this); return true; }
bool GroveButton::attach_event_reporter(CALLBACK_T reporter) { this->event = (EVENT_T *)malloc(sizeof(EVENT_T)); suli_event_init(event, reporter); suli_pin_attach_interrupt_handler(io, &button_interrupt_handler, SULI_RISE, this); return true; }