Skip to content

Commit 8b35339

Browse files
committed
update SPI trait names
1 parent 87729a6 commit 8b35339

File tree

3 files changed

+16
-14
lines changed

3 files changed

+16
-14
lines changed

src/dma/macros.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ macro_rules! peripheral_target_instance {
125125
unsafe impl TargetAddress<M2P> for spi::Spi<$peripheral, spi::Disabled, $size> {
126126
#[inline(always)]
127127
fn address(&self) -> usize {
128-
use spi::SpiAllExt;
128+
use spi::SpiAll;
129129
&self.inner().$txreg as *const _ as usize
130130
}
131131

@@ -137,7 +137,7 @@ macro_rules! peripheral_target_instance {
137137
unsafe impl TargetAddress<P2M> for spi::Spi<$peripheral, spi::Disabled, $size> {
138138
#[inline(always)]
139139
fn address(&self) -> usize {
140-
use spi::SpiAllExt;
140+
use spi::SpiAll;
141141
&self.inner().$rxreg as *const _ as usize
142142
}
143143

src/prelude.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
pub use embedded_hal::prelude::*;
33

44
pub use crate::adc::AdcExt as _stm32h7xx_hal_adc_AdcExt;
5+
56
#[cfg(feature = "crc")]
67
pub use crate::crc::CrcExt as _stm32h7xx_hal_crc_CrcExt;
78
pub use crate::dac::DacExt as _stm32h7xx_hal_dac_DacExt;
@@ -27,6 +28,9 @@ pub use crate::sai::SaiPdmExt as _stm32h7xx_hal_spi_SaiPdmExt;
2728
#[cfg(feature = "sdmmc")]
2829
pub use crate::sdmmc::SdmmcExt as _stm32h7xx_hal_sdmmc_SdmmcExt;
2930
pub use crate::serial::SerialExt as _stm32h7xx_hal_serial_SerialExt;
31+
pub use crate::spi::SpiAll as _stm32h7xx_hal_spi_SpiAll;
32+
pub use crate::spi::SpiDisabled as _stm32h7xx_hal_spi_SpiDisabled;
33+
pub use crate::spi::SpiEnabled as _stm32h7xx_hal_spi_SpiEnabled;
3034
pub use crate::spi::SpiExt as _stm32h7xx_hal_spi_SpiExt;
3135
pub use crate::time::U32Ext as _stm32h7xx_hal_time_U32Ext;
3236
pub use crate::timer::TimerExt as _stm32h7xx_hal_timer_TimerExt;

src/spi.rs

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -541,10 +541,8 @@ pub trait SpiExt<SPI, WORD>: Sized {
541541
CONFIG: Into<Config>;
542542
}
543543

544-
pub trait SpiEnabledExt:
545-
SpiAllExt + FullDuplex<Self::Word, Error = Error>
546-
{
547-
type Disabled: SpiDisabledExt<
544+
pub trait SpiEnabled: SpiAll + FullDuplex<Self::Word, Error = Error> {
545+
type Disabled: SpiDisabled<
548546
Spi = Self::Spi,
549547
Word = Self::Word,
550548
Enabled = Self,
@@ -558,8 +556,8 @@ pub trait SpiEnabledExt:
558556
/// disabled.
559557
fn disable(self) -> Self::Disabled;
560558

561-
/// Resets the SPI peripheral. This is just a call to [SpiEnabledExt::disable]
562-
/// and [SpiDisabledExt::enable]
559+
/// Resets the SPI peripheral. This is just a call to [SpiEnabled::disable]
560+
/// and [SpiDisabled::enable]
563561
fn reset(self) -> Self {
564562
self.disable().enable()
565563
}
@@ -587,9 +585,9 @@ pub trait SpiEnabledExt:
587585
fn end_transaction(&mut self) -> Result<(), Error>;
588586
}
589587

590-
pub trait SpiDisabledExt: SpiAllExt {
588+
pub trait SpiDisabled: SpiAll {
591589
type Rec;
592-
type Enabled: SpiEnabledExt<Spi = Self::Spi, Word = Self::Word>;
590+
type Enabled: SpiEnabled<Spi = Self::Spi, Word = Self::Word>;
593591

594592
/// Enables the SPI peripheral.
595593
/// Clears the MODF flag, the SSI flag, and sets the SPE bit.
@@ -613,7 +611,7 @@ pub trait SpiDisabledExt: SpiAllExt {
613611
fn free(self) -> (Self::Spi, Self::Rec);
614612
}
615613

616-
pub trait SpiAllExt: Sized {
614+
pub trait SpiAll: Sized {
617615
type Spi;
618616
type Word;
619617

@@ -807,7 +805,7 @@ macro_rules! spi {
807805
}
808806
}
809807

810-
impl SpiEnabledExt for Spi<$SPIX, Enabled, $TY> {
808+
impl SpiEnabled for Spi<$SPIX, Enabled, $TY> {
811809
type Disabled = Spi<Self::Spi, Disabled, Self::Word>;
812810

813811
fn disable(self) -> Spi<$SPIX, Disabled, $TY> {
@@ -861,7 +859,7 @@ macro_rules! spi {
861859
}
862860
}
863861

864-
impl SpiDisabledExt for Spi<$SPIX, Disabled, $TY> {
862+
impl SpiDisabled for Spi<$SPIX, Disabled, $TY> {
865863
type Rec = rec::$Rec;
866864
type Enabled = Spi<Self::Spi, Enabled, Self::Word>;
867865

@@ -897,7 +895,7 @@ macro_rules! spi {
897895
}
898896
}
899897

900-
impl<EN> SpiAllExt for Spi<$SPIX, EN, $TY>
898+
impl<EN> SpiAll for Spi<$SPIX, EN, $TY>
901899
{
902900
type Word = $TY;
903901
type Spi = $SPIX;

0 commit comments

Comments
 (0)