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@45:d591d138cdeb, 2015-01-31 (annotated)
- Committer:
- timmey9
- Date:
- Sat Jan 31 07:25:52 2015 +0000
- Revision:
- 45:d591d138cdeb
- Parent:
- 42:52a92a8d2cc7
- Child:
- 51:43143a3fc2d7
Quadrature decoder is working.
Who changed what in which revision?
User | Revision | Line number | New 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 | 41:3e0623d81b9a | 5 | #include "dma.h" |
timmey9 | 39:82dc3daecf32 | 6 | |
timmey9 | 45:d591d138cdeb | 7 | /*** |
timmey9 | 45:d591d138cdeb | 8 | * Sets ADC to continuous conversion mode with software trigger, then |
timmey9 | 45:d591d138cdeb | 9 | * triggers the ADC. |
timmey9 | 45:d591d138cdeb | 10 | **/ |
timmey9 | 45:d591d138cdeb | 11 | void adc_start(); |
timmey9 | 39:82dc3daecf32 | 12 | |
timmey9 | 45:d591d138cdeb | 13 | /*** |
timmey9 | 45:d591d138cdeb | 14 | * Sets ADC to single conversion mode with hardware trigger. So the |
timmey9 | 45:d591d138cdeb | 15 | * ADC stops unless triggered by a timer. |
timmey9 | 45:d591d138cdeb | 16 | **/ |
timmey9 | 41:3e0623d81b9a | 17 | void adc_stop(); |
timmey9 | 41:3e0623d81b9a | 18 | |
timmey9 | 45:d591d138cdeb | 19 | /*** |
timmey9 | 45:d591d138cdeb | 20 | * Initializes the ADC to 16-bit single-ended CH13, hardware triggered |
timmey9 | 45:d591d138cdeb | 21 | * with DMA enabled. |
timmey9 | 45:d591d138cdeb | 22 | **/ |
timmey9 | 45:d591d138cdeb | 23 | void adc_init(); |
timmey9 | 45:d591d138cdeb | 24 | |
timmey9 | 45:d591d138cdeb | 25 | /*** |
timmey9 | 45:d591d138cdeb | 26 | * Toggles PTC16 when conversion completes |
timmey9 | 45:d591d138cdeb | 27 | **/ |
timmey9 | 40:bd6d8c35e822 | 28 | void ADC0_IRQHandler(); |
timmey9 | 45:d591d138cdeb | 29 | void adc_single_sample(); |
timmey9 | 39:82dc3daecf32 | 30 | |
timmey9 | 41:3e0623d81b9a | 31 | #endif /* ADC_H_ */ |