Skip to content

Commit

Permalink
First public release
Browse files Browse the repository at this point in the history
  • Loading branch information
valff committed Sep 20, 2019
1 parent c237d99 commit 6e70e3d
Show file tree
Hide file tree
Showing 30 changed files with 343 additions and 153 deletions.
31 changes: 19 additions & 12 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,13 @@ members = [

[package]
name = "drone-stm32-map"
version = "0.9.0"
version = "0.10.0"
authors = ["Valentine Valyaeff <[email protected]>"]
edition = "2018"
exclude = ["/svd_files"]
repository = "https://github.com/drone-os/drone-stm32-map"
homepage = "https://www.drone-os.com/"
documentation = "https://docs.rs/drone-stm32-map/0.10.0"
readme = "README.md"
license = "MIT OR Apache-2.0"
keywords = [
Expand Down Expand Up @@ -236,54 +239,58 @@ stm32l4s9 = [
]

[dependencies.drone-cortex-m]
version = "0.9.0"
version = "0.10.0"
path = "../drone-cortex-m"

[dependencies.drone-stm32-map-pieces]
version = "=0.9.0"
version = "=0.10.0"
path = "src/pieces"

[dependencies.drone-stm32-map-periph-adc]
version = "=0.9.0"
version = "=0.10.0"
path = "src/periph/adc"
optional = true

[dependencies.drone-stm32-map-periph-dma]
version = "=0.9.0"
version = "=0.10.0"
path = "src/periph/dma"
optional = true

[dependencies.drone-stm32-map-periph-exti]
version = "=0.9.0"
version = "=0.10.0"
path = "src/periph/exti"
optional = true

[dependencies.drone-stm32-map-periph-gpio]
version = "=0.9.0"
version = "=0.10.0"
path = "src/periph/gpio"
optional = true

[dependencies.drone-stm32-map-periph-i2c]
version = "=0.9.0"
version = "=0.10.0"
path = "src/periph/i2c"
optional = true

[dependencies.drone-stm32-map-periph-rtc]
version = "=0.9.0"
version = "=0.10.0"
path = "src/periph/rtc"
optional = true

[dependencies.drone-stm32-map-periph-spi]
version = "=0.9.0"
version = "=0.10.0"
path = "src/periph/spi"
optional = true

[dependencies.drone-stm32-map-periph-tim]
version = "=0.9.0"
version = "=0.10.0"
path = "src/periph/tim"
optional = true

[dependencies.drone-stm32-map-periph-uart]
version = "=0.9.0"
version = "=0.10.0"
path = "src/periph/uart"
optional = true

[package.metadata.docs.rs]
default-target = "thumbv7em-none-eabihf"
features = ["stm32l4s9"]
42 changes: 41 additions & 1 deletion Justfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
build_target := 'thumbv7em-none-eabihf'
features := 'stm32l4s7'
features := 'stm32l4s9'

# Install dependencies
deps:
Expand All @@ -20,6 +20,8 @@ lint:

# Check each feature
check-all:
rustup target add thumbv7m-none-eabi
rustup target add thumbv7em-none-eabihf
cargo check --package drone-stm32-map --features stm32f100 --target thumbv7m-none-eabi
cargo check --package drone-stm32-map --features stm32f101 --target thumbv7m-none-eabi
cargo check --package drone-stm32-map --features stm32f102 --target thumbv7m-none-eabi
Expand Down Expand Up @@ -50,29 +52,67 @@ doc-open: doc
readme:
cargo readme -o README.md

# Bump crate versions
version-bump version drone-core-version drone-cortex-m-version:
sed -i 's/\(docs\.rs\/drone-stm32-map\/\)[0-9]\+\(\.[0-9]\+\)\+/\1{{version}}/' \
Cargo.toml src/lib.rs
sed -i '/\[.*\]/h;/version = ".*"/{x;s/\[package\]/version = "{{version}}"/;t;x}' \
Cargo.toml src/pieces/*/Cargo.toml src/pieces/Cargo.toml src/periph/*/Cargo.toml svd/Cargo.toml
sed -i '/\[.*\]/h;/version = "=.*"/{x;s/\[.*drone-stm32-map-.*\]/version = "={{version}}"/;t;x}' \
Cargo.toml src/pieces/*/Cargo.toml src/pieces/Cargo.toml src/periph/*/Cargo.toml
sed -i '/\[.*\]/h;/version = ".*"/{x;s/\[.*drone-core\]/version = "{{drone-core-version}}"/;t;x}' \
Cargo.toml src/pieces/*/Cargo.toml src/pieces/Cargo.toml src/periph/*/Cargo.toml
sed -i '/\[.*\]/h;/version = ".*"/{x;s/\[.*drone-cortex-m\]/version = "{{drone-cortex-m-version}}"/;t;x}' \
Cargo.toml src/pieces/*/Cargo.toml src/pieces/Cargo.toml src/periph/*/Cargo.toml
sed -i 's/\(drone-stm32-map.*\)version = "[^"]\+"/\1version = "{{version}}"/' \
src/lib.rs

# Publish to crates.io
publish:
cd svd && cargo publish
sleep 5
cd src/pieces/1 && cargo publish --target {{build_target}} --features "{{features}}"
sleep 5
cd src/pieces/2 && cargo publish --target {{build_target}} --features "{{features}}"
sleep 5
cd src/pieces/3 && cargo publish --target {{build_target}} --features "{{features}}"
sleep 5
cd src/pieces/4 && cargo publish --target {{build_target}} --features "{{features}}"
sleep 5
cd src/pieces/5 && cargo publish --target {{build_target}} --features "{{features}}"
sleep 5
cd src/pieces/6 && cargo publish --target {{build_target}} --features "{{features}}"
sleep 5
cd src/pieces/7 && cargo publish --target {{build_target}} --features "{{features}}"
sleep 5
cd src/pieces/8 && cargo publish --target {{build_target}} --features "{{features}}"
sleep 5
cd src/pieces/9 && cargo publish --target {{build_target}} --features "{{features}}"
sleep 5
cd src/pieces/10 && cargo publish --target {{build_target}} --features "{{features}}"
sleep 5
cd src/pieces/11 && cargo publish --target {{build_target}} --features "{{features}}"
sleep 5
cd src/pieces/12 && cargo publish --target {{build_target}} --features "{{features}}"
sleep 5
cd src/pieces && cargo publish --target {{build_target}} --features "{{features}}"
sleep 5
cd src/periph/adc && cargo publish --target {{build_target}} --features "{{features}}"
sleep 5
cd src/periph/dma && cargo publish --target {{build_target}} --features "{{features}}"
sleep 5
cd src/periph/exti && cargo publish --target {{build_target}} --features "{{features}}"
sleep 5
cd src/periph/gpio && cargo publish --target {{build_target}} --features "{{features}}"
sleep 5
cd src/periph/i2c && cargo publish --target {{build_target}} --features "{{features}}"
sleep 5
cd src/periph/rtc && cargo publish --target {{build_target}} --features "{{features}}"
sleep 5
cd src/periph/spi && cargo publish --target {{build_target}} --features "{{features}}"
sleep 5
cd src/periph/tim && cargo publish --target {{build_target}} --features "{{features}}"
sleep 5
cd src/periph/uart && cargo publish --target {{build_target}} --features "{{features}}"
sleep 5
cargo publish --target {{build_target}} --features "{{features}}"
49 changes: 32 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,23 @@
[![Crates.io](https://img.shields.io/crates/v/drone-stm32-map.svg)](https://crates.io/crates/drone-stm32-map)
[![crates.io](https://img.shields.io/crates/v/drone-stm32-map.svg)](https://crates.io/crates/drone-stm32-map)
[![docs.rs](https://docs.rs/drone-stm32-map/badge.svg)](https://docs.rs/drone-stm32-map)
![maintenance](https://img.shields.io/badge/maintenance-actively--developed-brightgreen.svg)

# drone-stm32-map

STM32 peripheral mappings for Drone, an Embedded Operating System.

Supported devices:
This crate uses
[CMSIS-SVD](https://arm-software.github.io/CMSIS_5/SVD/html/index.html)
files provided by [STMicroelectronics](https://www.st.com/) to automatically
generate Drone register and interrupt bindings. However only the
corresponding Reference Manual is the single source of truth. A difference
between this crate bindings and the Reference Manual is considered a
bug. Fixing such a bug is *not a breaking change*.

This crate re-exports the contents of [`drone_cortex_m::map`] module and is
a drop-in replacement for it.

## Supported Devices

| Device name / Cargo feature | Core name | Reference manual |
|-------------|-----------------------|--------------------------------------------------------------------------|
Expand All @@ -28,23 +41,25 @@ Supported devices:
**NOTE** Exactly one cargo feature should be selected based on the device
model.

This crate uses
[CMSIS-SVD](https://arm-software.github.io/CMSIS_5/SVD/html/index.html)
files provided by [STMicroelectronics](https://www.st.com/) to automatically
generate Drone register and interrupt bindings. However only the
corresponding Reference Manual is the single source of truth. A difference
between this crate bindings and the Reference Manual is considered a
bug. Fixing such a bug is *not a breaking change*.
## Documentation

- [Drone Book](https://book.drone-os.com/)
- [API documentation](https://docs.rs/drone-stm32-map/0.10.0)

The API documentation intentionally skips auto-generated [`reg`] and [`thr`]
bindings. Otherwise it would use several gigabytes of space and would be
very slow to render in a browser. One should refer to the Reference Manual
instead. And to get an idea of what the API looks like on the Drone side,
look at the [`drone_cortex_m::map`] module documentation.

## Usage

[API documentation](https://docs.rs/crate/drone-stm32-map) for this crate
intentionally skips auto-generated [`reg`] and [`thr`] bindings. Otherwise
it would use several gigabytes of space and would be very slow to render in
a browser. One should refer to the Reference Manual instead. And to get an
idea of what the API looks like on the Drone side, look to the
[`drone_cortex_m::map`] module documentation.
Place the following to the Cargo.toml:

This crate re-exports contents of [`drone_cortex_m::map`] module and is a
drop-in replacement for it.
```toml
[dependencies]
drone-stm32-map = { version = "0.10.0", features = [...] }
```

## License

Expand Down
4 changes: 3 additions & 1 deletion README.tpl
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
[![Crates.io](https://img.shields.io/crates/v/{{crate}}.svg)](https://crates.io/crates/{{crate}})
[![crates.io](https://img.shields.io/crates/v/{{crate}}.svg)](https://crates.io/crates/{{crate}})
[![docs.rs](https://docs.rs/{{crate}}/badge.svg)](https://docs.rs/{{crate}})
![maintenance](https://img.shields.io/badge/maintenance-actively--developed-brightgreen.svg)

# {{crate}}

Expand Down
2 changes: 1 addition & 1 deletion rust-toolchain
Original file line number Diff line number Diff line change
@@ -1 +1 @@
nightly-2019-08-26
nightly-2019-09-13
45 changes: 29 additions & 16 deletions src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,17 @@
//! STM32 peripheral mappings for Drone, an Embedded Operating System.
//!
//! Supported devices:
//! This crate uses
//! [CMSIS-SVD](https://arm-software.github.io/CMSIS_5/SVD/html/index.html)
//! files provided by [STMicroelectronics](https://www.st.com/) to automatically
//! generate Drone register and interrupt bindings. However only the
//! corresponding Reference Manual is the single source of truth. A difference
//! between this crate bindings and the Reference Manual is considered a
//! bug. Fixing such a bug is *not a breaking change*.
//!
//! This crate re-exports the contents of [`drone_cortex_m::map`] module and is
//! a drop-in replacement for it.
//!
//! # Supported Devices
//!
//! | Device name / Cargo feature | Core name | Reference manual |
//! |-------------|-----------------------|--------------------------------------------------------------------------|
Expand All @@ -24,23 +35,25 @@
//! **NOTE** Exactly one cargo feature should be selected based on the device
//! model.
//!
//! This crate uses
//! [CMSIS-SVD](https://arm-software.github.io/CMSIS_5/SVD/html/index.html)
//! files provided by [STMicroelectronics](https://www.st.com/) to automatically
//! generate Drone register and interrupt bindings. However only the
//! corresponding Reference Manual is the single source of truth. A difference
//! between this crate bindings and the Reference Manual is considered a
//! bug. Fixing such a bug is *not a breaking change*.
//! # Documentation
//!
//! - [Drone Book](https://book.drone-os.com/)
//! - [API documentation](https://docs.rs/drone-stm32-map/0.10.0)
//!
//! The API documentation intentionally skips auto-generated [`reg`] and [`thr`]
//! bindings. Otherwise it would use several gigabytes of space and would be
//! very slow to render in a browser. One should refer to the Reference Manual
//! instead. And to get an idea of what the API looks like on the Drone side,
//! look at the [`drone_cortex_m::map`] module documentation.
//!
//! # Usage
//!
//! [API documentation](https://docs.rs/crate/drone-stm32-map) for this crate
//! intentionally skips auto-generated [`reg`] and [`thr`] bindings. Otherwise
//! it would use several gigabytes of space and would be very slow to render in
//! a browser. One should refer to the Reference Manual instead. And to get an
//! idea of what the API looks like on the Drone side, look to the
//! [`drone_cortex_m::map`] module documentation.
//! Place the following to the Cargo.toml:
//!
//! This crate re-exports contents of [`drone_cortex_m::map`] module and is a
//! drop-in replacement for it.
//! ```toml
//! [dependencies]
//! drone-stm32-map = { version = "0.10.0", features = [...] }
//! ```

#![deny(elided_lifetimes_in_paths)]
#![warn(missing_docs)]
Expand Down
13 changes: 9 additions & 4 deletions src/periph/adc/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
[package]
name = "drone-stm32-map-periph-adc"
version = "0.9.0"
version = "0.10.0"
authors = ["Valentine Valyaeff <[email protected]>"]
edition = "2018"
repository = "https://github.com/drone-os/drone-stm32-map"
homepage = "https://www.drone-os.com/"
license = "MIT OR Apache-2.0"
description = """
STM32 peripheral mappings for Drone, an Embedded Operating System.
Expand Down Expand Up @@ -32,13 +33,17 @@ stm32l4s7 = ["drone-cortex-m/cortex_m4f_r0p1", "drone-stm32-map-pieces/stm32l4s7
stm32l4s9 = ["drone-cortex-m/cortex_m4f_r0p1", "drone-stm32-map-pieces/stm32l4s9"]

[dependencies.drone-core]
version = "0.9.0"
version = "0.10.0"
path = "../../../../drone-core"

[dependencies.drone-cortex-m]
version = "0.9.0"
version = "0.10.0"
path = "../../../../drone-cortex-m"

[dependencies.drone-stm32-map-pieces]
version = "=0.9.0"
version = "=0.10.0"
path = "../../pieces"

[package.metadata.docs.rs]
default-target = "thumbv7em-none-eabihf"
features = ["stm32l4s9"]
13 changes: 9 additions & 4 deletions src/periph/dma/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
[package]
name = "drone-stm32-map-periph-dma"
version = "0.9.0"
version = "0.10.0"
authors = ["Valentine Valyaeff <[email protected]>"]
edition = "2018"
repository = "https://github.com/drone-os/drone-stm32-map"
homepage = "https://www.drone-os.com/"
license = "MIT OR Apache-2.0"
description = """
STM32 peripheral mappings for Drone, an Embedded Operating System.
Expand Down Expand Up @@ -32,13 +33,17 @@ stm32l4s7 = ["drone-cortex-m/cortex_m4f_r0p1", "drone-stm32-map-pieces/stm32l4s7
stm32l4s9 = ["drone-cortex-m/cortex_m4f_r0p1", "drone-stm32-map-pieces/stm32l4s9"]

[dependencies.drone-core]
version = "0.9.0"
version = "0.10.0"
path = "../../../../drone-core"

[dependencies.drone-cortex-m]
version = "0.9.0"
version = "0.10.0"
path = "../../../../drone-cortex-m"

[dependencies.drone-stm32-map-pieces]
version = "=0.9.0"
version = "=0.10.0"
path = "../../pieces"

[package.metadata.docs.rs]
default-target = "thumbv7em-none-eabihf"
features = ["stm32l4s9"]
Loading

0 comments on commit 6e70e3d

Please sign in to comment.