Digital in/out and poll commands are sent as one byte: +-+-+-+-+-+-+-+-+ |0|0 0| chan | Bit clear +-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+ |0|0 1| chan | Bit set +-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+ |0|1 0| chan | Bit get +-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+ |0|1 1| chan | Channel get +-+-+-+-+-+-+-+-+ Channels are sent as 2 to 6 bytes, depending on resolution: +-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+ 2 |1| bit8...bit2 | |0|bit| chan | +-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+ 3 |1|bit15...bit9 | |1| bit8...bit2 | |0|bit| chan | +-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+ ... +-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+ 6 |1|bit31...bit30| |1|bit29...bit23| ... |0|bit| chan | +-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+ Channel 31 is special, as it serves as the configuration channel. When reading from it multiple responses are sent with the following layout +-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-+ | command specific data |cmd|kind |conf chan| +-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-+ kind: 000 == end of configuration 001 == digital in 010 == digital out 011 == analog in 100 == analog out 101 == counter in cmd == 0 (Resolution) +-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-+ | | # of bits |0 0|kind |conf chan| +-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-+ # of bits (1..32) cmd == 1 (Minimum value) +-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-+ | minimum |S| unit|0 1|kind |conf chan| +-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-+ S (sign): 0 == + 1 == - unit: 000 == V 001 == mV 010 == uV cmd == 2 (Maximum value) +-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-+ | maximum |S| unit|1 0|kind |conf chan| +-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-+ S (sign): 0 == + 1 == - unit: 000 == V 001 == mV 010 == uV
Select Git revision
compiler
Name | Last commit | Last update |
---|---|---|
.. | ||
lib/avr/Makefile.common | ||
lib/avr/README | ||
lib/avr/serialio.h |