@@ -369,13 +369,25 @@ mod pins {
369
369
370
370
pub type RefClk = PA1 < Input > ;
371
371
pub type Crs = PA7 < Input > ;
372
+
373
+ #[ cfg( pins = "nucleo" ) ]
372
374
pub type TxEn = PG11 < Input > ;
375
+ #[ cfg( pins = "nucleo" ) ]
373
376
pub type TxD0 = PG13 < Input > ;
377
+
378
+ #[ cfg( not( pins = "nucleo" ) ) ]
379
+ pub type TxEn = PB11 < Input > ;
380
+ #[ cfg( not( pins = "nucleo" ) ) ]
381
+ pub type TxD0 = PB12 < Input > ;
382
+
374
383
pub type TxD1 = PB13 < Input > ;
375
384
pub type RxD0 = PC4 < Input > ;
376
385
pub type RxD1 = PC5 < Input > ;
377
386
387
+ #[ cfg( not( pps = "alternate" ) ) ]
378
388
pub type Pps = PB5 < Output < PushPull > > ;
389
+ #[ cfg( pps = "alternate" ) ]
390
+ pub type Pps = PG5 < Output < PushPull > > ;
379
391
380
392
pub type Mdio = PA2 < Alternate < 11 > > ;
381
393
pub type Mdc = PC1 < Alternate < 11 > > ;
@@ -388,6 +400,7 @@ mod pins {
388
400
Mdc ,
389
401
Pps ,
390
402
) {
403
+ #[ allow( unused_variables) ]
391
404
let Gpio {
392
405
gpioa,
393
406
gpiob,
@@ -399,15 +412,23 @@ mod pins {
399
412
let crs = gpioa. pa7 . into_input ( ) ;
400
413
let rx_d0 = gpioc. pc4 . into_input ( ) ;
401
414
let rx_d1 = gpioc. pc5 . into_input ( ) ;
402
- let tx_en = gpiog. pg11 . into_input ( ) ;
403
- let tx_d0 = gpiog. pg13 . into_input ( ) ;
404
415
let tx_d1 = gpiob. pb13 . into_input ( ) ;
405
416
417
+ #[ cfg( not( pins = "nucleo" ) ) ]
418
+ let ( tx_en, tx_d0) = { ( gpiob. pb11 . into_input ( ) , gpiob. pb12 . into_input ( ) ) } ;
419
+
420
+ #[ cfg( pins = "nucleo" ) ]
421
+ let ( tx_en, tx_d0) = { ( gpiog. pg11 . into_input ( ) , gpiog. pg13 . into_input ( ) ) } ;
422
+
406
423
let mdio = gpioa. pa2 . into_alternate ( ) ;
407
424
let mdc = gpioc. pc1 . into_alternate ( ) ;
408
425
426
+ #[ cfg( not( pps = "alternate" ) ) ]
409
427
let pps = gpiob. pb5 . into_push_pull_output ( ) ;
410
428
429
+ #[ cfg( pps = "alternate" ) ]
430
+ let pps = gpiog. pg5 . into_push_pull_output ( ) ;
431
+
411
432
let pins = EthPins {
412
433
ref_clk,
413
434
crs,
0 commit comments