capsules_extra::ssd1306

Struct Ssd1306

Source
pub struct Ssd1306<'a, I: I2CDevice> { /* private fields */ }

Implementations§

Source§

impl<'a, I: I2CDevice> Ssd1306<'a, I>

Source

pub fn new( i2c: &'a I, buffer: &'static mut [u8], enable_charge_pump: bool, ) -> Ssd1306<'a, I>

Source

pub fn init_screen(&self)

Trait Implementations§

Source§

impl<I: I2CDevice> I2CClient for Ssd1306<'_, I>

Source§

fn command_complete( &self, buffer: &'static mut [u8], _status: Result<(), Error>, )

Called when an I2C command completed. The error denotes whether the command completed successfully or if an error occured.
Source§

impl<'a, I: I2CDevice> Screen<'a> for Ssd1306<'a, I>

Source§

fn set_client(&self, client: &'a dyn ScreenClient)

Set the object to receive the asynchronous command callbacks.
Source§

fn get_resolution(&self) -> (usize, usize)

Get a tuple (width, height) with the current resolution (in pixels). Read more
Source§

fn get_pixel_format(&self) -> ScreenPixelFormat

Get the current pixel format. Read more
Source§

fn get_rotation(&self) -> ScreenRotation

Get the current rotation. Read more
Source§

fn set_write_frame( &self, x: usize, y: usize, width: usize, height: usize, ) -> Result<(), ErrorCode>

Sets the write frame. Read more
Source§

fn write( &self, data: SubSliceMut<'static, u8>, _continue: bool, ) -> Result<(), ErrorCode>

Write data from buffer to the selected write frame. Read more
Source§

fn set_brightness(&self, brightness: u16) -> Result<(), ErrorCode>

Set the display brightness value. Read more
Source§

fn set_power(&self, enabled: bool) -> Result<(), ErrorCode>

Controls the screen power supply. Read more
Source§

fn set_invert(&self, enabled: bool) -> Result<(), ErrorCode>

Controls the color inversion mode. Read more
Source§

impl<'a, I: I2CDevice> ScreenSetup<'a> for Ssd1306<'a, I>

Source§

fn set_client(&self, client: &'a dyn ScreenSetupClient)

Source§

fn set_resolution(&self, _resolution: (usize, usize)) -> Result<(), ErrorCode>

Set the screen resolution in pixels with (X, Y). Read more
Source§

fn set_pixel_format(&self, _depth: ScreenPixelFormat) -> Result<(), ErrorCode>

Set the pixel format. Read more
Source§

fn set_rotation(&self, _rotation: ScreenRotation) -> Result<(), ErrorCode>

Set the rotation of the display. Read more
Source§

fn get_num_supported_resolutions(&self) -> usize

Get the number of supported resolutions. Read more
Source§

fn get_supported_resolution(&self, index: usize) -> Option<(usize, usize)>

Get the resolution specified by the given index. Read more
Source§

fn get_num_supported_pixel_formats(&self) -> usize

Get the number of the pixel formats supported. Read more
Source§

fn get_supported_pixel_format(&self, index: usize) -> Option<ScreenPixelFormat>

Get the pixel format specified by the given index. Read more

Auto Trait Implementations§

§

impl<'a, I> !Freeze for Ssd1306<'a, I>

§

impl<'a, I> !RefUnwindSafe for Ssd1306<'a, I>

§

impl<'a, I> !Send for Ssd1306<'a, I>

§

impl<'a, I> !Sync for Ssd1306<'a, I>

§

impl<'a, I> Unpin for Ssd1306<'a, I>

§

impl<'a, I> !UnwindSafe for Ssd1306<'a, I>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<'a, T> ScreenAdvanced<'a> for T
where T: Screen<'a> + ScreenSetup<'a>,