Struct mcp4725_rs::MCP4725
source · pub struct MCP4725<I2C, D> { /* private fields */ }
Expand description
Driver for the MCP4725 DAC
Implementations§
source§impl<I2C, D, E> MCP4725<I2C, D>where
I2C: Read<Error = E> + Write<Error = E> + WriteRead<Error = E>,
D: DelayMs<u8>,
impl<I2C, D, E> MCP4725<I2C, D>where
I2C: Read<Error = E> + Write<Error = E> + WriteRead<Error = E>,
D: DelayMs<u8>,
sourcepub fn write_dac_register_fast(&mut self, input_code: u16) -> Result<(), E>
pub fn write_dac_register_fast(&mut self, input_code: u16) -> Result<(), E>
write dac register, fast mode
sourcepub fn write_dac_register(&mut self, input_code: u16) -> Result<(), E>
pub fn write_dac_register(&mut self, input_code: u16) -> Result<(), E>
write dac register
sourcepub fn write_dac_register_eeprom(&mut self, input_code: u16) -> Result<(), E>
pub fn write_dac_register_eeprom(&mut self, input_code: u16) -> Result<(), E>
write dac register and eeprom
sourcepub fn read_dac_register(&mut self) -> Result<u16, E>
pub fn read_dac_register(&mut self) -> Result<u16, E>
read DAC value and return as 16-bit value
sourcepub fn set_dac_value(&mut self, val: u16) -> Result<(), E>
pub fn set_dac_value(&mut self, val: u16) -> Result<(), E>
set DAC output to specified value using fast mode. Value range is [0-4095], which corresponds to [0-VDD] voltage
sourcepub fn get_dac_value(&mut self) -> Result<u16, E>
pub fn get_dac_value(&mut self) -> Result<u16, E>
get current value of the DAC output