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.
Diff: AD7989.h
- Revision:
- 1:582476614d9d
- Parent:
- 0:64eaedfa13a2
- Child:
- 2:60f5474814ac
--- a/AD7989.h Mon Jan 21 16:55:48 2019 +0000
+++ b/AD7989.h Mon Jan 21 17:27:10 2019 +0000
@@ -2,7 +2,28 @@
#define AD7989_H
#include "mbed-os/mbed.h"
-
+/** An abstraction for an 18 bit ADC
+* @note Not quite sure this is thread or interrupt safe. Treat this as a standard mbed SPI object
+* There are mutex locks when the SPI bus is being used.
+* Example
+* @code
+* #include "mbed.h"
+* #include "AD7989_Driver.h"
+*
+* SPI spi(p5, p6, p7); // mosi, miso, sclk
+* DigitalOut cs(p8);
+* Digitalout convert(p9);
+* AD7989_Driver ADCDEV(&spi, &cs, &convert);
+* double voltage;
+* int main()
+* {
+* while(1)
+* {
+* voltage = ADCDEV.sample();
+* printf("Voltage = %f Volts", voltage);
+* }
+* }
+*/
class AD7989_Driver
{
public: