Sat Nov 9 09:59:54 EST 2019
Abstract DHT11 driver
So I wrote it out completely. Some notes:
- This can be done as inline functions, where the "host" is supposed
to implement basic functionality.
- A single start function + single event hander seems to make most
sense. This is also the structure that is used in Erlang.
- The ping-pong between state machine and host consists of two kinds
- Simple library functions that perform uC state change and readout,
e.g. get/set a pin, read a timer, start a timer.
- Some of these are expected to produce events, that will then be
passed on to the abstract event handler.
EDIT: Now this is a "sequential" event handling state machine, i.e. it
knows exactly what the next resume point is at the time of yielding,
so it can be represented in sequential, blocking form and
auto-generated from such form.