mcp3x6x
no_std library for the MCP3x6x(R) family of analog digital converters.
Supports:
- MCP3461
- MCP3462
- MCP3464
- MCP3561
- MCP3562
- MCP3564
- MCP3461R
- MCP3462R
- MCP3464R
- MCP3465R
- MCP3561R
- MCP3562R
- MCP3564R
- MCP3565R
Features:
- Activate one of the device features to enable support for the corresponding device.
defmtfeature implementsdefmt::Formatfor all registers.
Basic usage:
use ;
// use 3.3V as Vref+ and 0V as Vref-
const TO_VOLT: ToVoltageConverter24bit = new;
// spi is a struct implementing embedded_hal::spi::SpiDevice.
// irq is an input pin attached to the IRQ pin of the ADC.
let mut adc = new;
// use internal clock
let config0 = default.with_clk_sel;
adc.write_register.unwrap;
// disable en_stp
let irq = default.with_en_stp;
adc.write_register.unwrap;
// be ready for conversions
adc.fast_command.unwrap;
loop