pub struct DisplayManager { /* private fields */ }Expand description
Display manager for obniz device
Implementations§
Source§impl DisplayManager
impl DisplayManager
pub fn new(obniz: Obniz) -> Self
Sourcepub async fn text(&self, text: &str) -> ObnizResult<()>
pub async fn text(&self, text: &str) -> ObnizResult<()>
Display text on the obniz screen
Sourcepub async fn clear(&self) -> ObnizResult<()>
pub async fn clear(&self) -> ObnizResult<()>
Clear the display
Sourcepub async fn qr(
&self,
text: &str,
correction_type: QrCorrectionType,
) -> ObnizResult<()>
pub async fn qr( &self, text: &str, correction_type: QrCorrectionType, ) -> ObnizResult<()>
Display a QR code with specified error correction level
Sourcepub async fn raw(&self, config: RawDisplayConfig) -> ObnizResult<()>
pub async fn raw(&self, config: RawDisplayConfig) -> ObnizResult<()>
Display raw pixel data
Sourcepub async fn brightness(&self, level: u8) -> ObnizResult<()>
pub async fn brightness(&self, level: u8) -> ObnizResult<()>
Set display brightness (0-100)
Sourcepub async fn contrast(&self, level: u8) -> ObnizResult<()>
pub async fn contrast(&self, level: u8) -> ObnizResult<()>
Set display contrast (0-100)
Sourcepub async fn pin_assign(
&self,
assignments: Vec<PinAssignment>,
) -> ObnizResult<()>
pub async fn pin_assign( &self, assignments: Vec<PinAssignment>, ) -> ObnizResult<()>
Assign pins for display modules
Sourcepub async fn pixel(&self, x: u16, y: u16, color: bool) -> ObnizResult<()>
pub async fn pixel(&self, x: u16, y: u16, color: bool) -> ObnizResult<()>
Draw a pixel at specified coordinates
Sourcepub async fn line(
&self,
x1: u16,
y1: u16,
x2: u16,
y2: u16,
color: bool,
) -> ObnizResult<()>
pub async fn line( &self, x1: u16, y1: u16, x2: u16, y2: u16, color: bool, ) -> ObnizResult<()>
Draw a line from (x1, y1) to (x2, y2)
Sourcepub async fn rect(
&self,
x: u16,
y: u16,
width: u16,
height: u16,
filled: bool,
color: bool,
) -> ObnizResult<()>
pub async fn rect( &self, x: u16, y: u16, width: u16, height: u16, filled: bool, color: bool, ) -> ObnizResult<()>
Draw a rectangle
Sourcepub async fn circle(
&self,
x: u16,
y: u16,
radius: u16,
filled: bool,
color: bool,
) -> ObnizResult<()>
pub async fn circle( &self, x: u16, y: u16, radius: u16, filled: bool, color: bool, ) -> ObnizResult<()>
Draw a circle
Sourcepub async fn text_size(&self, size: u8) -> ObnizResult<()>
pub async fn text_size(&self, size: u8) -> ObnizResult<()>
Set text size
Trait Implementations§
Source§impl Clone for DisplayManager
impl Clone for DisplayManager
Auto Trait Implementations§
impl !RefUnwindSafe for DisplayManager
impl !UnwindSafe for DisplayManager
impl Freeze for DisplayManager
impl Send for DisplayManager
impl Sync for DisplayManager
impl Unpin for DisplayManager
impl UnsafeUnpin for DisplayManager
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more