Skip to content

Commit

Permalink
Prepare releasing 0.7 (#305)
Browse files Browse the repository at this point in the history
* Do not warn on unnecessary unsafe

* Use DWT::cycle_count() instead of deprecated get_cycle_count()

* Prepare releasing 0.7
  • Loading branch information
samueltardieu authored Apr 7, 2022
1 parent 46006b9 commit a1baa2f
Show file tree
Hide file tree
Showing 5 changed files with 54 additions and 7 deletions.
51 changes: 48 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,57 @@
All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/).

## [Unreleased]
## [v0.7.0] - 2021-04-04

## Changed
### Added

- Add delay implementation based on `cortex_m::asm::delay`.
- Implement `RngCore` and `CryptoRng` for the hardware RNG.
- Support analog to digital converters (ADC).
- Support SPI slave mode.
- Add DMA and interrupt support for SPI and ADC peripherals.
- Add support for measuring Vref, Vbat and temperature.
- Add alternate function 0 to GPIO.
- Add preliminary bxCAN support.
- Add more GPIO combinations for I2C and PWM peripherals.
- Add wakeup clock sources to RTC config.
- Support RTC domain backup registers.
- Support I2C on stm32l4x3 devices.
- Support I2C3 peripheral on stm32l4x6 devices.
- Experimental support for the Synopsis USB library.
- Experimental support for USB OTG FS for stm32l4x5 and stm32l4x6 devices.
- Support stm32l4r9 devices.

### Changed

- Use device-specific features rather than by-peripheral features.
- Use `fugit` duration nd rate units instead of custom
- Use const-generics for GPIO (require Rust 1.51)
- Import I2C implementation from `stm32h7xx-hal` crate.
- Use a `Config` struct for initializing I2C peripherals.
- Check that the clock requested for the low-power timer is enabled.
- Take `clocks` argument by value when setting up low-power timer.
- Use sane low-power timer defaults (LSI, no prescaler).
- Make `LowPowerTimer<_>::set_autoreload()` public.
- Enable SPI2 for all stm32l4x2 devices as some of them have it.
- Target hardfp by default since stm32l4 cores are Cortex-M4F.
- Require typed input when converting from milliseconds to hertz.
- Rework alternate function typestates.
- Use MSI as default/fallback clock source for SYSCLK.
- Use specialized PAC for stm32l412 and stm32l422 devices.
- Add `toggeable` trait to GPIO pins.
- Update `stm32l4` dependency.

### Fixed

- Fix TIM1 PWM frequency computation.
- Fix TIM5 counter width.
- Fix PSC computation off-by-one error.
- Change wait states values according to datasheet.
- Fix incorrect I2C2 on PC0/PC1 on stm32l4x3 devices.
- Swap QSPI pins and remove conflicting/wrong implementations.
- Add power on GPIOG pins.
- Support 0 byte writes on I2C.

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

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

- Initial release

[Unreleased]: https://github.com/stm32-rs/stm32l4xx-hal/compare/v0.6.0...HEAD
[v0.7.0]: https://github.com/stm32-rs/stm32l4xx-hal/compare/v0.6.0...v0.7.0
[v0.6.0]: https://github.com/stm32-rs/stm32l4xx-hal/compare/v0.5.0...v0.6.0
[v0.5.0]: https://github.com/stm32-rs/stm32l4xx-hal/compare/v0.4.0...v0.5.0
[v0.4.0]: https://github.com/stm32-rs/stm32l4xx-hal/compare/v0.3.6...v0.4.0
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "stm32l4xx-hal"
version = "0.6.0"
version = "0.7.0"
authors = ["Scott Mabin <[email protected]>"]
description = "Hardware abstraction layer for the stm32l4xx chips"
keywords = ["no-std", "stm32l4xx", "stm32l4", "embedded", "embedded-hal"]
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ _formerly [MabezDev/stm32l4xx-hal](https://github.com/mabezdev/stm32l4xx-hal)_

## About

- Minimum rustc version 1.31
- Minimum rustc version 1.51

## License

Expand Down
2 changes: 2 additions & 0 deletions src/spi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ macro_rules! hal {
$(
impl<SCK, MISO, MOSI> Spi<$SPIX, (SCK, MISO, MOSI)> {
/// Configures the SPI peripheral to operate in full duplex master mode
#[allow(unused_unsafe)] // Necessary for stm32l4r9
pub fn $spiX(
spi: $SPIX,
pins: (SCK, MISO, MOSI),
Expand Down Expand Up @@ -189,6 +190,7 @@ macro_rules! hal {
}

/// Change the baud rate of the SPI
#[allow(unused_unsafe)] // Necessary for stm32l4r9
pub fn reclock(&mut self, freq: Hertz, clocks: Clocks) {
self.spi.cr1.modify(|_, w| w.spe().clear_bit());
self.spi.cr1.modify(|_, w| unsafe {
Expand Down
4 changes: 2 additions & 2 deletions src/time.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ impl MonoTimer {
/// Returns an `Instant` corresponding to "now"
pub fn now(&self) -> Instant {
Instant {
now: DWT::get_cycle_count(),
now: DWT::cycle_count(),
}
}
}
Expand All @@ -65,6 +65,6 @@ pub struct Instant {
impl Instant {
/// Ticks elapsed since the `Instant` was created
pub fn elapsed(&self) -> u32 {
DWT::get_cycle_count().wrapping_sub(self.now)
DWT::cycle_count().wrapping_sub(self.now)
}
}

0 comments on commit a1baa2f

Please sign in to comment.