summaryrefslogtreecommitdiff
path: root/docs/library
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2015-07-21 23:37:45 +0100
committerDamien George <damien.p.george@gmail.com>2015-07-21 23:39:49 +0100
commitabc24c187614e358faa10ed6a3e239151f70b9f8 (patch)
treeed64fc0a71077f8d6de04c4eee4544aaa57c1699 /docs/library
parent6f5e0fe9555c935fa0bca81f56d0bfa2993636a2 (diff)
stmhal: Allow DAC.write_timed to take Timer object in place of freq.
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.
Diffstat (limited to 'docs/library')
-rw-r--r--docs/library/pyb.DAC.rst14
1 files changed, 12 insertions, 2 deletions
diff --git a/docs/library/pyb.DAC.rst b/docs/library/pyb.DAC.rst
index 5d4771a17..578a4d126 100644
--- a/docs/library/pyb.DAC.rst
+++ b/docs/library/pyb.DAC.rst
@@ -64,6 +64,16 @@ Methods
Initiates a burst of RAM to DAC using a DMA transfer.
The input data is treated as an array of bytes (8 bit data).
+ ``freq`` can be an integer specifying the frequency to write the DAC
+ samples at, using Timer(6). Or it can be an already-initialised
+ Timer object which is used to trigger the DAC sample. Valid timers
+ are 2, 4, 5, 6, 7 and 8.
+
``mode`` can be ``DAC.NORMAL`` or ``DAC.CIRCULAR``.
-
- TIM6 is used to control the frequency of the transfer.
+
+ Example using both DACs at the same time::
+
+ dac1 = DAC(1)
+ dac2 = DAC(2)
+ dac1.write_timed(buf1, pyb.Timer(6, freq=100), mode=DAC.CIRCULAR)
+ dac2.write_timed(buf2, pyb.Timer(7, freq=200), mode=DAC.CIRCULAR)