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
impl AsusController
Sourcepub fn new() -> Result<Self, ControllerError>
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
ControllerError::AlreadyInitializedif another instance already existsControllerError::PackageNotFoundif the ASUS package is not installedControllerError::DllLoadif the DLL fails to loadControllerError::RpcInitFailedif RPC initialization fails
Sourcepub fn set_splendid_mode(
&self,
symbol: &[u8],
value: u8,
) -> Result<(), ControllerError>
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.
Sourcepub fn set_monochrome_mode(
&self,
grayscale: u8,
temp: u8,
) -> Result<(), ControllerError>
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.
Sourcepub fn dimming_to_percent(splendid_value: i32) -> i32
pub fn dimming_to_percent(splendid_value: i32) -> i32
Convert dimming from splendid units (40-100) to percentage (0-100).
Sourcepub fn percent_to_dimming(percent: i32) -> i32
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
impl DisplayController for AsusController
Source§fn get_state(&self) -> ControllerState
fn get_state(&self) -> ControllerState
Get a snapshot of the current controller state.
Source§fn refresh_sliders(&self) -> Result<(), ControllerError>
fn refresh_sliders(&self) -> Result<(), ControllerError>
Refresh slider values from the device.
Source§fn sync_all_sliders(&self) -> Result<(), ControllerError>
fn sync_all_sliders(&self) -> Result<(), ControllerError>
Sync all slider values from hardware.
Source§fn set_dimming(&self, level: i32) -> Result<(), ControllerError>
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>
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>
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>
fn set_mode(&self, mode: &dyn DisplayMode) -> Result<(), ControllerError>
Set a display mode.
Source§fn toggle_e_reading(&self) -> Result<Box<dyn DisplayMode>, ControllerError>
fn toggle_e_reading(&self) -> Result<Box<dyn DisplayMode>, ControllerError>
Toggle e-reading mode on/off.
Source§impl Drop for AsusController
impl Drop for AsusController
impl Send for AsusController
impl Sync for AsusController
Auto Trait Implementations§
impl Freeze for AsusController
impl RefUnwindSafe for AsusController
impl Unpin for AsusController
impl UnwindSafe for AsusController
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