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 DevInterfaces by
DACInterface.h@1:5672673314f9, 2016-01-08 (annotated)
- Committer:
- wbeaumont
- Date:
- Fri Jan 08 11:56:44 2016 +0000
- Revision:
- 1:5672673314f9
- Parent:
- 0:da1fb7dd363f
- Child:
- 3:b818d68937de
virtual I2C interface and some other classes for I2C devices
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| wbeaumont | 0:da1fb7dd363f | 1 | #ifndef __DACINTERFACE__ |
| wbeaumont | 0:da1fb7dd363f | 2 | #define __DACINTERFACE__ |
| wbeaumont | 0:da1fb7dd363f | 3 | |
| wbeaumont | 0:da1fb7dd363f | 4 | |
| wbeaumont | 1:5672673314f9 | 5 | #define VERSION_DACINTERFACE_HDR "0.40" |
| wbeaumont | 0:da1fb7dd363f | 6 | #include "getVersion.h" |
| wbeaumont | 0:da1fb7dd363f | 7 | |
| wbeaumont | 0:da1fb7dd363f | 8 | class DACInterface: public virtual getVersion{ |
| wbeaumont | 0:da1fb7dd363f | 9 | private: |
| wbeaumont | 0:da1fb7dd363f | 10 | |
| wbeaumont | 0:da1fb7dd363f | 11 | |
| wbeaumont | 0:da1fb7dd363f | 12 | public : |
| wbeaumont | 0:da1fb7dd363f | 13 | DACInterface():getVersion( VERSION_DACINTERFACE_HDR ,VERSION_DACINTERFACE_HDR , __TIME__, __DATE__){}; //Create an I2C Master interface |
| wbeaumont | 0:da1fb7dd363f | 14 | |
| wbeaumont | 0:da1fb7dd363f | 15 | virtual int setDACvalue(int dacvalue, int ch=0){ return 0;}; |
| wbeaumont | 0:da1fb7dd363f | 16 | virtual int getDACvalue (int& dacvalue , int ch=0){return 0;}; |
| wbeaumont | 1:5672673314f9 | 17 | virtual int setVoltage (float voltage, int ch=0){ return 0;}; |
| wbeaumont | 1:5672673314f9 | 18 | virtual int getVoltage(float &voltage, int ch=0){return 0;}; |
| wbeaumont | 1:5672673314f9 | 19 | virtual int update() {return 0;}; // general update by example readout all registers in the device to the class storage. |
| wbeaumont | 0:da1fb7dd363f | 20 | |
| wbeaumont | 0:da1fb7dd363f | 21 | }; |
| wbeaumont | 0:da1fb7dd363f | 22 | |
| wbeaumont | 0:da1fb7dd363f | 23 | #endif |
