Struct ssd1306::prelude::Brightness
source · pub struct Brightness { /* private fields */ }
Expand description
Struct that holds display brightness
Implementations§
source§impl Brightness
impl Brightness
sourcepub const DIMMEST: Brightness = _
pub const DIMMEST: Brightness = _
The dimmest predefined brightness level
sourcepub const DIM: Brightness = _
pub const DIM: Brightness = _
A dim predefined brightness level
sourcepub const NORMAL: Brightness = _
pub const NORMAL: Brightness = _
A medium predefined brightness level
sourcepub const BRIGHT: Brightness = _
pub const BRIGHT: Brightness = _
A bright predefined brightness level
sourcepub const BRIGHTEST: Brightness = _
pub const BRIGHTEST: Brightness = _
The brightest predefined brightness level
sourcepub const fn custom(precharge: u8, contrast: u8) -> Self
pub const fn custom(precharge: u8, contrast: u8) -> Self
Create a Brightness object from a precharge period and contrast pair.
precharge
sets the phase 2
argument of the 0xD9 Set Pre-Charge Period
command and must
be must be between 1 and 15.
The effects of this parameter are hardware dependent. For the common 128x64 displays, values
1 and 2 result in different brightness levels, values above 2 behave the same was as 2.
See section 10.1.17 of the SSD1306 datasheet for more information.
contrast
sets the value used in the 0x81 Set Contrast Control
command and must be
between 0 and 255. See section 10.1.7 of the SSD1306 datasheet for more information.
Trait Implementations§
source§impl Clone for Brightness
impl Clone for Brightness
source§fn clone(&self) -> Brightness
fn clone(&self) -> Brightness
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for Brightness
impl Debug for Brightness
source§impl Default for Brightness
impl Default for Brightness
source§impl PartialEq for Brightness
impl PartialEq for Brightness
source§fn eq(&self, other: &Brightness) -> bool
fn eq(&self, other: &Brightness) -> bool
self
and other
values to be equal, and is used
by ==
.