control for DAC AD5384 for the SOLID SM1 Slow Control
Diff: AD5384.h
- Revision:
- 3:7ca85ed310e0
- Parent:
- 1:d2d6341d3e97
- Child:
- 4:bc9ab300ab26
--- a/AD5384.h Mon Oct 06 22:25:16 2014 +0000 +++ b/AD5384.h Wed Oct 08 10:43:18 2014 +0000 @@ -5,7 +5,7 @@ #include "SWSPI.h" #include "getVersion.h" -#define VERSION_AD5384_HDR "1.12" +#define VERSION_AD5384_HDR "1.20" /* @@ -15,6 +15,7 @@ * v0.10 initial development to see if reading / writing is possible * v1.10 initial release versioni * v1.11 added init1 init2 + * v1.20 added rst pin */ class SWSPI; #include "mbed.h" @@ -23,6 +24,7 @@ class AD5384 : public getVersion { SWSPI *spi ; DigitalOut* cs; + DigitalOut* rst; float vref; void set_spi_mode(); @@ -31,7 +33,7 @@ u16 get_reg(u8 mode, u8 ch ); u32 set_reg(u8 mode,u8 ch, u16 value ); public: - AD5384(SWSPI *spiinterface ,DigitalOut* chipselect ); + AD5384(SWSPI *spiinterface ,DigitalOut* chipselect,DigitalOut* reset ); u16 dac[40]; u16 gain[40]; @@ -45,6 +47,7 @@ u16 get_gain(u8 ch ); u16 set_offset(u8 ch, u16 gain); u16 get_offset(u8 ch ); + void hw_rst(); // ctnrls u32 get_ctrl(); u32 soft_clr();