mirror of
https://github.com/embassy-rs/embassy.git
synced 2025-09-28 12:50:37 +00:00
STM32: bump to latest stm32-metapac
HRTIM driver is updated per https://github.com/embassy-rs/stm32-data/pull/544
This commit is contained in:
parent
48d00bd74c
commit
0bec981882
@ -72,7 +72,7 @@ rand_core = "0.6.3"
|
|||||||
sdio-host = "0.5.0"
|
sdio-host = "0.5.0"
|
||||||
critical-section = "1.1"
|
critical-section = "1.1"
|
||||||
#stm32-metapac = { version = "15" }
|
#stm32-metapac = { version = "15" }
|
||||||
stm32-metapac = { git = "https://github.com/embassy-rs/stm32-data-generated", tag = "stm32-data-ab0ec4c19f81854189bab8215544ccd1256e1045" }
|
stm32-metapac = { git = "https://github.com/embassy-rs/stm32-data-generated", tag = "stm32-data-ddb0e7abab14bf3e1399875767b8834442382988" }
|
||||||
|
|
||||||
vcell = "0.1.3"
|
vcell = "0.1.3"
|
||||||
nb = "1.0.0"
|
nb = "1.0.0"
|
||||||
@ -101,7 +101,7 @@ proc-macro2 = "1.0.36"
|
|||||||
quote = "1.0.15"
|
quote = "1.0.15"
|
||||||
|
|
||||||
#stm32-metapac = { version = "15", default-features = false, features = ["metadata"]}
|
#stm32-metapac = { version = "15", default-features = false, features = ["metadata"]}
|
||||||
stm32-metapac = { git = "https://github.com/embassy-rs/stm32-data-generated", tag = "stm32-data-ab0ec4c19f81854189bab8215544ccd1256e1045", default-features = false, features = ["metadata"] }
|
stm32-metapac = { git = "https://github.com/embassy-rs/stm32-data-generated", tag = "stm32-data-ddb0e7abab14bf3e1399875767b8834442382988", default-features = false, features = ["metadata"] }
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
default = ["rt"]
|
default = ["rt"]
|
||||||
|
@ -236,8 +236,6 @@ pub struct BridgeConverter<T: Instance, C: AdvancedChannel<T>> {
|
|||||||
impl<T: Instance, C: AdvancedChannel<T>> BridgeConverter<T, C> {
|
impl<T: Instance, C: AdvancedChannel<T>> BridgeConverter<T, C> {
|
||||||
/// Create a new HRTIM bridge converter driver.
|
/// Create a new HRTIM bridge converter driver.
|
||||||
pub fn new(_channel: C, frequency: Hertz) -> Self {
|
pub fn new(_channel: C, frequency: Hertz) -> Self {
|
||||||
use crate::pac::hrtim::vals::{Activeeffect, Inactiveeffect};
|
|
||||||
|
|
||||||
T::set_channel_frequency(C::raw(), frequency);
|
T::set_channel_frequency(C::raw(), frequency);
|
||||||
|
|
||||||
// Always enable preload
|
// Always enable preload
|
||||||
@ -258,28 +256,16 @@ impl<T: Instance, C: AdvancedChannel<T>> BridgeConverter<T, C> {
|
|||||||
// Therefore, software-implemented dead time must be used when setting the duty cycles
|
// Therefore, software-implemented dead time must be used when setting the duty cycles
|
||||||
|
|
||||||
// Set output 1 to active on a period event
|
// Set output 1 to active on a period event
|
||||||
T::regs()
|
T::regs().tim(C::raw()).setr(0).modify(|w| w.set_per(true));
|
||||||
.tim(C::raw())
|
|
||||||
.setr(0)
|
|
||||||
.modify(|w| w.set_per(Activeeffect::SETACTIVE));
|
|
||||||
|
|
||||||
// Set output 1 to inactive on a compare 1 event
|
// Set output 1 to inactive on a compare 1 event
|
||||||
T::regs()
|
T::regs().tim(C::raw()).rstr(0).modify(|w| w.set_cmp(0, true));
|
||||||
.tim(C::raw())
|
|
||||||
.rstr(0)
|
|
||||||
.modify(|w| w.set_cmp(0, Inactiveeffect::SETINACTIVE));
|
|
||||||
|
|
||||||
// Set output 2 to active on a compare 2 event
|
// Set output 2 to active on a compare 2 event
|
||||||
T::regs()
|
T::regs().tim(C::raw()).setr(1).modify(|w| w.set_cmp(1, true));
|
||||||
.tim(C::raw())
|
|
||||||
.setr(1)
|
|
||||||
.modify(|w| w.set_cmp(1, Activeeffect::SETACTIVE));
|
|
||||||
|
|
||||||
// Set output 2 to inactive on a compare 3 event
|
// Set output 2 to inactive on a compare 3 event
|
||||||
T::regs()
|
T::regs().tim(C::raw()).rstr(1).modify(|w| w.set_cmp(2, true));
|
||||||
.tim(C::raw())
|
|
||||||
.rstr(1)
|
|
||||||
.modify(|w| w.set_cmp(2, Inactiveeffect::SETINACTIVE));
|
|
||||||
|
|
||||||
Self {
|
Self {
|
||||||
timer: PhantomData,
|
timer: PhantomData,
|
||||||
|
@ -57,14 +57,14 @@ async fn main(_spawner: Spawner) {
|
|||||||
// embassy_stm32::pac::HRTIM1
|
// embassy_stm32::pac::HRTIM1
|
||||||
// .tim(0)
|
// .tim(0)
|
||||||
// .setr(0)
|
// .setr(0)
|
||||||
// .modify(|w| w.set_sst(Activeeffect::SETACTIVE));
|
// .modify(|w| w.set_sst(true));
|
||||||
//
|
//
|
||||||
// Timer::after_millis(500).await;
|
// Timer::after_millis(500).await;
|
||||||
//
|
//
|
||||||
// embassy_stm32::pac::HRTIM1
|
// embassy_stm32::pac::HRTIM1
|
||||||
// .tim(0)
|
// .tim(0)
|
||||||
// .rstr(0)
|
// .rstr(0)
|
||||||
// .modify(|w| w.set_srt(Inactiveeffect::SETINACTIVE));
|
// .modify(|w| w.set_srt(true));
|
||||||
|
|
||||||
let max_duty = buck_converter.get_max_compare_value();
|
let max_duty = buck_converter.get_max_compare_value();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user