Fix passing of dual quad param to inner constructor
This commit is contained in:
parent
4ea7dfce17
commit
330a3b0488
1 changed files with 10 additions and 20 deletions
|
@ -194,10 +194,6 @@ impl<'d, T: Instance, Dma> Ospi<'d, T, Dma> {
|
||||||
d1.set_as_af_pull(d1.af_num(), AFType::Input, Pull::None);
|
d1.set_as_af_pull(d1.af_num(), AFType::Input, Pull::None);
|
||||||
d1.set_speed(crate::gpio::Speed::VeryHigh);
|
d1.set_speed(crate::gpio::Speed::VeryHigh);
|
||||||
|
|
||||||
T::REGS.cr().modify(|w| {
|
|
||||||
w.set_dmm(false);
|
|
||||||
});
|
|
||||||
|
|
||||||
Self::new_inner(
|
Self::new_inner(
|
||||||
peri,
|
peri,
|
||||||
Some(d0.map_into()),
|
Some(d0.map_into()),
|
||||||
|
@ -214,6 +210,7 @@ impl<'d, T: Instance, Dma> Ospi<'d, T, Dma> {
|
||||||
dma,
|
dma,
|
||||||
config,
|
config,
|
||||||
OspiWidth::SING,
|
OspiWidth::SING,
|
||||||
|
false,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -238,10 +235,6 @@ impl<'d, T: Instance, Dma> Ospi<'d, T, Dma> {
|
||||||
d1.set_as_af_pull(d1.af_num(), AFType::OutputPushPull, Pull::None);
|
d1.set_as_af_pull(d1.af_num(), AFType::OutputPushPull, Pull::None);
|
||||||
d1.set_speed(crate::gpio::Speed::VeryHigh);
|
d1.set_speed(crate::gpio::Speed::VeryHigh);
|
||||||
|
|
||||||
T::REGS.cr().modify(|w| {
|
|
||||||
w.set_dmm(false);
|
|
||||||
});
|
|
||||||
|
|
||||||
Self::new_inner(
|
Self::new_inner(
|
||||||
peri,
|
peri,
|
||||||
Some(d0.map_into()),
|
Some(d0.map_into()),
|
||||||
|
@ -258,6 +251,7 @@ impl<'d, T: Instance, Dma> Ospi<'d, T, Dma> {
|
||||||
dma,
|
dma,
|
||||||
config,
|
config,
|
||||||
OspiWidth::DUAL,
|
OspiWidth::DUAL,
|
||||||
|
false,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -288,10 +282,6 @@ impl<'d, T: Instance, Dma> Ospi<'d, T, Dma> {
|
||||||
d3.set_as_af_pull(d3.af_num(), AFType::OutputPushPull, Pull::None);
|
d3.set_as_af_pull(d3.af_num(), AFType::OutputPushPull, Pull::None);
|
||||||
d3.set_speed(crate::gpio::Speed::VeryHigh);
|
d3.set_speed(crate::gpio::Speed::VeryHigh);
|
||||||
|
|
||||||
T::REGS.cr().modify(|w| {
|
|
||||||
w.set_dmm(false);
|
|
||||||
});
|
|
||||||
|
|
||||||
Self::new_inner(
|
Self::new_inner(
|
||||||
peri,
|
peri,
|
||||||
Some(d0.map_into()),
|
Some(d0.map_into()),
|
||||||
|
@ -308,6 +298,7 @@ impl<'d, T: Instance, Dma> Ospi<'d, T, Dma> {
|
||||||
dma,
|
dma,
|
||||||
config,
|
config,
|
||||||
OspiWidth::QUAD,
|
OspiWidth::QUAD,
|
||||||
|
false,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -350,10 +341,6 @@ impl<'d, T: Instance, Dma> Ospi<'d, T, Dma> {
|
||||||
d7.set_as_af_pull(d7.af_num(), AFType::OutputPushPull, Pull::None);
|
d7.set_as_af_pull(d7.af_num(), AFType::OutputPushPull, Pull::None);
|
||||||
d7.set_speed(crate::gpio::Speed::VeryHigh);
|
d7.set_speed(crate::gpio::Speed::VeryHigh);
|
||||||
|
|
||||||
T::REGS.cr().modify(|w| {
|
|
||||||
w.set_dmm(true);
|
|
||||||
});
|
|
||||||
|
|
||||||
Self::new_inner(
|
Self::new_inner(
|
||||||
peri,
|
peri,
|
||||||
Some(d0.map_into()),
|
Some(d0.map_into()),
|
||||||
|
@ -370,6 +357,7 @@ impl<'d, T: Instance, Dma> Ospi<'d, T, Dma> {
|
||||||
dma,
|
dma,
|
||||||
config,
|
config,
|
||||||
OspiWidth::QUAD,
|
OspiWidth::QUAD,
|
||||||
|
true,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -412,10 +400,6 @@ impl<'d, T: Instance, Dma> Ospi<'d, T, Dma> {
|
||||||
d7.set_as_af_pull(d7.af_num(), AFType::OutputPushPull, Pull::None);
|
d7.set_as_af_pull(d7.af_num(), AFType::OutputPushPull, Pull::None);
|
||||||
d7.set_speed(crate::gpio::Speed::VeryHigh);
|
d7.set_speed(crate::gpio::Speed::VeryHigh);
|
||||||
|
|
||||||
T::REGS.cr().modify(|w| {
|
|
||||||
w.set_dmm(false);
|
|
||||||
});
|
|
||||||
|
|
||||||
Self::new_inner(
|
Self::new_inner(
|
||||||
peri,
|
peri,
|
||||||
Some(d0.map_into()),
|
Some(d0.map_into()),
|
||||||
|
@ -432,6 +416,7 @@ impl<'d, T: Instance, Dma> Ospi<'d, T, Dma> {
|
||||||
dma,
|
dma,
|
||||||
config,
|
config,
|
||||||
OspiWidth::OCTO,
|
OspiWidth::OCTO,
|
||||||
|
false,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -451,6 +436,7 @@ impl<'d, T: Instance, Dma> Ospi<'d, T, Dma> {
|
||||||
dma: impl Peripheral<P = Dma> + 'd,
|
dma: impl Peripheral<P = Dma> + 'd,
|
||||||
config: Config,
|
config: Config,
|
||||||
width: OspiWidth,
|
width: OspiWidth,
|
||||||
|
dual_quad: bool,
|
||||||
) -> Self {
|
) -> Self {
|
||||||
into_ref!(peri, dma);
|
into_ref!(peri, dma);
|
||||||
|
|
||||||
|
@ -495,6 +481,10 @@ impl<'d, T: Instance, Dma> Ospi<'d, T, Dma> {
|
||||||
w.set_prescaler(config.clock_prescaler);
|
w.set_prescaler(config.clock_prescaler);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
T::REGS.cr().modify(|w| {
|
||||||
|
w.set_dmm(dual_quad);
|
||||||
|
});
|
||||||
|
|
||||||
T::REGS.tcr().modify(|w| {
|
T::REGS.tcr().modify(|w| {
|
||||||
w.set_sshift(match config.sample_shifting {
|
w.set_sshift(match config.sample_shifting {
|
||||||
true => vals::SampleShift::HALFCYCLE,
|
true => vals::SampleShift::HALFCYCLE,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue