Module lpc82x_hal::wkt[][src]

API for the self-wake-up timer (WKT)

The entry point to this API is WKT.

The WKT peripheral is described in the user manual, chapter 9.

Examples

extern crate lpc82x_hal;
extern crate nb;

use lpc82x_hal::prelude::*;
use lpc82x_hal::Peripherals;

let mut p = Peripherals::take().unwrap();

let mut syscon = p.syscon.split();
let mut timer  = p.wkt.enable(&mut syscon.handle);

// Start the timer at 750000. Sine the IRC-derived clock runs at 750 kHz,
// this translates to a one second wait.
timer.start(750_000u32);

while let Err(nb::Error::WouldBlock) = timer.wait() {
    // do stuff
}

Please refer to the examples in the repository for more example code.

Structs

WKT

Interface to the self-wake-up timer (WKT)

Traits

Clock

A clock that is usable by the self-wake-up timer (WKT)