AP_HAL: added wait_pin() API

for waiting on data-ready lines
This commit is contained in:
Andrew Tridgell 2020-04-22 15:52:49 +10:00
parent d8e208167d
commit 34df438560
1 changed files with 6 additions and 0 deletions

View File

@ -65,6 +65,12 @@ public:
return attach_interrupt(pin, (AP_HAL::Proc)nullptr, AP_HAL::GPIO::INTERRUPT_NONE);
}
/*
block waiting for a pin to change. A timeout of 0 means wait
forever. Return true on pin change, false on timeout
*/
virtual bool wait_pin(uint8_t pin, INTERRUPT_TRIGGER_TYPE mode, uint32_t timeout_us) { return false; }
/* return true if USB cable is connected */
virtual bool usb_connected(void) = 0;
};