Crates.io | k22f |
lib.rs | k22f |
version | 0.1.0 |
source | src |
created_at | 2020-04-02 00:44:51.092849 |
updated_at | 2020-04-02 00:44:51.092849 |
description | Device support crate for NXP FRDM-K22F |
homepage | |
repository | https://github.com/mtayler/k22f-rs |
max_upload_size | |
id | 225367 |
size | 16,820,592 |
This crate provides an autogenerated API for access to FRDM-K22F peripherals. The API is generated using svd2rust with SVD files from Keil Device Family Packs.
The rt
feature is optional and brings in support for cortex-m-rt
.
In your code:
use k22f;
let peripherals = k22f::Peripherals::take().unwrap();
// PortA clock enable
let sim = &peripherals.SIM;
sim.scgc5.write(|w| w.porta().set_bit());
// Set GPIO output
let porta = &peripherals.PORTA;
porta.pcr2.write(|w| w.mux()._001());
// Set green LED low
let gpioa = &peripherals.GPIOA;
gpioa.pddr.write(|w| w.pdd()._0());
For full details on the autogenerated API, please see: https://docs.rs/svd2rust/0.17.0/svd2rust/#peripheral-api