pub struct AD5668<SPI, CS> { /* private fields */ }
Expand description
AD5668 DAC driver. Wraps an I2C port to send commands to an AD5668
Implementations§
Source§impl<SPI, CS, E> AD5668<SPI, CS>
impl<SPI, CS, E> AD5668<SPI, CS>
Sourcepub fn write_input_register(
&mut self,
address: Address,
value: u16,
) -> Result<(), E>
pub fn write_input_register( &mut self, address: Address, value: u16, ) -> Result<(), E>
Write input register for the dac at address with the value, does not update dac register yet
Sourcepub fn update_dac_register(
&mut self,
address: Address,
value: u16,
) -> Result<(), E>
pub fn update_dac_register( &mut self, address: Address, value: u16, ) -> Result<(), E>
Update dac register for the dac at address TODO: Check if the data is written too or if this just updates data written earlier to the dac
Sourcepub fn write_input_register_update_all(
&mut self,
address: Address,
value: u16,
) -> Result<(), E>
pub fn write_input_register_update_all( &mut self, address: Address, value: u16, ) -> Result<(), E>
Write to a single input register, then update all dac channels. This can be used as the last command when updating multiple DACs. First stage values for all DACs then update them simultaniously by performing the last write using this command
Sourcepub fn write_and_update_dac_channel(
&mut self,
address: Address,
value: u16,
) -> Result<(), E>
pub fn write_and_update_dac_channel( &mut self, address: Address, value: u16, ) -> Result<(), E>
Write to input register and then update the dac register in one command.
Sourcepub fn set_power(
&mut self,
power_mode: PowerMode,
channel_states: u8,
) -> Result<(), E>
pub fn set_power( &mut self, power_mode: PowerMode, channel_states: u8, ) -> Result<(), E>
Set the power to the dacs. Use power_mode to set the power down mode, channel states can be used to power up the individual dacs by setting the corresponding bits.
Sourcepub fn enable_internal_ref(&mut self) -> Result<(), E>
pub fn enable_internal_ref(&mut self) -> Result<(), E>
Enable the internal reference
Sourcepub fn disable_internal_ref(&mut self) -> Result<(), E>
pub fn disable_internal_ref(&mut self) -> Result<(), E>
Disable the internal reference