mcp4725 0.2.0

Microchip MCP4725 DAC Driver for Rust Embedded HAL
Documentation

mcp4725   Build Status

Microchip MCP4725 DAC Driver for Rust Embedded HAL This is a driver crate for embedded Rust. It's built on top of the Rust embedded HAL It supports sending commands to a MCP4725 DAC over I2C. To get started you can look at the examples on how to use this driver on an inexpensive blue pill STM32F103 board.

The driver can be initialized by calling create and passing it an I2C interface.

let mut dac = MCP4725::create(i2c);

A command can then be created and initialized with the device address and some data, and sent the DAC.

let mut dac_cmd = Command::default().address(0b111).data(14);
dac.send(dac_cmd);

New data can be sent using the existing command by just changing the data and re-sending.

dac_cmd = dac_cmd.data(348);
dac.send(dac_cmd);

More information

Todo

[] Implement read command [] Create an example writing eeprom [] Implement sending multiple consecutive fast commands [] Possibly implement high speed mode

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.