Correctly set alternate function for stm32f1 gpios
This commit is contained in:
parent
091e7e1f98
commit
c44bed300b
1 changed files with 10 additions and 4 deletions
|
@ -407,11 +407,17 @@ pub(crate) mod sealed {
|
|||
match af_type {
|
||||
// TODO: Do we need to configure input AF pins differently?
|
||||
AFType::OutputPushPull => {
|
||||
r.cr(crlh).modify(|w| w.set_cnf(n % 8, vals::Cnf::PUSHPULL));
|
||||
r.cr(crlh).modify(|w| {
|
||||
w.set_mode(n % 8, vals::Mode::OUTPUT50);
|
||||
w.set_cnf(n % 8, vals::Cnf::ALTPUSHPULL);
|
||||
});
|
||||
}
|
||||
AFType::OutputOpenDrain => {
|
||||
r.cr(crlh).modify(|w| {
|
||||
w.set_mode(n % 8, vals::Mode::OUTPUT50);
|
||||
w.set_cnf(n % 8, vals::Cnf::ALTOPENDRAIN);
|
||||
});
|
||||
}
|
||||
AFType::OutputOpenDrain => r
|
||||
.cr(crlh)
|
||||
.modify(|w| w.set_cnf(n % 8, vals::Cnf::OPENDRAIN)),
|
||||
}
|
||||
}
|
||||
#[cfg(gpio_v2)]
|
||||
|
|
Loading…
Reference in a new issue