Merge #6
6: Updated SVD file handling and README r=robamu a=robamu SVD base file is now created using the svdtools package and a YAML file. Update README with usage information as well. Adds new fields for the peripheral clock enable register as well Co-authored-by: Robin Mueller <robin.mueller.m@gmail.com>
This commit is contained in:
commit
6308acc0b5
@ -12,6 +12,11 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
|
|||||||
|
|
||||||
- Relicensed under dual Apache-2.0 / MIT license
|
- Relicensed under dual Apache-2.0 / MIT license
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
|
||||||
|
- SVD file handling improved and new fields added for the peripheral
|
||||||
|
clock enable register
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
|
|
||||||
- Helper script to automate all steps for PAC generation
|
- Helper script to automate all steps for PAC generation
|
||||||
|
28
README.md
28
README.md
@ -8,3 +8,31 @@ This repository contains the Peripheral Access Crate (PAC) for
|
|||||||
Voragos VA108xx series of Cortex-M0 based microcontrollers.
|
Voragos VA108xx series of Cortex-M0 based microcontrollers.
|
||||||
|
|
||||||
The crate was generated using [`svd2rust`](https://github.com/rust-embedded/svd2rust).
|
The crate was generated using [`svd2rust`](https://github.com/rust-embedded/svd2rust).
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
|
||||||
|
To use this crate, add this to your `Cargo.toml`
|
||||||
|
|
||||||
|
```toml
|
||||||
|
[dependencies.va108xx]
|
||||||
|
version = "0.1.0"
|
||||||
|
features = ["rt"]
|
||||||
|
```
|
||||||
|
|
||||||
|
The `rt` feature is optional and recommended. It brings in support for `cortex-m-rt`.
|
||||||
|
|
||||||
|
For full details on the autgenerated API, please see the
|
||||||
|
[svd2rust documentation](https://docs.rs/svd2rust/0.19.0/svd2rust/#peripheral-api).
|
||||||
|
|
||||||
|
## Regenerating the PAC
|
||||||
|
|
||||||
|
The base file used by `svd2rust` is generated using the `svdtools` package and a
|
||||||
|
YAML patch file. You can create the patched file by running this command after installing
|
||||||
|
the Python [`svdtools` package](https://github.com/stm32-rs/svdtools):
|
||||||
|
|
||||||
|
```sh
|
||||||
|
cd svd
|
||||||
|
svd patch va108xx-patch.yml
|
||||||
|
```
|
||||||
|
|
||||||
|
After that, you can regenerate the PAC by running the `gen-helper.sh` helper script.
|
||||||
|
@ -15,7 +15,7 @@ if [ -x "$(${svd2rust_bin} --version)" ]; then
|
|||||||
"Install it with cargo install svd2rust"
|
"Install it with cargo install svd2rust"
|
||||||
exit
|
exit
|
||||||
fi
|
fi
|
||||||
${svd2rust_bin} -i va108xx.svd
|
${svd2rust_bin} -i svd/va108xx-base.svd.patched
|
||||||
rm -rf src
|
rm -rf src
|
||||||
form -i lib.rs -o src/ && rm lib.rs
|
form -i lib.rs -o src/ && rm lib.rs
|
||||||
cargo fmt
|
cargo fmt
|
||||||
|
2713
svd/va108xx-base.svd.patched
Normal file
2713
svd/va108xx-base.svd.patched
Normal file
File diff suppressed because it is too large
Load Diff
2743
svd/va108xx-orig.svd
Normal file
2743
svd/va108xx-orig.svd
Normal file
File diff suppressed because it is too large
Load Diff
59
svd/va108xx-patch.yml
Normal file
59
svd/va108xx-patch.yml
Normal file
@ -0,0 +1,59 @@
|
|||||||
|
_svd: va108xx-base.svd
|
||||||
|
|
||||||
|
SYSCONFIG:
|
||||||
|
PERIPHERAL_CLK_ENABLE:
|
||||||
|
_add:
|
||||||
|
PORTA:
|
||||||
|
description: Enable PORTA clock
|
||||||
|
bitOffset: 0
|
||||||
|
bitWidth: 1
|
||||||
|
PORTB:
|
||||||
|
description: Enable PORTB clock
|
||||||
|
bitOffset: 1
|
||||||
|
bitWidth: 1
|
||||||
|
SPI_0:
|
||||||
|
description: Enable SPI[0] clock
|
||||||
|
bitOffset: 4
|
||||||
|
bitWidth: 1
|
||||||
|
SPI_1:
|
||||||
|
description: Enable SPI[1] clock
|
||||||
|
bitOffset: 5
|
||||||
|
bitWidth: 1
|
||||||
|
SPI_2:
|
||||||
|
description: Enable SPI[2] clock
|
||||||
|
bitOffset: 6
|
||||||
|
bitWidth: 1
|
||||||
|
UART_0:
|
||||||
|
description: Enable UART[0] clock
|
||||||
|
bitOffset: 8
|
||||||
|
bitWidth: 1
|
||||||
|
UART_1:
|
||||||
|
description: Enable UART[1] clock
|
||||||
|
bitOffset: 9
|
||||||
|
bitWidth: 1
|
||||||
|
I2C_0:
|
||||||
|
description: Enable I2C[0] clock
|
||||||
|
bitOffset: 16
|
||||||
|
bitWidth: 1
|
||||||
|
I2C_1:
|
||||||
|
description: Enable I2C[1] clock
|
||||||
|
bitOffset: 17
|
||||||
|
bitWidth: 1
|
||||||
|
IRQSEL:
|
||||||
|
description: Enable IRQ selector clock
|
||||||
|
bitOffset: 21
|
||||||
|
bitWidth: 1
|
||||||
|
IOCONFIG:
|
||||||
|
description: Enable IO Configuration block clock
|
||||||
|
bitOffset: 22
|
||||||
|
bitWidth: 1
|
||||||
|
UTILITY:
|
||||||
|
description: Enable utility clock
|
||||||
|
bitOffset: 23
|
||||||
|
bitWidth: 1
|
||||||
|
GPIO:
|
||||||
|
description: Enable GPIO clock
|
||||||
|
bitOffset: 24
|
||||||
|
bitWidth: 1
|
||||||
|
|
||||||
|
|
Reference in New Issue
Block a user