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:
- 49:4dcf4717a8bb
- Parent:
- 48:29f14bc30ba6
- Child:
- 50:33524a27e08c
--- a/dma.cpp Sat Jan 31 18:38:17 2015 +0000
+++ b/dma.cpp Sat Jan 31 19:16:22 2015 +0000
@@ -3,6 +3,8 @@
*/
#include "dma.h"
+Serial debug3(USBTX,USBRX);
+
#define TOTAL_SAMPLES 10
int len = TOTAL_SAMPLES;
uint16_t sample_array0[TOTAL_SAMPLES];
@@ -40,7 +42,7 @@
// Set memory address for source and destination for DMA0, DMA1, and DMA2
DMA_TCD0_SADDR = (uint32_t) &ADC0_RB;
DMA_TCD0_DADDR = (uint32_t) sample_array0;
- DMA_TCD1_SADDR = (uint32_t) &ADC1_RA;
+ DMA_TCD1_SADDR = (uint32_t) &ADC1_RB;
DMA_TCD1_DADDR = (uint32_t) sample_array1;
DMA_TCD2_SADDR = (uint32_t) &FTM2_CNT;
DMA_TCD2_DADDR = (uint32_t) angle_array;
@@ -87,21 +89,21 @@
DMA_TCD2_CSR = 0;
- /*pc.printf("DMA_CR: %08x\r\n", DMA_CR);
- pc.printf("DMA_ES: %08x\r\n", DMA_ES);
- pc.printf("DMA_ERQ: %08x\r\n", DMA_ERQ);
- pc.printf("DMA_EEI: %08x\r\n", DMA_EEI);
- pc.printf("DMA_CEEI: %02x\r\n", DMA_CEEI);
- pc.printf("DMA_SEEI: %02x\r\n", DMA_SEEI);
- pc.printf("DMA_CERQ: %02x\r\n", DMA_CERQ);
- pc.printf("DMA_SERQ: %02x\r\n", DMA_SERQ);
- pc.printf("DMA_CDNE: %02x\r\n", DMA_CDNE);
- pc.printf("DMA_SSRT: %02x\r\n", DMA_SSRT);
- pc.printf("DMA_CERR: %02x\r\n", DMA_CERR);
- pc.printf("DMA_CINT: %02x\r\n", DMA_CINT);
- pc.printf("DMA_INT: %08x\r\n", DMA_INT);
- pc.printf("DMA_ERR: %08x\r\n", DMA_ERR);
- pc.printf("DMA_HRS: %08x\r\n", DMA_HRS);*/
+ debug3.printf("DMA_CR: %08x\r\n", DMA_CR);
+ debug3.printf("DMA_ES: %08x\r\n", DMA_ES);
+ debug3.printf("DMA_ERQ: %08x\r\n", DMA_ERQ);
+ debug3.printf("DMA_EEI: %08x\r\n", DMA_EEI);
+ debug3.printf("DMA_CEEI: %02x\r\n", DMA_CEEI);
+ debug3.printf("DMA_SEEI: %02x\r\n", DMA_SEEI);
+ debug3.printf("DMA_CERQ: %02x\r\n", DMA_CERQ);
+ debug3.printf("DMA_SERQ: %02x\r\n", DMA_SERQ);
+ debug3.printf("DMA_CDNE: %02x\r\n", DMA_CDNE);
+ debug3.printf("DMA_SSRT: %02x\r\n", DMA_SSRT);
+ debug3.printf("DMA_CERR: %02x\r\n", DMA_CERR);
+ debug3.printf("DMA_CINT: %02x\r\n", DMA_CINT);
+ debug3.printf("DMA_INT: %08x\r\n", DMA_INT);
+ debug3.printf("DMA_ERR: %08x\r\n", DMA_ERR);
+ debug3.printf("DMA_HRS: %08x\r\n", DMA_HRS);
}
void dma_reset() {
