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
adc.h@40:bd6d8c35e822, 2015-01-30 (annotated)
- Committer:
- timmey9
- Date:
- Fri Jan 30 06:16:39 2015 +0000
- Revision:
- 40:bd6d8c35e822
- Parent:
- 39:82dc3daecf32
- Child:
- 41:3e0623d81b9a
ADC and DMA working. Start and stop of ADC/DMA is also working.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
timmey9 | 39:82dc3daecf32 | 1 | /* |
timmey9 | 39:82dc3daecf32 | 2 | * dma.h |
timmey9 | 39:82dc3daecf32 | 3 | * |
timmey9 | 39:82dc3daecf32 | 4 | * Created on: Nov 25, 2014 |
timmey9 | 39:82dc3daecf32 | 5 | * Author: Manuel Alejandro |
timmey9 | 39:82dc3daecf32 | 6 | */ |
timmey9 | 39:82dc3daecf32 | 7 | |
timmey9 | 39:82dc3daecf32 | 8 | #ifndef ADC_H_ |
timmey9 | 39:82dc3daecf32 | 9 | #define ADC_H_ |
timmey9 | 39:82dc3daecf32 | 10 | |
timmey9 | 39:82dc3daecf32 | 11 | #include "mbed.h" |
timmey9 | 39:82dc3daecf32 | 12 | #include <stdio.h> |
timmey9 | 39:82dc3daecf32 | 13 | |
timmey9 | 39:82dc3daecf32 | 14 | // Analog sampling |
timmey9 | 39:82dc3daecf32 | 15 | #include "PeripheralNames.h" |
timmey9 | 39:82dc3daecf32 | 16 | #include "PeripheralPins.h" |
timmey9 | 39:82dc3daecf32 | 17 | #include "fsl_adc_hal.h" |
timmey9 | 39:82dc3daecf32 | 18 | #include "fsl_clock_manager.h" |
timmey9 | 39:82dc3daecf32 | 19 | #include "fsl_dspi_hal.h" |
timmey9 | 39:82dc3daecf32 | 20 | #include "AngleEncoder.h" |
timmey9 | 39:82dc3daecf32 | 21 | |
timmey9 | 39:82dc3daecf32 | 22 | #define MAX_FADC 6000000 |
timmey9 | 39:82dc3daecf32 | 23 | #define SAMPLING_RATE 10 // In microseconds, so 10 us will be a sampling rate of 100 kHz |
timmey9 | 39:82dc3daecf32 | 24 | |
timmey9 | 40:bd6d8c35e822 | 25 | //DigitalOut blah(LED_BLUE); |
timmey9 | 39:82dc3daecf32 | 26 | void analog_initialization(PinName pin, Serial &pc); |
timmey9 | 40:bd6d8c35e822 | 27 | void start_adc(); |
timmey9 | 40:bd6d8c35e822 | 28 | void stop_adc(); |
timmey9 | 40:bd6d8c35e822 | 29 | void ADC0_IRQHandler(); |
timmey9 | 39:82dc3daecf32 | 30 | |
timmey9 | 39:82dc3daecf32 | 31 | #endif /* ADC_H_ */ |