Skip to content

Commit

Permalink
Merge pull request #179 from Sh3Rm4n/v0.6.0
Browse files Browse the repository at this point in the history
Release v0.6.0
  • Loading branch information
Sh3Rm4n committed Dec 10, 2020
2 parents fc5c0a6 + 2e7445a commit 7d9954e
Show file tree
Hide file tree
Showing 17 changed files with 94 additions and 63 deletions.
9 changes: 9 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -138,3 +138,12 @@ jobs:
profile: minimal
components: rustfmt
- run: cd codegen && cargo check

markdown-lint:
name: Markdown Lint
runs-on: ubuntu-latest
steps:
- uses: nosborn/[email protected]
with:
files: .
ignore_files: "target/"
2 changes: 2 additions & 0 deletions .markdownlint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
md024: false
md014: false
25 changes: 16 additions & 9 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/).

## [Unreleased]

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

### Added

- Support for 16-bit words with SPI ([#107](https://github.com/stm32-rs/stm32f3xx-hal/pull/107))
Expand Down Expand Up @@ -42,7 +44,6 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
- Introduced auto-generated GPIO mappings based on the STM32CubeMX database
([#129](https://github.com/stm32-rs/stm32f3xx-hal/pull/129))


### Fixed

- Fixed [#151][] not being able to generate 72 MHz HCLK for stm32f303xc devices
Expand All @@ -62,8 +63,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
not mean, that we guarantee any MSRV policy. It is rather for documentation
purposes and if a new useful feature arises, we will increase the MSRV.
([#170](https://github.com/stm32-rs/stm32f3xx-hal/pull/170))
- Removed I2C2 support for `stm32f303x6`, `stm32f303x8` and `stm32f328` targets. ([#164](https://github.com/stm32-rs/stm32f3xx-hal/pull/164))
- `I2c::i2c1` and `I2c::i2c2` functions are renamed to `I2c::new`. ([#164](https://github.com/stm32-rs/stm32f3xx-hal/pull/164))
- Removed I2C2 support for `stm32f303x6`, `stm32f303x8` and `stm32f328` targets.
([#164](https://github.com/stm32-rs/stm32f3xx-hal/pull/164))
- `I2c::i2c1` and `I2c::i2c2` functions are renamed to `I2c::new`.
([#164](https://github.com/stm32-rs/stm32f3xx-hal/pull/164))

## [v0.5.0] - 2020-07-21

Expand All @@ -83,6 +86,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
- The system clock calculation is more fine grained now. ([#67](https://github.com/stm32-rs/stm32f3xx-hal/pull/67))
Now the system clock can be some value, like 14 MHz, which can not a
be represented as a multiple of the oscillator clock:

```rust
let clocks = rcc
.cfgr
Expand All @@ -95,11 +99,11 @@ let clocks = rcc
.use_hse(32.mhz())
.sysclk(72.mhz())
```

This is possible through utilizing the divider, which can divide the
external oscillator clock on most devices. Some devices have even the
possibility to divide the internal oscillator clock.


### Breaking changes

- The feature gate requires you to select a subvariant if possible. ([#75](https://github.com/stm32-rs/stm32f3xx-hal/pull/75))
Expand Down Expand Up @@ -157,15 +161,17 @@ let clocks = rcc
- This allows using 72 MHz `sysclk` on the `stm32f303`
- Analog gpio trait ([#33](https://github.com/stm32-rs/stm32f3xx-hal/pull/33))
- Add PWM Channels ([#34](https://github.com/stm32-rs/stm32f3xx-hal/pull/34))
- SPI embedded hal modes are now public ([#35](https://github.com/stm32-rs/stm32f3xx-hal/pull/18))
- SPI embedded hal modes are now public
([#35](https://github.com/stm32-rs/stm32f3xx-hal/pull/18))

### Breaking changes

- Alternate gpio functions are now **only** made available for devices, which have them.
([#21](https://github.com/stm32-rs/stm32f3xx-hal/pull/21))
- Alternate gpio functions are now **only** made available for devices, which
have them. ([#21](https://github.com/stm32-rs/stm32f3xx-hal/pull/21))
- `stm32f303` is now split into `stm32f303xd` and `stm32f303xe` as they provide
different alternate gpio functions. `stm32f303` is still available.
- Bump `stm32f3` dependency to `0.9.0` ([#39](https://github.com/stm32-rs/stm32f3xx-hal/pull/39))
- Bump `stm32f3` dependency to `0.9.0`
([#39](https://github.com/stm32-rs/stm32f3xx-hal/pull/39))

### Fixed

Expand Down Expand Up @@ -250,7 +256,8 @@ let clocks = rcc

- Support `stm32f303` device

[Unreleased]: https://github.com/stm32-rs/stm32f3xx-hal/compare/v0.5.0...HEAD
[Unreleased]: https://github.com/stm32-rs/stm32f3xx-hal/compare/v0.6.0...HEAD
[v0.6.0]: https://github.com/stm32-rs/stm32f3xx-hal/compare/v0.5.0...v0.6.0
[v0.5.0]: https://github.com/stm32-rs/stm32f3xx-hal/compare/v0.4.3...v0.5.0
[v0.4.3]: https://github.com/stm32-rs/stm32f3xx-hal/compare/v0.4.2...v0.4.3
[v0.4.2]: https://github.com/stm32-rs/stm32f3xx-hal/compare/v0.4.1...v0.4.2
Expand Down
3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,10 @@ name = "stm32f3xx-hal"
readme = "README.md"
repository = "https://github.com/stm32-rs/stm32f3xx-hal"
documentation = "https://docs.rs/stm32f3xx-hal"
version = "0.5.0"
version = "0.6.0"
exclude = [
"codegen",
".markdownlint.yml"
]

[package.metadata.docs.rs]
Expand Down
90 changes: 50 additions & 40 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,16 @@ peripheral access API for the STMicro STM32F3 series microcontrollers. The
selection of the MCU is done by feature gates, typically specified by board
support crates. Currently supported configurations are:

* stm32f301 ✔️ YES!
* stm32f318 ✔️ YES!
* stm32f302 ✔️ YES!
* stm32f303 ✔️ YES!
* stm32f373 ✔️ YES!
* stm32f378 ✔️ YES!
* stm32f334 ✔️ YES!
* stm32f328 ✔️ YES!
* stm32f358 ✔️ YES!
* stm32f398 ✔️ YES!
* stm32f301
* stm32f318
* stm32f302
* stm32f303
* stm32f373
* stm32f378
* stm32f334
* stm32f328
* stm32f358
* stm32f398

The idea behind this crate is to gloss over the slight differences in the
various peripherals available on those MCUs so a HAL can be written for all
Expand Down Expand Up @@ -52,29 +52,30 @@ So you want to expand your call to `cargo` with `--features stm32f303xc`.*
[comment]: # (Any changes here should be mirrored in src/lib.rs)

Note: `x` denotes any character in [a-z]
* stm32f301xb
* stm32f301xc
* stm32f301xd
* stm32f301xe
* stm32f318
* stm32f302xb
* stm32f302xc
* stm32f302xd
* stm32f302xe
* stm32f302x6
* stm32f302x8
* stm32f303xb
* stm32f303xc
* stm32f303xd
* stm32f303xe
* stm32f303x6
* stm32f303x8
* stm32f373
* stm32f378
* stm32f334
* stm32f328
* stm32f358
* stm32f398

* stm32f301xb
* stm32f301xc
* stm32f301xd
* stm32f301xe
* stm32f318
* stm32f302xb
* stm32f302xc
* stm32f302xd
* stm32f302xe
* stm32f302x6
* stm32f302x8
* stm32f303xb
* stm32f303xc
* stm32f303xd
* stm32f303xe
* stm32f303x6
* stm32f303x8
* stm32f373
* stm32f378
* stm32f334
* stm32f328
* stm32f358
* stm32f398

### Background

Expand All @@ -95,21 +96,30 @@ expect it to do so.*

### Detailed steps to select the right chip

1. Get the full name of the chip you are using from your datasheet, user manual or other source.
1. Get the full name of the chip you are using from your datasheet, user manual
or other source.

_Example_:

*Example: We want to use the STM32F3Discovery kit.*
*The [Usermanual][] tells us it's using a STM32F303VC chip.*
We want to use the STM32F3Discovery kit.
The [Usermanual][] tells us it's using a STM32F303VC chip.

2. Find your chip as a feature in the list above.

*Example: Looking for the right feature for our STM32F303VC chip we first find
`stm32f301xb`. This is the wrong chip, as we're not looking for `f301` but for `f303`.*
_Example_:

*Looking further we find `stm32f303xc`. This matches STM32F303VC (note that VC → xc).*
Looking for the right feature for our STM32F303VC chip we first find
`stm32f301xb`. This is the wrong chip, as we're not looking for `f301` but
for `f303`.

Looking further we find `stm32f303xc`. This matches STM32F303VC
(note that VC → xc).

3. Add the chip name as a feature to your cargo call.

*Example: Using the STM32F303VC chip we run `cargo check --features stm32f303xc`.*
_Example_:

Using the STM32F303VC chip we run `cargo check --features stm32f303xc`.

[Usermanual]: https://www.st.com/content/ccc/resource/technical/document/user_manual/8a/56/97/63/8d/56/41/73/DM00063382.pdf/files/DM00063382.pdf/jcr:content/translations/en.DM00063382.pdf

Expand Down
4 changes: 2 additions & 2 deletions codegen/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Because by default cargo tries to use the `x86_64-unknown-linux-gnu` target,
when building `codegen`, due to what's specified in the `.cargo/config`, you
need to manually specify your host's target if it differs from that, e.g.:

```
```bash
$ cargo run --target x86_64-apple-darwin -- help
```

Expand All @@ -26,7 +26,7 @@ Running `codegen`'s `gpio` subcommand generates the `gpio!` macro
invocations at the end of `src/gpio.rs`. Re-generating those macro-invocations
is simply a matter of deleting the old ones and then executing:

```
```bash
$ cargo run -- gpio $cubemx_db_path >> ../src/gpio.rs
```

Expand Down
2 changes: 2 additions & 0 deletions examples/adc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

use panic_semihosting as _;

use cortex_m::asm;
use cortex_m_rt::entry;
use cortex_m_semihosting::hprintln;

Expand Down Expand Up @@ -55,5 +56,6 @@ fn main() -> ! {
loop {
let adc1_in1_data: u16 = adc1.read(&mut adc1_in1_pin).expect("Error reading adc1.");
hprintln!("PA0 reads {}", adc1_in1_data).ok();
asm::delay(2_000_000);
}
}
2 changes: 1 addition & 1 deletion examples/gpio_erased.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ fn main() -> ! {
loop {
for pin in pin_array.iter_mut() {
hprintln!("Value is {}", pin.is_high().unwrap()).unwrap();
asm::delay(1_000);
asm::delay(1_000_000);
}
}
}
2 changes: 1 addition & 1 deletion src/adc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
//! It can be built for the STM32F3Discovery running
//! `cargo build --example adc --features=stm32f303xc`
//!
//! [examples/adc.rs]: https://github.com/stm32-rs/stm32f3xx-hal/blob/v0.5.0/examples/adc.rs
//! [examples/adc.rs]: https://github.com/stm32-rs/stm32f3xx-hal/blob/v0.6.0/examples/adc.rs

use crate::{
gpio::Analog,
Expand Down
2 changes: 1 addition & 1 deletion src/can.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
//!
//! A usage example of the can peripheral can be found at [examples/can.rs]
//!
//! [examples/can.rs]: https://github.com/stm32-rs/stm32f3xx-hal/blob/v0.5.0/examples/can.rs
//! [examples/can.rs]: https://github.com/stm32-rs/stm32f3xx-hal/blob/v0.6.0/examples/can.rs

pub use embedded_hal_can::{self, Filter, Frame, Id, Receiver, Transmitter};

Expand Down
2 changes: 1 addition & 1 deletion src/dma.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
//!
//! An example how to use DMA for serial, can be found at [examples/serial_dma.rs]
//!
//! [examples/serial_dma.rs]: https://github.com/stm32-rs/stm32f3xx-hal/blob/v0.5.0/examples/serial_dma.rs
//! [examples/serial_dma.rs]: https://github.com/stm32-rs/stm32f3xx-hal/blob/v0.6.0/examples/serial_dma.rs

// To learn about most of the ideas implemented here, check out the DMA section
// of the Embedonomicon: https://docs.rust-embedded.org/embedonomicon/dma.html
Expand Down
4 changes: 2 additions & 2 deletions src/gpio.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
//!
//! [InputPin]: embedded_hal::digital::v2::InputPin
//! [OutputPin]: embedded_hal::digital::v2::OutputPin
//! [examples/toggle.rs]: https://github.com/stm32-rs/stm32f3xx-hal/blob/v0.5.0/examples/toggle.rs
//! [examples/toggle.rs]: https://github.com/stm32-rs/stm32f3xx-hal/blob/v0.6.0/examples/toggle.rs

use core::convert::Infallible;
use core::marker::PhantomData;
Expand Down Expand Up @@ -163,7 +163,7 @@ macro_rules! gpio {
///
/// See [examples/gpio_erased.rs] as an example.
///
/// [examples/gpio_erased.rs]: https://github.com/stm32-rs/stm32f3xx-hal/blob/v0.5.0/examples/gpio_erased.rs
/// [examples/gpio_erased.rs]: https://github.com/stm32-rs/stm32f3xx-hal/blob/v0.6.0/examples/gpio_erased.rs
pub struct PXx<MODE> {
i: u8,
gpio: Gpio,
Expand Down
2 changes: 1 addition & 1 deletion src/i2c.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//!
//! A usage example of the i2c peripheral can be found at [examples/i2c_scanner.rs]
//!
//! [examples/i2c_scanner.rs]: https://github.com/stm32-rs/stm32f3xx-hal/blob/v0.5.0/examples/i2c_scanner.rs
//! [examples/i2c_scanner.rs]: https://github.com/stm32-rs/stm32f3xx-hal/blob/v0.6.0/examples/i2c_scanner.rs

use core::convert::TryFrom;
use core::ops::Deref;
Expand Down
2 changes: 1 addition & 1 deletion src/pwm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@
A usage example can be found at [examples/pwm.rs]
[examples/pwm.rs]: https://github.com/stm32-rs/stm32f3xx-hal/blob/v0.5.0/examples/pwm.rs
[examples/pwm.rs]: https://github.com/stm32-rs/stm32f3xx-hal/blob/v0.6.0/examples/pwm.rs
*/

use crate::{
Expand Down
2 changes: 1 addition & 1 deletion src/spi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//!
//! A usage example of the can peripheral can be found at [examples/spi.rs]
//!
//! [examples/spi.rs]: https://github.com/stm32-rs/stm32f3xx-hal/blob/v0.5.0/examples/spi.rs
//! [examples/spi.rs]: https://github.com/stm32-rs/stm32f3xx-hal/blob/v0.6.0/examples/spi.rs

use core::ptr;

Expand Down
2 changes: 1 addition & 1 deletion src/usb.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
//!
//! See [examples/usb_serial.rs] for a usage example.
//!
//! [examples/usb_serial.rs]: https://github.com/stm32-rs/stm32f3xx-hal/blob/v0.5.0/examples/usb_serial.rs
//! [examples/usb_serial.rs]: https://github.com/stm32-rs/stm32f3xx-hal/blob/v0.6.0/examples/usb_serial.rs

use crate::pac::{RCC, USB};
use stm32_usbd::UsbPeripheral;
Expand Down
2 changes: 1 addition & 1 deletion src/watchdog.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//!
//! A usage example of the watchdog can be found at [examples/can.rs]
//!
//! [examples/can.rs]: https://github.com/stm32-rs/stm32f3xx-hal/blob/v0.5.0/examples/can.rs
//! [examples/can.rs]: https://github.com/stm32-rs/stm32f3xx-hal/blob/v0.6.0/examples/can.rs

use crate::hal::watchdog::{Watchdog, WatchdogEnable};

Expand Down

0 comments on commit 7d9954e

Please sign in to comment.