Skip to content

Commit b922477

Browse files
feat: stm32c071 support
1 parent d96233a commit b922477

File tree

5 files changed

+7
-3
lines changed

5 files changed

+7
-3
lines changed

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ device-selected = []
4848
rt = ["stm32c0/rt"]
4949
stm32c011 = ["stm32c0/stm32c011", "device-selected"]
5050
stm32c031 = ["stm32c0/stm32c031", "device-selected"]
51+
stm32c071 = ["stm32c0/stm32c071", "device-selected"]
5152

5253
i2c-blocking = []
5354
i2c-nonblocking = []

src/lib.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ pub use stm32c0::stm32c011 as stm32;
2323
#[cfg(feature = "stm32c031")]
2424
pub use stm32c0::stm32c031 as stm32;
2525

26+
#[cfg(feature = "stm32c071")]
27+
pub use stm32c0::stm32c071 as stm32;
28+
2629
#[cfg(feature = "rt")]
2730
pub use crate::stm32::interrupt;
2831

src/timer/opm.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ macro_rules! opm {
6767
unsafe {
6868
let tim = &*$TIMX::ptr();
6969
tim.psc().write(|w| w.psc().bits(psc as u16));
70-
tim.arr().write(|w| w.$arr().bits(reload as u16));
70+
tim.arr().write(|w| w.$arr().bits((reload as u16).into()));
7171
$(
7272
tim.arr.modify(|_, w| w.$arr_h().bits((reload >> 16) as u16));
7373
)*

src/timer/pwm.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ macro_rules! pwm {
8888

8989
unsafe {
9090
self.tim.psc().write(|w| w.psc().bits(psc as u16));
91-
self.tim.arr().write(|w| w.$arr().bits(arr as u16));
91+
self.tim.arr().write(|w| w.$arr().bits((arr as u16).into()));
9292
$(
9393
self.tim.arr().modify(|_, w| w.$arr_h().bits((arr >> 16) as u16));
9494
)*

src/timer/qei.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ macro_rules! qei {
8383
type Count = u16;
8484

8585
fn count(&self) -> u16 {
86-
self.tim.cnt().read().$cnt().bits()
86+
self.tim.cnt().read().$cnt().bits() as u16
8787
}
8888

8989
fn direction(&self) -> Direction {

0 commit comments

Comments
 (0)