Skip to content

Commit

Permalink
Merge pull request #166 from burrbull/gpio-defaults
Browse files Browse the repository at this point in the history
fix default mode for debug pins
  • Loading branch information
hannobraun authored Jan 14, 2022
2 parents 80021c8 + 14ff6eb commit 551d59b
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/gpio.rs
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,8 @@ pub struct PushPull;
/// Analog mode (type state)
pub struct Analog;

pub type Debugger = Alternate<0>;

/// GPIO Pin speed selection
#[derive(Debug, PartialEq, Eq, Clone, Copy)]
pub enum Speed {
Expand Down Expand Up @@ -645,17 +647,17 @@ gpio!(GPIOA, gpioa, PA, 'A', PAn, [
PA10: (pa10, 10, Input<Floating>),
PA11: (pa11, 11, Input<Floating>),
PA12: (pa12, 12, Input<Floating>),
PA13: (pa13, 13, Input<Floating>),
PA14: (pa14, 14, Input<Floating>),
PA15: (pa15, 15, Input<Floating>),
PA13: (pa13, 13, super::Debugger), // SWDIO, PullUp VeryHigh speed
PA14: (pa14, 14, super::Debugger), // SWCLK, PullDown
PA15: (pa15, 15, super::Debugger), // JTDI, PullUp
]);

gpio!(GPIOB, gpiob, PB, 'B', PBn, [
PB0: (pb0, 0, Input<Floating>),
PB1: (pb1, 1, Input<Floating>),
PB2: (pb2, 2, Input<Floating>),
PB3: (pb3, 3, Input<Floating>),
PB4: (pb4, 4, Input<Floating>),
PB3: (pb3, 3, super::Debugger), // SWO, VeryHigh speed
PB4: (pb4, 4, super::Debugger), // JTRST, PullUp
PB5: (pb5, 5, Input<Floating>),
PB6: (pb6, 6, Input<Floating>),
PB7: (pb7, 7, Input<Floating>),
Expand Down

0 comments on commit 551d59b

Please sign in to comment.