we really need set_retries() high during init for nearly all i2c
devices, and as many are written against the generic device class
moving it to the Device class makes this a lot easier. It is a NOP on
SPI.
Replace the previous not-implemented interface with a set of new methods
that can be resonably implemented:
- register_periodic_callback() now receives a functor returning bool
to easily allow "oneshot" timers
- adjust_periodic_callback() allows the caller to change the timer
for a specific handle. This way drivers like MS5611 can adjust the
timer depending on its state machine: the time to sample
temperature is smaller than the time to get a pressure sample
- add unregister_callback(): since we have an opaque pointer, we
can't tell the user to just delete it in order to unregister the
callback