Skip to content

Commit a1baa2f

Browse files
Prepare releasing 0.7 (#305)
* Do not warn on unnecessary unsafe * Use DWT::cycle_count() instead of deprecated get_cycle_count() * Prepare releasing 0.7
1 parent 46006b9 commit a1baa2f

File tree

5 files changed

+54
-7
lines changed

5 files changed

+54
-7
lines changed

CHANGELOG.md

Lines changed: 48 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,57 @@
33
All notable changes to this project will be documented in this file.
44
This project adheres to [Semantic Versioning](http://semver.org/).
55

6-
## [Unreleased]
6+
## [v0.7.0] - 2021-04-04
77

8-
## Changed
8+
### Added
99

10+
- Add delay implementation based on `cortex_m::asm::delay`.
11+
- Implement `RngCore` and `CryptoRng` for the hardware RNG.
12+
- Support analog to digital converters (ADC).
13+
- Support SPI slave mode.
14+
- Add DMA and interrupt support for SPI and ADC peripherals.
15+
- Add support for measuring Vref, Vbat and temperature.
16+
- Add alternate function 0 to GPIO.
17+
- Add preliminary bxCAN support.
18+
- Add more GPIO combinations for I2C and PWM peripherals.
19+
- Add wakeup clock sources to RTC config.
20+
- Support RTC domain backup registers.
21+
- Support I2C on stm32l4x3 devices.
22+
- Support I2C3 peripheral on stm32l4x6 devices.
23+
- Experimental support for the Synopsis USB library.
24+
- Experimental support for USB OTG FS for stm32l4x5 and stm32l4x6 devices.
25+
- Support stm32l4r9 devices.
26+
27+
### Changed
28+
29+
- Use device-specific features rather than by-peripheral features.
1030
- Use `fugit` duration nd rate units instead of custom
1131
- Use const-generics for GPIO (require Rust 1.51)
32+
- Import I2C implementation from `stm32h7xx-hal` crate.
33+
- Use a `Config` struct for initializing I2C peripherals.
34+
- Check that the clock requested for the low-power timer is enabled.
35+
- Take `clocks` argument by value when setting up low-power timer.
36+
- Use sane low-power timer defaults (LSI, no prescaler).
37+
- Make `LowPowerTimer<_>::set_autoreload()` public.
38+
- Enable SPI2 for all stm32l4x2 devices as some of them have it.
39+
- Target hardfp by default since stm32l4 cores are Cortex-M4F.
40+
- Require typed input when converting from milliseconds to hertz.
41+
- Rework alternate function typestates.
42+
- Use MSI as default/fallback clock source for SYSCLK.
43+
- Use specialized PAC for stm32l412 and stm32l422 devices.
44+
- Add `toggeable` trait to GPIO pins.
45+
- Update `stm32l4` dependency.
46+
47+
### Fixed
48+
49+
- Fix TIM1 PWM frequency computation.
50+
- Fix TIM5 counter width.
51+
- Fix PSC computation off-by-one error.
52+
- Change wait states values according to datasheet.
53+
- Fix incorrect I2C2 on PC0/PC1 on stm32l4x3 devices.
54+
- Swap QSPI pins and remove conflicting/wrong implementations.
55+
- Add power on GPIOG pins.
56+
- Support 0 byte writes on I2C.
1257

1358
## [v0.6.0] - 2020-12-11
1459

@@ -197,7 +242,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
197242

198243
- Initial release
199244

200-
[Unreleased]: https://github.com/stm32-rs/stm32l4xx-hal/compare/v0.6.0...HEAD
245+
[v0.7.0]: https://github.com/stm32-rs/stm32l4xx-hal/compare/v0.6.0...v0.7.0
201246
[v0.6.0]: https://github.com/stm32-rs/stm32l4xx-hal/compare/v0.5.0...v0.6.0
202247
[v0.5.0]: https://github.com/stm32-rs/stm32l4xx-hal/compare/v0.4.0...v0.5.0
203248
[v0.4.0]: https://github.com/stm32-rs/stm32l4xx-hal/compare/v0.3.6...v0.4.0

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "stm32l4xx-hal"
3-
version = "0.6.0"
3+
version = "0.7.0"
44
authors = ["Scott Mabin <MabezDev@gmail.com>"]
55
description = "Hardware abstraction layer for the stm32l4xx chips"
66
keywords = ["no-std", "stm32l4xx", "stm32l4", "embedded", "embedded-hal"]

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ _formerly [MabezDev/stm32l4xx-hal](https://github.com/mabezdev/stm32l4xx-hal)_
1414

1515
## About
1616

17-
- Minimum rustc version 1.31
17+
- Minimum rustc version 1.51
1818

1919
## License
2020

src/spi.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ macro_rules! hal {
7272
$(
7373
impl<SCK, MISO, MOSI> Spi<$SPIX, (SCK, MISO, MOSI)> {
7474
/// Configures the SPI peripheral to operate in full duplex master mode
75+
#[allow(unused_unsafe)] // Necessary for stm32l4r9
7576
pub fn $spiX(
7677
spi: $SPIX,
7778
pins: (SCK, MISO, MOSI),
@@ -189,6 +190,7 @@ macro_rules! hal {
189190
}
190191

191192
/// Change the baud rate of the SPI
193+
#[allow(unused_unsafe)] // Necessary for stm32l4r9
192194
pub fn reclock(&mut self, freq: Hertz, clocks: Clocks) {
193195
self.spi.cr1.modify(|_, w| w.spe().clear_bit());
194196
self.spi.cr1.modify(|_, w| unsafe {

src/time.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ impl MonoTimer {
5151
/// Returns an `Instant` corresponding to "now"
5252
pub fn now(&self) -> Instant {
5353
Instant {
54-
now: DWT::get_cycle_count(),
54+
now: DWT::cycle_count(),
5555
}
5656
}
5757
}
@@ -65,6 +65,6 @@ pub struct Instant {
6565
impl Instant {
6666
/// Ticks elapsed since the `Instant` was created
6767
pub fn elapsed(&self) -> u32 {
68-
DWT::get_cycle_count().wrapping_sub(self.now)
68+
DWT::cycle_count().wrapping_sub(self.now)
6969
}
7070
}

0 commit comments

Comments
 (0)