servicepoint-binding-c/src/commands/cc_only_commands.rs
Vinzenz Schroeter 363609c663
Some checks failed
Rust / build-gnu-apt (pull_request) Successful in 2m5s
Rust / build-size-gnu-unstable (pull_request) Failing after 2m48s
add derives
2025-06-27 00:17:55 +02:00

40 lines
1 KiB
Rust

use servicepoint::{ClearCommand, FadeOutCommand, HardResetCommand};
macro_rules! wrap_cc_only {
($(#[$meta:meta])* $command:ident) => {
::paste::paste!{
$crate::macros::wrap!{
[< $command Command >] {
derives: $crate::commands::derive_command[$command];
functions:
$(#[$meta])*
///
#[doc = " Returns: a new [`" [< $command Command >] "`] instance."]
fn new() -> move ::core::ptr::NonNull<[< $command Command >]> {
[< $command Command >]
};
}
}
}
};
}
wrap_cc_only!(
/// Set all pixels to the off state.
///
/// Does not affect brightness.
Clear
);
wrap_cc_only!(
/// Kills the udp daemon on the display, which usually results in a restart.
///
/// Please do not send this in your normal program flow.
HardReset
);
wrap_cc_only!(
/// A yet-to-be-tested command.
FadeOut
);