AD5384 DAC.
Fork of AD5384 by
Diff: AD5384.h
- Revision:
- 3:0d930c475e72
- Parent:
- 1:d2d6341d3e97
diff -r d2d6341d3e97 -r 0d930c475e72 AD5384.h --- a/AD5384.h Sun Oct 05 17:10:03 2014 +0000 +++ b/AD5384.h Tue Oct 07 21:17:50 2014 +0000 @@ -21,40 +21,37 @@ //class DigitalOut; class AD5384 : public getVersion { - SWSPI *spi ; - DigitalOut* cs; + SWSPI *spi; + DigitalOut * cs; float vref; void set_spi_mode(); - u16 calculate_dac_setting(u8 nr, float vout ); - u32 format_word(u8 mode,u8 ch,u8 rw,u16 data) ; - u16 get_reg(u8 mode, u8 ch ); - u32 set_reg(u8 mode,u8 ch, u16 value ); + u16 calculate_dac_setting(u8 nr, float vout); + u32 format_word(u8 mode, u8 ch, u8 rw, u16 data); + 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); u16 dac[40]; u16 gain[40]; u16 offset[40]; float volt[40]; - u16 get_dac(u8 ch); - u16 set_dac( u8 ch, u16 dac); - u16 get_ch_out_reg(u8 ch) ; - u16 set_volt(u8 nr, float vout ); - u16 set_gain(u8 ch, u16 gain ); - u16 get_gain(u8 ch ); - u16 set_offset(u8 ch, u16 gain); - u16 get_offset(u8 ch ); - // ctnrls - u32 get_ctrl(); - u32 soft_clr(); - u32 soft_rst(); - u32 clear_code(); - void init1(); - void init2(); - - - + u16 get_dac(u8 ch); + u16 set_dac(u8 ch, u16 dac); + u16 get_ch_out_reg(u8 ch) ; + u16 set_volt(u8 nr, float vout); + u16 set_gain(u8 ch, u16 gain); + u16 get_gain(u8 ch); + u16 set_offset(u8 ch, u16 gain); + u16 get_offset(u8 ch); + // ctnrls + u32 get_ctrl(); + u32 soft_clr(); + u32 soft_rst(); + u32 clear_code(); + void init1(); + void init2(); }; #endif \ No newline at end of file