pub trait PanelSetBrightness<B: DisplayBus>: Panel<B> {
// Required method
async fn set_brightness(
&mut self,
bus: &mut B,
brightness: u8,
) -> Result<(), DisplayError<B::Error>>;
}Expand description
An optional trait for setting the panel’s own brightness via commands.
Note: Using a PWM pin to implement this trait is not recommended.
Required Methods§
Sourceasync fn set_brightness(
&mut self,
bus: &mut B,
brightness: u8,
) -> Result<(), DisplayError<B::Error>>
async fn set_brightness( &mut self, bus: &mut B, brightness: u8, ) -> Result<(), DisplayError<B::Error>>
Sets the panel’s own brightness.
The brightness is represented as a value between 0 and 255, where 0 is the minimum brightness and 255 is the maximum brightness.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".