Dependencies:   mbed-dsp mbed

Fork of DSP_200kHz by Mazzeo Research Group

Committer:
timmey9
Date:
Fri Jan 30 06:59:19 2015 +0000
Revision:
41:3e0623d81b9a
Parent:
40:bd6d8c35e822
Child:
42:52a92a8d2cc7
Added DMA class.  Made changes to ADC.  This code still needs to be tested.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
timmey9 39:82dc3daecf32 1 #ifndef ADC_H_
timmey9 39:82dc3daecf32 2 #define ADC_H_
timmey9 39:82dc3daecf32 3
timmey9 39:82dc3daecf32 4 #include "mbed.h"
timmey9 39:82dc3daecf32 5 #include <stdio.h>
timmey9 39:82dc3daecf32 6
timmey9 39:82dc3daecf32 7 // Analog sampling
timmey9 39:82dc3daecf32 8 #include "PeripheralNames.h"
timmey9 39:82dc3daecf32 9 #include "PeripheralPins.h"
timmey9 39:82dc3daecf32 10 #include "fsl_adc_hal.h"
timmey9 39:82dc3daecf32 11 #include "fsl_clock_manager.h"
timmey9 39:82dc3daecf32 12 #include "fsl_dspi_hal.h"
timmey9 41:3e0623d81b9a 13
timmey9 39:82dc3daecf32 14 #include "AngleEncoder.h"
timmey9 41:3e0623d81b9a 15 #include "dma.h"
timmey9 39:82dc3daecf32 16
timmey9 39:82dc3daecf32 17 #define MAX_FADC 6000000
timmey9 39:82dc3daecf32 18 #define SAMPLING_RATE 10 // In microseconds, so 10 us will be a sampling rate of 100 kHz
timmey9 39:82dc3daecf32 19
timmey9 41:3e0623d81b9a 20
timmey9 41:3e0623d81b9a 21
timmey9 41:3e0623d81b9a 22 void adc_start();
timmey9 41:3e0623d81b9a 23 void adc_stop();
timmey9 41:3e0623d81b9a 24
timmey9 41:3e0623d81b9a 25 void adc_init(PinName pin);
timmey9 40:bd6d8c35e822 26 void ADC0_IRQHandler();
timmey9 41:3e0623d81b9a 27 void ADC1_IRQHandler();
timmey9 41:3e0623d81b9a 28 //Serial debug(USBTX,USBRX);
timmey9 41:3e0623d81b9a 29 //DigitalOut toggle;
timmey9 41:3e0623d81b9a 30 //DMA _dma;
timmey9 39:82dc3daecf32 31
timmey9 41:3e0623d81b9a 32 #endif /* ADC_H_ */