Skip to content

Commit 78032d6

Browse files
committed
Fix g070
1 parent d168689 commit 78032d6

File tree

7 files changed

+20
-13
lines changed

7 files changed

+20
-13
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ nb = "1.0.0"
2121
fugit = "0.3.5"
2222

2323
[dependencies.stm32g0]
24-
version = "0.14.0"
24+
version = "0.15.1"
2525
features = ["rt"]
2626

2727
[dependencies.bare-metal]

src/analog/adc.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,7 @@ where
362362
.modify(|_, w| unsafe { w.smp1().bits(self.sample_time as u8) });
363363

364364
self.rb
365-
.chselr() // set activ channel acording chapter 15.12.9 (ADC_CFGR1; CHSELRMOD=0)
365+
.chselr0() // set active channel according chapter 15.12.9 (ADC_CFGR1; CHSELRMOD=0)
366366
.modify(|_, w| unsafe { w.chsel().bits(1 << PIN::channel()) });
367367
}
368368
}
@@ -415,7 +415,7 @@ where
415415
.modify(|_, w| unsafe { w.smp1().bits(self.sample_time as u8) });
416416

417417
self.rb
418-
.chselr()
418+
.chselr0()
419419
.modify(|_, w| unsafe { w.chsel().bits(1 << PIN::channel()) });
420420

421421
self.rb.isr.modify(|_, w| w.eos().set_bit());

src/dmamux.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -185,13 +185,13 @@ macro_rules! dma_mux {
185185
#[cfg(any(feature = "stm32g070", feature = "stm32g071", feature = "stm32g081"))]
186186
dma_mux!(
187187
channels: {
188-
C0: (ch0, dmamux_c0cr),
189-
C1: (ch1, dmamux_c1cr),
190-
C2: (ch2, dmamux_c2cr),
191-
C3: (ch3, dmamux_c3cr),
192-
C4: (ch4, dmamux_c4cr),
193-
C5: (ch5, dmamux_c5cr),
194-
C6: (ch6, dmamux_c6cr),
188+
C0: (ch0, c0cr),
189+
C1: (ch1, c1cr),
190+
C2: (ch2, c2cr),
191+
C3: (ch3, c3cr),
192+
C4: (ch4, c4cr),
193+
C5: (ch5, c5cr),
194+
C6: (ch6, c6cr),
195195
},
196196
);
197197

src/i2c/blocking.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,8 +186,14 @@ macro_rules! i2c {
186186
});
187187

188188
if config.slave_address_1 > 0 {
189+
let addr = if config.address_11bits {
190+
config.slave_address_1
191+
} else {
192+
config.slave_address_1 << 1
193+
};
194+
189195
i2c.oar1.write(|w| unsafe {
190-
w.oa1_7_1().bits(config.slave_address_1 as u8)
196+
w.oa1().bits(addr)
191197
.oa1mode().bit(config.address_11bits)
192198
.oa1en().set_bit()
193199
});

src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ pub mod analog;
6262
pub mod crc;
6363
pub mod dma;
6464
pub mod dmamux;
65+
#[cfg(feature = "")]
6566
pub mod exti;
6667
pub mod flash;
6768
pub mod gpio;

src/spi.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ macro_rules! spi {
186186
.set_bit()
187187
.rxonly()
188188
.clear_bit()
189-
.dff()
189+
.crcl()
190190
.clear_bit()
191191
.bidimode()
192192
.clear_bit()

src/timer/pwm.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ pwm_advanced_hal! {
271271

272272
#[cfg(any(feature = "stm32g070"))]
273273
pwm_advanced_hal! {
274-
TIM15: (Channel1, cc1e: cc1ne, ccmr1_output, oc1pe, oc1m1, ccr1, moe),
274+
TIM15: (Channel1, cc1e: cc1ne, ccmr1_output, oc1pe, oc1m, ccr1, moe),
275275
}
276276

277277
#[cfg(any(feature = "stm32g071", feature = "stm32g081"))]

0 commit comments

Comments
 (0)