This can be used to select the output buffer behaviour of the DAC. The
default values are chosen to retain backwards compatibility with existing
behaviour.
Thanks to @peterhinch for the initial idea to add this feature.
This patch allows to configure the DAC resolution in the constructor and
in the init function, eg:
dac = DAC(1, bits=12).
The default resolution is 8 bits for backwards compatibility. The bits
sets the maximum value accepted by write and write_timed methods, being
2**bits - 1.
When using write_timed with 12-bit resolution, the input buffer is
treated as an unsigned half-word array, typecode 'H'.
See PR #1130 for discussion.
This allows the DAC to use a user-specified Timer for the triggering
(instead of the default Timer(6)), while still supporting original
behaviour.
Addresses issues #1129 and #1388.