#api-access #nxp #svd2rust

no-std k22f

Device support crate for NXP FRDM-K22F

1 unstable release

0.1.0 Apr 2, 2020

#46 in #nxp

MIT license

13MB
419K SLoC

k22f

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.

Usage

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

Dependencies