Updating HAL SPI usage to master version
parent
b0052128e0
commit
b8c0abcea2
|
@ -812,7 +812,7 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "stm32h7xx-hal"
|
name = "stm32h7xx-hal"
|
||||||
version = "0.9.0"
|
version = "0.9.0"
|
||||||
source = "git+https://github.com/quartiq/stm32h7xx-hal.git?rev=b0b8a93#b0b8a930b2c3bc5fcebc2e905b4c5e13360111a5"
|
source = "git+https://github.com/quartiq/stm32h7xx-hal.git?branch=master#acd47beb4b84b4dc46da3a8b68688bc8c5984604"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bare-metal 1.0.0",
|
"bare-metal 1.0.0",
|
||||||
"cast",
|
"cast",
|
||||||
|
|
|
@ -57,7 +57,7 @@ rev = "70b0eb5"
|
||||||
features = ["stm32h743v", "rt", "unproven", "ethernet", "quadspi"]
|
features = ["stm32h743v", "rt", "unproven", "ethernet", "quadspi"]
|
||||||
# version = "0.9.0"
|
# version = "0.9.0"
|
||||||
git = "https://github.com/quartiq/stm32h7xx-hal.git"
|
git = "https://github.com/quartiq/stm32h7xx-hal.git"
|
||||||
rev = "b0b8a93"
|
branch = "master"
|
||||||
|
|
||||||
# link.x section start/end
|
# link.x section start/end
|
||||||
[patch.crates-io.cortex-m-rt]
|
[patch.crates-io.cortex-m-rt]
|
||||||
|
|
|
@ -341,10 +341,13 @@ pub fn setup(
|
||||||
polarity: hal::spi::Polarity::IdleHigh,
|
polarity: hal::spi::Polarity::IdleHigh,
|
||||||
phase: hal::spi::Phase::CaptureOnSecondTransition,
|
phase: hal::spi::Phase::CaptureOnSecondTransition,
|
||||||
})
|
})
|
||||||
.manage_cs()
|
.inter_word_delay(design_parameters::ADC_SETUP_TIME)
|
||||||
.suspend_when_inactive()
|
.hardware_cs(hal::spi::HardwareCS {
|
||||||
.communication_mode(hal::spi::CommunicationMode::Receiver)
|
mode: hal::spi::HardwareCSMode::EndlessTransaction,
|
||||||
.cs_delay(design_parameters::ADC_SETUP_TIME);
|
assertion_delay: design_parameters::ADC_SETUP_TIME,
|
||||||
|
polarity: hal::spi::Polarity::IdleHigh,
|
||||||
|
})
|
||||||
|
.communication_mode(hal::spi::CommunicationMode::Receiver);
|
||||||
|
|
||||||
let spi: hal::spi::Spi<_, _, u16> = device.SPI2.spi(
|
let spi: hal::spi::Spi<_, _, u16> = device.SPI2.spi(
|
||||||
(spi_sck, spi_miso, hal::spi::NoMosi),
|
(spi_sck, spi_miso, hal::spi::NoMosi),
|
||||||
|
@ -382,10 +385,13 @@ pub fn setup(
|
||||||
polarity: hal::spi::Polarity::IdleHigh,
|
polarity: hal::spi::Polarity::IdleHigh,
|
||||||
phase: hal::spi::Phase::CaptureOnSecondTransition,
|
phase: hal::spi::Phase::CaptureOnSecondTransition,
|
||||||
})
|
})
|
||||||
.manage_cs()
|
.inter_word_delay(design_parameters::ADC_SETUP_TIME)
|
||||||
.suspend_when_inactive()
|
.hardware_cs(hal::spi::HardwareCS {
|
||||||
.communication_mode(hal::spi::CommunicationMode::Receiver)
|
mode: hal::spi::HardwareCSMode::EndlessTransaction,
|
||||||
.cs_delay(design_parameters::ADC_SETUP_TIME);
|
assertion_delay: design_parameters::ADC_SETUP_TIME,
|
||||||
|
polarity: hal::spi::Polarity::IdleHigh,
|
||||||
|
})
|
||||||
|
.communication_mode(hal::spi::CommunicationMode::Receiver);
|
||||||
|
|
||||||
let spi: hal::spi::Spi<_, _, u16> = device.SPI3.spi(
|
let spi: hal::spi::Spi<_, _, u16> = device.SPI3.spi(
|
||||||
(spi_sck, spi_miso, hal::spi::NoMosi),
|
(spi_sck, spi_miso, hal::spi::NoMosi),
|
||||||
|
@ -433,8 +439,11 @@ pub fn setup(
|
||||||
polarity: hal::spi::Polarity::IdleHigh,
|
polarity: hal::spi::Polarity::IdleHigh,
|
||||||
phase: hal::spi::Phase::CaptureOnSecondTransition,
|
phase: hal::spi::Phase::CaptureOnSecondTransition,
|
||||||
})
|
})
|
||||||
.manage_cs()
|
.hardware_cs(hal::spi::HardwareCS {
|
||||||
.suspend_when_inactive()
|
mode: hal::spi::HardwareCSMode::EndlessTransaction,
|
||||||
|
assertion_delay: 0.0,
|
||||||
|
polarity: hal::spi::Polarity::IdleHigh,
|
||||||
|
})
|
||||||
.communication_mode(hal::spi::CommunicationMode::Transmitter)
|
.communication_mode(hal::spi::CommunicationMode::Transmitter)
|
||||||
.swap_mosi_miso();
|
.swap_mosi_miso();
|
||||||
|
|
||||||
|
@ -465,9 +474,12 @@ pub fn setup(
|
||||||
polarity: hal::spi::Polarity::IdleHigh,
|
polarity: hal::spi::Polarity::IdleHigh,
|
||||||
phase: hal::spi::Phase::CaptureOnSecondTransition,
|
phase: hal::spi::Phase::CaptureOnSecondTransition,
|
||||||
})
|
})
|
||||||
.manage_cs()
|
.hardware_cs(hal::spi::HardwareCS {
|
||||||
|
mode: hal::spi::HardwareCSMode::EndlessTransaction,
|
||||||
|
assertion_delay: 0.0,
|
||||||
|
polarity: hal::spi::Polarity::IdleHigh,
|
||||||
|
})
|
||||||
.communication_mode(hal::spi::CommunicationMode::Transmitter)
|
.communication_mode(hal::spi::CommunicationMode::Transmitter)
|
||||||
.suspend_when_inactive()
|
|
||||||
.swap_mosi_miso();
|
.swap_mosi_miso();
|
||||||
|
|
||||||
device.SPI5.spi(
|
device.SPI5.spi(
|
||||||
|
|
Loading…
Reference in New Issue