Skip to content

Commit d195aef

Browse files
committed
Enable circular mode for ADC data.
1 parent d365090 commit d195aef

File tree

1 file changed

+4
-10
lines changed

1 file changed

+4
-10
lines changed

source/configuration.adb

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -119,18 +119,11 @@ is
119119
-- 0: Disable ADC conversion and go to power down mode
120120
Aux.CONT := False; -- 0: Single conversion mode
121121
Aux.DMA := True; -- 1: DMA mode enabled
122-
Aux.DDS := False;
123-
-- 0: No new DMA request is issued after the last transfer (as
124-
-- configured in the DMA controller)
125-
-- XXX Aux.DDS := True;
126-
-- XXX 1: DMA requests are issued as long as data are converted and
127-
-- DMA=1
122+
Aux.DDS := True;
123+
-- 1: DMA requests are issued as long as data are converted and DMA=1
128124
Aux.EOCS := False;
129125
-- 0: The EOC bit is set at the end of each sequence of regular
130126
-- conversions. Overrun detection is enabled only if DMA=1.
131-
-- XXX Aux.EOCS := True;
132-
-- 1: The EOC bit is set at the end of each regular conversion.
133-
-- Overrun detection is enabled.
134127
Aux.ALIGN := False; -- 0: Right alignment
135128
-- Aux.JEXTSEL := <>; -- Not used
136129
Aux.JEXTEN := 2#00#; -- 00: Trigger detection disabled
@@ -240,7 +233,8 @@ is
240233
(Channel => 0,
241234
Peripheral => A0B.STM32F401.SVD.ADC.ADC1_Periph.DR'Address,
242235
Peripheral_Data_Size => A0B.STM32F401.DMA.Half_Word,
243-
Memory_Data_Size => A0B.STM32F401.DMA.Half_Word);
236+
Memory_Data_Size => A0B.STM32F401.DMA.Half_Word,
237+
Circular_Mode => True);
244238
end Initialize_DMA;
245239

246240
---------------------

0 commit comments

Comments
 (0)