Code cleanup
This commit is contained in:
parent
967d544bbc
commit
8d2d31fa42
@ -1,6 +1,8 @@
|
||||
// TODO: Add license header
|
||||
// TODO: Add documentation header
|
||||
// TODO: GUI lock button support
|
||||
// Project: CMtec CMDR Keyboard 42
|
||||
// Date: 2023-07-01
|
||||
// Author: Christoffer Martinsson
|
||||
// Email: cm@cmtec.se
|
||||
// License: Please refer to LICENSE in root directory
|
||||
|
||||
#![no_std]
|
||||
#![no_main]
|
||||
|
||||
@ -6,6 +6,14 @@ use smart_leds::{SmartLedsWrite, RGB8};
|
||||
use ws2812_pio::Ws2812Direct;
|
||||
|
||||
/// Status LED modes
|
||||
///
|
||||
/// * OFF = Syatem offline
|
||||
/// * OK = All system Ok
|
||||
/// * ACTIVE1 = System active 1
|
||||
/// * ACTIVE2 = System active 2
|
||||
/// * WARNING = Warning
|
||||
/// * ERROR = Error
|
||||
/// * BOOTLOADER = Bootloader active
|
||||
#[derive(PartialEq, Eq, Copy, Clone)]
|
||||
pub enum StatusMode {
|
||||
OFF = 0,
|
||||
@ -17,6 +25,19 @@ pub enum StatusMode {
|
||||
BOOTLOADER = 6,
|
||||
}
|
||||
|
||||
/// Status LED driver
|
||||
/// This driver uses the PIO state machine to drive a WS2812 LED
|
||||
///
|
||||
/// # Example
|
||||
///
|
||||
/// ```
|
||||
/// let mut status_led = Ws2812StatusLed::new(
|
||||
/// pins.neopixel.into_mode(),
|
||||
/// &mut pio,
|
||||
/// sm0,
|
||||
/// clocks.peripheral_clock.freq(),
|
||||
/// );
|
||||
/// ```
|
||||
pub struct Ws2812StatusLed<P, SM, I>
|
||||
where
|
||||
I: PinId,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user