AsusController

Struct AsusController 

Source
pub struct AsusController { /* private fields */ }
Expand description

The ASUS display controller.

Provides access to ASUS Splendid display settings including:

  • Display modes (Normal, Vivid, Manual, Eye Care, E-Reading)
  • Dimming control
  • Slider values

§Example

use asus_display_control::{AsusController, DisplayController, NormalMode};

let controller = AsusController::new()?;
controller.set_mode(&NormalMode::new())?;

§Limitations

Only one instance can exist at a time due to DLL/RPC constraints.

Implementations§

Source§

impl AsusController

Source

pub fn new() -> Result<Self, ControllerError>

Create a new controller instance.

Only one instance can exist at a time due to DLL/RPC limitations. The instance guard is released when the controller is dropped.

§Errors
Source

pub fn set_splendid_mode( &self, symbol: &[u8], value: u8, ) -> Result<(), ControllerError>

Set a splendid mode with a value parameter.

This is used internally by mode implementations.

Source

pub fn set_monochrome_mode( &self, grayscale: u8, temp: u8, ) -> Result<(), ControllerError>

Set monochrome/e-reading mode with grayscale and temp.

This is used internally by EReadingMode.

Source

pub fn dimming_to_percent(splendid_value: i32) -> i32

Convert dimming from splendid units (40-100) to percentage (0-100).

Source

pub fn percent_to_dimming(percent: i32) -> i32

Convert dimming from percentage (0-100) to splendid units (40-100).

Trait Implementations§

Source§

impl DisplayController for AsusController

Source§

fn get_state(&self) -> ControllerState

Get a snapshot of the current controller state.
Source§

fn refresh_sliders(&self) -> Result<(), ControllerError>

Refresh slider values from the device.
Source§

fn sync_all_sliders(&self) -> Result<(), ControllerError>

Sync all slider values from hardware.
Source§

fn set_dimming(&self, level: i32) -> Result<(), ControllerError>

Set the display dimming level (40-100 in splendid units).
Source§

fn set_dimming_percent(&self, percent: i32) -> Result<(), ControllerError>

Set dimming using percentage (0-100).
Source§

fn get_current_mode(&self) -> Result<Box<dyn DisplayMode>, ControllerError>

Get the current display mode.
Source§

fn set_mode(&self, mode: &dyn DisplayMode) -> Result<(), ControllerError>

Set a display mode.
Source§

fn toggle_e_reading(&self) -> Result<Box<dyn DisplayMode>, ControllerError>

Toggle e-reading mode on/off.
Source§

impl Drop for AsusController

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

impl Send for AsusController

Source§

impl Sync for AsusController

Auto Trait Implementations§

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.