Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Common 0.18 #508

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 33 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,24 @@ and this project adheres to [Semantic Versioning](http://semver.org/).

## [Unreleased]

## [v0.18.0] - 2021-04-17

### Added

- RegisterBlock trait (like `Deref`, but don't require `self` instance,
only for memory fixed peripherals)

- Support for registers with alternateGroup

- New `-m` switch generates a `mod.rs` file instead of `lib.rs`, which can
be used as a module inside a crate without further modification.

- ESP32/XtensaLX6 support.

- Field array support.

- Add repr(transparent) to Reg struct

- Generated crates now contain the git commit hash and date of svd2rust
compilation.

Expand Down Expand Up @@ -41,8 +54,22 @@ and this project adheres to [Semantic Versioning](http://semver.org/).

- [breaking-change] make `write_with_zero` method `unsafe` because the way it is

- Use complete path for cluster names

- Rename some generated variables.

- [breaking-change] Publishes the register spec zero-sized type and move all relevant register traits to that struct.

- [breaking-change] Removes the extra type parameter on Reg, making the register spec the sole authority on the shape of the register.

- Wrap register reader/writer and field readers in newtype wrappers, which significantly improves the documentation output.

- Improve documentation on generated registers and fields

- [breaking-change] remove `Variant<U, ENUM_A>`, use `Option<ENUM_A>` instead

- [breaking-change] Update `svd-parser` to `0.10`

- split out register size type (`RawType`) from `ResetValue` trait

- `anyhow` crate is used for error handling
Expand All @@ -61,6 +88,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
interrupt number handling. The minimum supported `cortex-m` version is now
**0.7** and `bare-metal` is not a dependency anymore.

### Removed

- Generated use of the register type aliases in favor of directly referencing `Reg<REGISTER_SPEC>`

## [v0.17.0] - 2019-12-31

### Fixed
Expand Down Expand Up @@ -555,7 +586,8 @@ peripheral.register.write(|w| w.field().set());

- Initial version of the `svd2rust` tool

[Unreleased]: https://github.com/rust-embedded/svd2rust/compare/v0.17.0...HEAD
[Unreleased]: https://github.com/rust-embedded/svd2rust/compare/v0.18.0...HEAD
[v0.18.0]: https://github.com/rust-embedded/svd2rust/compare/v0.17.0...v0.18.0
[v0.17.0]: https://github.com/rust-embedded/svd2rust/compare/v0.16.1...v0.17.0
[v0.16.1]: https://github.com/rust-embedded/svd2rust/compare/v0.16.0...v0.16.1
[v0.16.0]: https://github.com/rust-embedded/svd2rust/compare/v0.15.2...v0.16.0
Expand Down
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ keywords = [
license = "MIT OR Apache-2.0"
name = "svd2rust"
repository = "https://github.com/rust-embedded/svd2rust/"
version = "0.17.0"
version = "0.18.0"
readme = "README.md"

[[bin]]
Expand All @@ -43,7 +43,7 @@ anyhow = "1.0"
thiserror = "1.0"

[dependencies.svd-parser]
version = "0.10"
version = "0.10.1"
features = ["derive-from"]

[dependencies.syn]
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ This project is developed and maintained by the [Tools team][team].

## Minimum Supported Rust Version (MSRV)

The **generated code** is guaranteed to compile on stable Rust 1.37.0 and up.
The **generated code** is guaranteed to compile on stable Rust 1.40.0 and up.

If you encounter compilation errors on any stable version newer than 1.37.0, please open an issue.
If you encounter compilation errors on any stable version newer than 1.40.0, please open an issue.

# Testing Locally

Expand Down
9 changes: 9 additions & 0 deletions src/generate/generic.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
use core::marker;

///This trait allows to get raw pointer on derived peripheral
///as block of registers of base peripheral (like unsafe `Deref`)
pub trait RegisterBlock {
///Type of RegisterBlock of base peripheral
type RB;
///Take peripheral address as raw pointer
fn rb() -> *const Self::RB;
}

/// Raw register type
pub trait RegisterSpec {
/// Raw register type (`u8`, `u16`, `u32`, ...).
Expand Down
Loading