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@39:82dc3daecf32, 2015-01-29 (annotated)
- Committer:
- timmey9
- Date:
- Thu Jan 29 16:18:54 2015 +0000
- Revision:
- 39:82dc3daecf32
- Child:
- 40:bd6d8c35e822
Cleaned up the code. PDB still won't work.
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 | #define TOTAL_SAMPLES 3 // originally 30000 for 0.3 ms of sampling. |
timmey9 | 39:82dc3daecf32 | 25 | |
timmey9 | 39:82dc3daecf32 | 26 | |
timmey9 | 39:82dc3daecf32 | 27 | void analog_initialization(PinName pin, Serial &pc); |
timmey9 | 39:82dc3daecf32 | 28 | |
timmey9 | 39:82dc3daecf32 | 29 | #endif /* ADC_H_ */ |