analogIn with DMA
Diff: AnaloginDMA.h
- Revision:
- 3:678ff2edcbe6
- Parent:
- 2:08779d8f1873
--- a/AnaloginDMA.h Sat Jan 03 14:28:35 2015 +0000 +++ b/AnaloginDMA.h Sat Jan 03 14:44:44 2015 +0000 @@ -33,12 +33,14 @@ * * #include "mbed.h" * - * AnalogIn temperature(p20); + * AnalogInDMA temperature(p20); * * int main() { + * unsigned short t; * while(1) { - * if(temperature > 0.5) { - * printf("Too hot! (%f)", temperature.read()); + * temperature.read(&t,1); + * if(t > 0.5) { + * printf("Too hot! (%f)", t); * } * } * } @@ -58,10 +60,8 @@ } - /** Read the input voltage, represented as an unsigned short in the range [0x0, 0xFFFF] + /** Read 'Length' input voltage(s), represented as an unsigned short in the buffer 'pData' * - * @returns - * 16-bit unsigned short representing the current input voltage, normalised to a 16-bit value */ void read(uint16_t* pData, uint32_t Length) { analoginDMA_read_u16(&_adc, pData, Length);