diff options
author | Damien George <damien.p.george@gmail.com> | 2015-10-13 14:33:04 +0100 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2015-10-13 14:33:04 +0100 |
commit | b5c43be135dc4b9e75fda771935445589e761b12 (patch) | |
tree | de482d74a4ea7f40a7143b11423722431b5fbd7b /py/sequence.c | |
parent | b8f9ac54111ad0962401c764112c9a5669699deb (diff) | |
download | micropython-b5c43be135dc4b9e75fda771935445589e761b12.tar.gz micropython-b5c43be135dc4b9e75fda771935445589e761b12.zip |
stmhal: Allow to set bits resolution for DAC; 8 is default, can have 12.
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.
Diffstat (limited to 'py/sequence.c')
0 files changed, 0 insertions, 0 deletions