lib to set the address of the MCP4728

Dependents:   MCP4728setaddrProg mbedSerialInterface_talkback2 MCP4728test mbedSerialInterface_sequencer

Committer:
wbeaumont
Date:
Mon Dec 12 17:37:03 2016 +0000
Revision:
0:19560a1deb3c
Child:
1:1ba04e54bd3c
update if needed

Who changed what in which revision?

UserRevisionLine numberNew contents of line
wbeaumont 0:19560a1deb3c 1
wbeaumont 0:19560a1deb3c 2
wbeaumont 0:19560a1deb3c 3
wbeaumont 0:19560a1deb3c 4 class I2CInterface;
wbeaumont 0:19560a1deb3c 5 //class DigitalOut;
wbeaumont 0:19560a1deb3c 6 //class InterruptIn;
wbeaumont 0:19560a1deb3c 7
wbeaumont 0:19560a1deb3c 8 class MPC4728_address_set{
wbeaumont 0:19560a1deb3c 9 I2CInterface *i2cd;
wbeaumont 0:19560a1deb3c 10 DigitalOut *LDAC;
wbeaumont 0:19560a1deb3c 11 DigitalOut *Cntout;
wbeaumont 0:19560a1deb3c 12 InterruptIn cntin;
wbeaumont 0:19560a1deb3c 13 int sclcnt;
wbeaumont 0:19560a1deb3c 14 unsigned char oldaddress;
wbeaumont 0:19560a1deb3c 15 void count_down( );
wbeaumont 0:19560a1deb3c 16 int ldac1;
wbeaumont 0:19560a1deb3c 17 int ldac0;
wbeaumont 0:19560a1deb3c 18
wbeaumont 0:19560a1deb3c 19 public:
wbeaumont 0:19560a1deb3c 20 MPC4728_address_set(PinName sclcntpin, DigitalOut *LDACpin, I2CInterface* i2cdevice, DigitalOut *Cntoutpin , bool ldac_invert=false );
wbeaumont 0:19560a1deb3c 21 int getsclcnt( ){return sclcnt;}
wbeaumont 0:19560a1deb3c 22 int readaddress(char* address, char *eepromaddr=0 , char *regaddr=0 );
wbeaumont 0:19560a1deb3c 23
wbeaumont 0:19560a1deb3c 24 int setaddress(char currentaddress, char newaddress );
wbeaumont 0:19560a1deb3c 25
wbeaumont 0:19560a1deb3c 26 void start_scl_cnt(int cnts) ;
wbeaumont 0:19560a1deb3c 27
wbeaumont 0:19560a1deb3c 28 };//endclass