Skip to content

Rust MMIO abstraction using a macro-based API

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT
Notifications You must be signed in to change notification settings

adamgreig/ral-registers

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ral-registers

Version Documentation CI License

This crate contains an MMIO abstraction that uses macros to read, modify, and write fields in registers.

For example, several fields on a register can be updated (without changing the other fields) using:

// Modify some fields on GPIOA.MODER without changing others.
modify_reg!(gpio, GPIOA, MODER, MODER1: Input, MODER2: Output, MODER3: Input);

// Check a condition on a field.
while read_reg!(gpio, GPIOA, IDR, IDR3 == High) {}

// Read and write the entire register word value.
let port = read_reg!(gpio, GPIOA, IDR);
write_reg!(gpio, GPIOA, port);

This crate contains register code originally written in stm32ral, extracted for easier use in other projects.

Licence

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.

About

Rust MMIO abstraction using a macro-based API

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages