@@ -82,7 +82,6 @@ use crate::stm32::rcc::{d2ccip1r as ccip1r, d3ccipr as srdccipr};
82
82
use crate :: stm32:: spi1:: {
83
83
cfg1:: MBR_A as MBR , cfg2:: COMM_A as COMM , cfg2:: SSIOP_A as SSIOP ,
84
84
} ;
85
- use crate :: stm32:: { SPI1 , SPI2 , SPI3 , SPI4 , SPI5 , SPI6 } ;
86
85
use crate :: time:: Hertz ;
87
86
88
87
/// SPI error
@@ -547,7 +546,7 @@ macro_rules! word {
547
546
word ! ( u8 , u16 , u32 ) ;
548
547
549
548
macro_rules! spi {
550
- ( $( $SPIX: ident : $Rec: ident, ) +) => {
549
+ ( $( $SPIX: ty : $Rec: ident, ) +) => {
551
550
$(
552
551
impl <TY > Spi <$SPIX, Disabled , TY > where $SPIX: Instance {
553
552
/// Deconstructs the SPI peripheral and returns the component parts.
@@ -558,6 +557,14 @@ macro_rules! spi {
558
557
) +
559
558
}
560
559
}
560
+ spi ! {
561
+ pac:: SPI1 : Spi1 ,
562
+ pac:: SPI2 : Spi2 ,
563
+ pac:: SPI3 : Spi3 ,
564
+ pac:: SPI4 : Spi4 ,
565
+ pac:: SPI5 : Spi5 ,
566
+ pac:: SPI6 : Spi6 ,
567
+ }
561
568
562
569
impl < SPI : Instance , TY : Word > Spi < SPI , Enabled , TY > {
563
570
fn new < PINS > (
@@ -1188,7 +1195,7 @@ impl<SPI: Instance, WORD> Spi<SPI, Enabled, WORD> {
1188
1195
}
1189
1196
1190
1197
macro_rules! spi123sel {
1191
- ( $( $SPIX: ident : ( $spiX: ident, $Rec: ident) , ) +) => {
1198
+ ( $( $SPIX: ty : ( $spiX: ident, $Rec: ident) , ) +) => {
1192
1199
$(
1193
1200
impl crate :: Sealed for $SPIX { }
1194
1201
impl Instance for $SPIX {
@@ -1244,7 +1251,7 @@ macro_rules! spi123sel {
1244
1251
}
1245
1252
}
1246
1253
macro_rules! spi45sel {
1247
- ( $( $SPIX: ident : ( $spiX: ident, $Rec: ident) , ) +) => {
1254
+ ( $( $SPIX: ty : ( $spiX: ident, $Rec: ident) , ) +) => {
1248
1255
$(
1249
1256
impl crate :: Sealed for $SPIX { }
1250
1257
impl Instance for $SPIX {
@@ -1302,7 +1309,7 @@ macro_rules! spi45sel {
1302
1309
}
1303
1310
}
1304
1311
macro_rules! spi6sel {
1305
- ( $( $SPIX: ident : ( $spiX: ident, $Rec: ident) , ) +) => {
1312
+ ( $( $SPIX: ty : ( $spiX: ident, $Rec: ident) , ) +) => {
1306
1313
$(
1307
1314
impl crate :: Sealed for $SPIX { }
1308
1315
impl Instance for $SPIX {
@@ -1360,24 +1367,15 @@ macro_rules! spi6sel {
1360
1367
}
1361
1368
}
1362
1369
1363
- spi ! {
1364
- SPI1 : Spi1 ,
1365
- SPI2 : Spi2 ,
1366
- SPI3 : Spi3 ,
1367
- SPI4 : Spi4 ,
1368
- SPI5 : Spi5 ,
1369
- SPI6 : Spi6 ,
1370
- }
1371
-
1372
1370
spi123sel ! {
1373
- SPI1 : ( spi1, Spi1 ) ,
1374
- SPI2 : ( spi2, Spi2 ) ,
1375
- SPI3 : ( spi3, Spi3 ) ,
1371
+ pac :: SPI1 : ( spi1, Spi1 ) ,
1372
+ pac :: SPI2 : ( spi2, Spi2 ) ,
1373
+ pac :: SPI3 : ( spi3, Spi3 ) ,
1376
1374
}
1377
1375
spi45sel ! {
1378
- SPI4 : ( spi4, Spi4 ) ,
1379
- SPI5 : ( spi5, Spi5 ) ,
1376
+ pac :: SPI4 : ( spi4, Spi4 ) ,
1377
+ pac :: SPI5 : ( spi5, Spi5 ) ,
1380
1378
}
1381
1379
spi6sel ! {
1382
- SPI6 : ( spi6, Spi6 ) ,
1380
+ pac :: SPI6 : ( spi6, Spi6 ) ,
1383
1381
}
0 commit comments