ad7172: start with nss high

This commit is contained in:
Astro 2019-08-30 00:11:23 +02:00
parent 2b855c8ad9
commit 12a1c1ac07
1 changed files with 2 additions and 1 deletions

View File

@ -43,7 +43,8 @@ pub struct Adc<SPI: Transfer<u8>, NSS: OutputPin> {
} }
impl<SPI: Transfer<u8>, NSS: OutputPin> Adc<SPI, NSS> { impl<SPI: Transfer<u8>, NSS: OutputPin> Adc<SPI, NSS> {
pub fn new(spi: SPI, nss: NSS) -> Result<Self, SPI::Error> { pub fn new(spi: SPI, mut nss: NSS) -> Result<Self, SPI::Error> {
let _ = nss.set_high();
let mut adc = Adc { spi, nss}; let mut adc = Adc { spi, nss};
let mut buf = [0, 0, 0]; let mut buf = [0, 0, 0];