analogIn with DMA
Diff: AnaloginDMA.h
- Revision:
- 2:08779d8f1873
- Parent:
- 1:4b275a292c9d
- Child:
- 3:678ff2edcbe6
- Child:
- 4:2844a210bd46
--- a/AnaloginDMA.h Sat Jan 03 10:17:22 2015 +0000 +++ b/AnaloginDMA.h Sat Jan 03 14:28:35 2015 +0000 @@ -57,41 +57,16 @@ analoginDMA_init(&_adc, pin); } - /** Read the input voltage, represented as a float in the range [0.0, 1.0] - * - * @returns A floating-point value representing the current input voltage, measured as a percentage - */ - float read() { - return analoginDMA_read(&_adc); - } - + /** Read the input voltage, represented as an unsigned short in the range [0x0, 0xFFFF] * * @returns * 16-bit unsigned short representing the current input voltage, normalised to a 16-bit value */ - unsigned short read_u16() { - return analoginDMA_read_u16(&_adc); + void read(uint16_t* pData, uint32_t Length) { + analoginDMA_read_u16(&_adc, pData, Length); } -#ifdef MBED_OPERATORS - /** An operator shorthand for read() - * - * The float() operator can be used as a shorthand for read() to simplify common code sequences - * - * Example: - * @code - * float x = volume.read(); - * float x = volume; - * - * if(volume.read() > 0.25) { ... } - * if(volume > 0.25) { ... } - * @endcode - */ - operator float() { - return read(); - } -#endif protected: analogin_t _adc;