From 381f25f0364e1354195340e1e9246b29bc7d7509 Mon Sep 17 00:00:00 2001 From: linuswck Date: Wed, 24 Jan 2024 11:19:47 +0800 Subject: [PATCH] AD7172: correct wrong NSS pinout definition --- src/device/gpio.rs | 2 +- src/thermostat/ad7172/adc.rs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/device/gpio.rs b/src/device/gpio.rs index ba75cef..30f9877 100644 --- a/src/device/gpio.rs +++ b/src/device/gpio.rs @@ -132,7 +132,7 @@ pub fn setup( ad7172::SPI_CLOCK_MHZ.convert(), &clocks ), - gpiod.pd0.into_push_pull_output(), + gpioa.pa15.into_push_pull_output(), ).unwrap(); (eth_pins, usb, current_source_phy, ad7172_phy, max1968_phy) diff --git a/src/thermostat/ad7172/adc.rs b/src/thermostat/ad7172/adc.rs index c62fcad..47415a8 100644 --- a/src/thermostat/ad7172/adc.rs +++ b/src/thermostat/ad7172/adc.rs @@ -4,7 +4,7 @@ use stm32f4xx_hal:: { spi::{Spi, TransferModeNormal}, pac::SPI3, - gpio::{PC10, PC11, PC12, PD0, Alternate, Output, PushPull}, + gpio::{PC10, PC11, PC12, PA15, Alternate, Output, PushPull}, hal::{ blocking::spi::Transfer, digital::v2::OutputPin, @@ -30,7 +30,7 @@ pub struct Adc, NSS: OutputPin> { } type AdcSpi = Spi>, PC11>, PC12>), TransferModeNormal>; -type AdcNss = PD0>; +type AdcNss = PA15>; pub type AdcPhy = Adc; impl, NSS: OutputPin, E: fmt::Debug> Adc {