pub trait ScreenSetup {
    fn set_client(&self, client: Option<&'static dyn ScreenSetupClient>);
    fn set_resolution(
        &self,
        resolution: (usize, usize)
    ) -> Result<(), ErrorCode>; fn set_pixel_format(
        &self,
        depth: ScreenPixelFormat
    ) -> Result<(), ErrorCode>; fn set_rotation(&self, rotation: ScreenRotation) -> Result<(), ErrorCode>; 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

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

Sets the pixel format. Returns ENOSUPPORT if the pixel format is not supported. The function should return Ok(()) if the request is registered and will be sent to the screen. Upon Ok(()), the caller has to wait for the command_complete callback function that will return the actual Result<(), ErrorCode> after setting the pixel format.

Sets the rotation of the display. The function should return Ok(()) if the request is registered and will be sent to the screen. Upon Ok(()), the caller has to wait for the command_complete callback function that will return the actual Result<(), ErrorCode> after setting the rotation.

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

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.

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.

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.

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.

Implementors