[][src]Trait kernel::hil::screen::ScreenSetup

pub trait ScreenSetup {
    fn set_client(&self, client: Option<&'static dyn ScreenSetupClient>);
fn set_resolution(&self, resolution: (usize, usize)) -> ReturnCode;
fn set_pixel_format(&self, depth: ScreenPixelFormat) -> ReturnCode;
fn set_rotation(&self, rotation: ScreenRotation) -> ReturnCode;
fn get_num_supported_resolutions(&self) -> usize;
fn get_supported_resolution(&self, index: usize) -> Option<(usize, usize)>;
fn get_num_supported_pixel_formats(&self) -> usize;
fn get_supported_pixel_format(
        &self,
        index: usize
    ) -> Option<ScreenPixelFormat>; }

Required methods

fn set_client(&self, client: Option<&'static dyn ScreenSetupClient>)

fn set_resolution(&self, resolution: (usize, usize)) -> ReturnCode

Sets the screen resolution (in pixels). Returns ENOSUPPORT if the resolution is not supported. The function should return SUCCESS if the request is registered and will be sent to the screen. Upon SUCCESS, the caller has to wait for the command_complete callback function that will return the actual ReturnCode after setting the resolution.

fn set_pixel_format(&self, depth: ScreenPixelFormat) -> ReturnCode

Sets the pixel format. Returns ENOSUPPORT if the pixel format is not supported. The function should return SUCCESS if the request is registered and will be sent to the screen. Upon SUCCESS, the caller has to wait for the command_complete callback function that will return the actual ReturnCode after setting the pixel format.

fn set_rotation(&self, rotation: ScreenRotation) -> ReturnCode

Sets the rotation of the display. The function should return SUCCESS if the request is registered and will be sent to the screen. Upon SUCCESS, the caller has to wait for the command_complete callback function that will return the actual ReturnCode after setting the rotation.

Note that in the case of Rotated90 or Rotated270, this will swap the width and height.

fn get_num_supported_resolutions(&self) -> usize

Returns the number of the resolutions supported. should return at least one (the current resolution) This function is synchronous as the driver should know this value without requesting it from the screen (most screens do not support such a request, resolutions are described in the data sheet).

If the screen supports such a feature, the driver should request this information from the screen upfront.

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

Can be called with an index from 0 .. count-1 and will a tuple (width, height) with the current resolution (in pixels). note that width and height may change due to rotation

This function is synchronous as the driver should know this value without requesting it from the screen.

fn get_num_supported_pixel_formats(&self) -> usize

Returns the number of the pixel formats supported. This function is synchronous as the driver should know this value without requesting it from the screen (most screens do not support such a request, pixel formats are described in the data sheet).

If the screen supports such a feature, the driver should request this information from the screen upfront.

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

Can be called with index 0 .. count-1 and will return the value of each pixel format mode.

This function is synchronous as the driver should know this value without requesting it from the screen.

Loading content...

Implementors

Loading content...