mendelt/mcp4725

Microchip MCP4725 DAC Driver for Rust Embedded HAL

This is a driver crate for embedded Rust

mcp4725  

** . 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. The three least significant bits of the device address (A2, A1 and A0) also need to be specified. A2 and A1 are set in the device. A0 can be set by pulling the corresponding connection on the device high or low.

let mut dac = MCP4725::new(i2c, 0b010);

To set the dac output and powermode the dac register can be set;

dac.set_dac(PowerDown::Normal, 0x0fff);

The MCP4725 has a built in eeprom that is used to initialize the dac register on power up. The values in the eeprom can be set with the set_dac_and_eeprom method;

dac.set_dac_and_eeprom(PowerDown::Resistor100kOhm, 0x0fff);

More information

  • MCP4725 datasheet
  • API documentation
  • Github repository
  • Crates.io

License

Licensed under either of

  • Apache License, Version 2.0, (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
  • MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)

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.

Information - Updated Jul 11, 2022

Stars: 3
Forks: 1
Issues: 0

Repositories & Extras

CDRS is looking for maintainers

CDRS is Apache Cassandra driver written in pure Rust

CDRS is looking for maintainers

Rust bindings for the C++ api of PyTorch

LIghtweight wrapper for pytorch eg libtorch in rust

Rust bindings for the C++ api of PyTorch

The arkworks ecosystem consist of Rust libraries for designing and working with zero knowledge succinct...

This library is released under the MIT License and the Apache v2 License (see License)

The arkworks ecosystem consist of Rust libraries for designing and working with zero knowledge succinct...

A Rust wrapper library for smealum's ctrulib

A Rust wrapper library for smealum's LICENSE-APACHE, COPYRIGHT for details

A Rust wrapper library for smealum's ctrulib

OpenSearch Rust Client

a community-driven, open source fork of elasticsearch-rs licensed under the Apache v2

OpenSearch Rust Client

A 'Space Invader' clone made with rust and made for the terminal

Inspired by Apache License (Version 2

A 'Space Invader' clone made with rust and made for the terminal

The compact yet complete benchmarking suite for Rust

This project is licensed under the Apache-2

The compact yet complete benchmarking suite for Rust

Rust SDK for Structured Expression Project Toolkit (SEPT)

Copyright 2021 by Victor Dods, licensed under Apache 2

Rust SDK for Structured Expression Project Toolkit (SEPT)

🚶🚶🚶 rust-ingress

This is a POC for ingress solution using Apache Kafka with two services for ingressing and storing messages into Postgres

🚶🚶🚶 rust-ingress

Rust Embedded HAL for Apache NuttX RTOS

This crate provides Rust Embedded HAL interfaces (GPIO, I2C, SPI and Delay) for Apache NuttX RTOS

Rust Embedded HAL for Apache NuttX RTOS
Facebook Instagram Twitter GitHub Dribbble
Privacy