Memory to Memory DMA demo from CMSIS example. This demo execute 1000 times of 32 word memory to memory DMA (copy), and also measures number of dummy loop execution during DMA cylcles. Line 56 of "DMA_M2M.c" can change DMA source. where; 1)static : source is SRAM 2)const : source is Flash ROM

Dependencies:   mbed

Committer:
todotani
Date:
Sun Nov 14 03:26:04 2010 +0000
Revision:
0:692bf16d1455
2010/11/14

Who changed what in which revision?

UserRevisionLine numberNew contents of line
todotani 0:692bf16d1455 1 /* mbed GetTickCount Library
todotani 0:692bf16d1455 2 * Copyright (c) 2010 Michael Wei
todotani 0:692bf16d1455 3 */
todotani 0:692bf16d1455 4
todotani 0:692bf16d1455 5 //shouldn't have to include, but fixes weird problems with defines
todotani 0:692bf16d1455 6 #include "LPC1768/LPC17xx.h"
todotani 0:692bf16d1455 7
todotani 0:692bf16d1455 8 #ifndef MBED_TICKCOUNT_H
todotani 0:692bf16d1455 9 #define MBED_TICKCOUNT_H
todotani 0:692bf16d1455 10 extern volatile unsigned int TickCount;
todotani 0:692bf16d1455 11
todotani 0:692bf16d1455 12 inline void GetTickCount_Start(void) {
todotani 0:692bf16d1455 13 //CMSIS SYSTICK Config
todotani 0:692bf16d1455 14 SysTick_Config(SystemCoreClock / 1000); /* Generate interrupt every 1 ms */
todotani 0:692bf16d1455 15 }
todotani 0:692bf16d1455 16
todotani 0:692bf16d1455 17 inline void GetTickCount_Stop(void) {
todotani 0:692bf16d1455 18 SysTick->CTRL = (1 << SYSTICK_CLKSOURCE) | (0<<SYSTICK_ENABLE) | (0<<SYSTICK_TICKINT); /* Disable SysTick IRQ and SysTick Timer */
todotani 0:692bf16d1455 19 }
todotani 0:692bf16d1455 20
todotani 0:692bf16d1455 21 inline void GetTickCount_Reset(void) {
todotani 0:692bf16d1455 22 SysTick->CTRL = (1 << SYSTICK_CLKSOURCE) | (0<<SYSTICK_ENABLE) | (0<<SYSTICK_TICKINT); /* Disable SysTick IRQ and SysTick Timer */
todotani 0:692bf16d1455 23 TickCount = 0;
todotani 0:692bf16d1455 24 SysTick->CTRL = (1 << SYSTICK_CLKSOURCE) | (1<<SYSTICK_ENABLE) | (1<<SYSTICK_TICKINT); /* Enable SysTick IRQ and SysTick Timer */
todotani 0:692bf16d1455 25 }
todotani 0:692bf16d1455 26
todotani 0:692bf16d1455 27 inline unsigned int GetTickCount(void)
todotani 0:692bf16d1455 28 {
todotani 0:692bf16d1455 29 return TickCount;
todotani 0:692bf16d1455 30 }
todotani 0:692bf16d1455 31 #endif