4 releases

0.2.0 Sep 17, 2021
0.1.2 Jul 26, 2020
0.1.1 Jul 26, 2020
0.1.0 Jul 26, 2020

#1501 in Embedded development

Download history 73/week @ 2023-12-18 6/week @ 2023-12-25 34/week @ 2024-01-01 183/week @ 2024-01-08 150/week @ 2024-01-15 58/week @ 2024-01-22 97/week @ 2024-01-29 22/week @ 2024-02-05 9/week @ 2024-02-12 118/week @ 2024-02-19 92/week @ 2024-02-26 40/week @ 2024-03-04 80/week @ 2024-03-11 26/week @ 2024-03-18 46/week @ 2024-03-25 82/week @ 2024-04-01

237 downloads per month

MIT/Apache

23KB
305 lines

Blinq - a blinking queue

Documentation

A queue for toggling a GPIO or blinking an LED, with binary patterns encoded as a u32.

Example

use blinq::{Pattern, Blinq, patterns, consts};

// Create a blink queue with room for 8 patterns (note: the capacity must be 1 higher
// then the amount of patterns you wish to store), that is active-low
let mut blinq: Blinq<9, FakeGpio> = Blinq::new(gpio, true);

// Insert "HELLO." in morse code

blinq.enqueue(patterns::morse::H); // 8 steps
blinq.enqueue(patterns::morse::E); // 2 steps
blinq.enqueue(patterns::morse::L); // 10 steps
blinq.enqueue(patterns::morse::L); // 10 steps
blinq.enqueue(patterns::morse::O); // 12 steps
blinq.enqueue(patterns::morse::FULL_STOP); // 18 steps

// This is 60 steps
for _ in 0..60 {
   blinq.step();
}

// The queue is now exhausted, and the GPIO will be driven to the
// inactive state
blinq.step();

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

~715KB
~13K SLoC