#register #peripheral #mmio #struct-fields

no-std peripherals

Microcontroller peripherals definition and ergonomic access

5 releases

0.1.1 May 27, 2021
0.1.0 May 25, 2021
0.0.3 May 10, 2021
0.0.2 May 6, 2021
0.0.1 May 6, 2021

#1882 in Embedded development

Download history 6/week @ 2024-02-23 10/week @ 2024-03-01 6/week @ 2024-03-08 3/week @ 2024-03-15 45/week @ 2024-03-29

54 downloads per month
Used in msp430-periph

MIT/Apache

86KB
1.5K SLoC

peripherals

Define and access your microcontroller peripherals

Features

  • A macro to generate code for peripherals, registers, and register fields
  • Zero-sized structs to represent peripherals and registers
  • Enums or newtype struct to represent fields values
  • Combine values to write to a regiser with | (binary or)
  • Read/write access at the regiser level
  • Strong typing ensures you don't mix up registers
  • Generic over the peripheral instance
  • See the example module for an example of generated types

Inspiration

This is inspired primarly from

and likely by every other regiser access crate out there

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Dependencies