Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of Impedance_Fast_Circuitry by
Diff: dma.cpp
- Revision:
- 43:c593a8b9688f
- Parent:
- 42:52a92a8d2cc7
- Child:
- 44:41c262caf898
--- a/dma.cpp Fri Jan 30 07:22:00 2015 +0000 +++ b/dma.cpp Fri Jan 30 08:14:36 2015 +0000 @@ -22,7 +22,7 @@ _array2 = sample_array2; _array3 = sample_array3; _len = len; - _angle = (int*)PORTC_BASE;//relative_angle; + _angle = (int*)PORTC_BASE_PTR;//relative_angle; init(); } @@ -39,7 +39,7 @@ // Enable Channel 0 and set ADC0 as DMA request source DMAMUX_CHCFG0 |= DMAMUX_CHCFG_ENBL_MASK | DMAMUX_CHCFG_SOURCE(40); // see page 95 of user manual DMAMUX_CHCFG1 |= DMAMUX_CHCFG_ENBL_MASK | DMAMUX_CHCFG_SOURCE(41); - //DMAMUX_CHCFG2 |= DMAMUX_CHCFG_ENBL_MASK | + DMAMUX_CHCFG2 |= DMAMUX_CHCFG_ENBL_MASK | DMAMUX_CHCFG_TRIG_MASK | DMAMUX_CHCFG_SOURCE(51); // PortC // Enable request signal for channel 0 @@ -50,7 +50,7 @@ DMA_TCD0_DADDR = (uint32_t) _array1; DMA_TCD1_SADDR = (uint32_t)&ADC1_RA; DMA_TCD1_DADDR = (uint32_t) _array2; - DMA_TCD2_SADDR = (uint32_t) _angle; + DMA_TCD2_SADDR = (uint32_t) PORTC_BASE_PTR; DMA_TCD2_DADDR = (uint32_t) _array3; // Set an offset for source and destination address