pub struct ButtonLED<I2C> { /* private fields */ }
Expand description
This struct contains all the functions to interface with the Qwiic button LED.
Implementations§
Source§impl<I2C> ButtonLED<I2C>
impl<I2C> ButtonLED<I2C>
The button ID is read-only and always returns 0x5D.
Sourcepub fn firmware_version(&mut self) -> Result<u16, Error>
pub fn firmware_version(&mut self) -> Result<u16, Error>
The firmware version for this button LED.
Determine the status of this button.
Set the button status, e.g. to clear events
Sourcepub fn interrupt_config(&mut self) -> Result<InterruptConfig, Error>
pub fn interrupt_config(&mut self) -> Result<InterruptConfig, Error>
Query the interrupt configuration.
Sourcepub fn set_interrupt_config(
&mut self,
config: InterruptConfig,
) -> Result<(), Error>
pub fn set_interrupt_config( &mut self, config: InterruptConfig, ) -> Result<(), Error>
Manipulate the interrupt configuration.
Query the debounce time, a measurement of how long after the button is released that it requires to reset to the default state.
Manipulate the debounce time.
Sourcepub fn pressed_queue_full(&mut self) -> Result<bool, Error>
pub fn pressed_queue_full(&mut self) -> Result<bool, Error>
Is the button pressed queue full.
Sourcepub fn pressed_queue_empty(&mut self) -> Result<bool, Error>
pub fn pressed_queue_empty(&mut self) -> Result<bool, Error>
Is the button pressed queue empty.
Sourcepub fn pressed_queue_status(&mut self) -> Result<PressedQueueStatus, Error>
pub fn pressed_queue_status(&mut self) -> Result<PressedQueueStatus, Error>
Query the button pressed queue: empty / full.
Sourcepub fn newest_press_timestamp(&mut self) -> Result<u32, Error>
pub fn newest_press_timestamp(&mut self) -> Result<u32, Error>
The timestamp in milliseconds since the most recent button press in the queue.
Sourcepub fn oldest_press_timestamp(&mut self) -> Result<u32, Error>
pub fn oldest_press_timestamp(&mut self) -> Result<u32, Error>
The timestamp in milliseconds since the first button press in the queue.
Sourcepub fn clicked_queue_full(&mut self) -> Result<bool, Error>
pub fn clicked_queue_full(&mut self) -> Result<bool, Error>
Is the button clicked queue full.
Sourcepub fn clicked_queue_empty(&mut self) -> Result<bool, Error>
pub fn clicked_queue_empty(&mut self) -> Result<bool, Error>
Is the button clicked queue empty.
Sourcepub fn clicked_queue_status(&mut self) -> Result<ClickedQueueStatus, Error>
pub fn clicked_queue_status(&mut self) -> Result<ClickedQueueStatus, Error>
Query the button pressed queue: empty / full.
Sourcepub fn newest_click_timestamp(&mut self) -> Result<u32, Error>
pub fn newest_click_timestamp(&mut self) -> Result<u32, Error>
The timestamp in milliseconds since the most recent button click in the queue.
Sourcepub fn oldest_click_timestamp(&mut self) -> Result<u32, Error>
pub fn oldest_click_timestamp(&mut self) -> Result<u32, Error>
The timestamp in milliseconds since the first button click in the queue.
Sourcepub fn led_brightness(&mut self) -> Result<u8, Error>
pub fn led_brightness(&mut self) -> Result<u8, Error>
The LED brightness.
Sourcepub fn led_pulse_granularity(&mut self) -> Result<u8, Error>
pub fn led_pulse_granularity(&mut self) -> Result<u8, Error>
The number of steps the LED uses from one brightness setting another when updated.
Sourcepub fn set_led_pulse_granularity(&mut self, brightness: u8) -> Result<(), Error>
pub fn set_led_pulse_granularity(&mut self, brightness: u8) -> Result<(), Error>
Set the LED update granularity.
Sourcepub fn led_pulse_cycle_time(&mut self) -> Result<u16, Error>
pub fn led_pulse_cycle_time(&mut self) -> Result<u16, Error>
When set, the LED pulses on for this value in milliseconds.
Sourcepub fn set_led_pulse_cycle_time(&mut self, cycle_time: u16) -> Result<(), Error>
pub fn set_led_pulse_cycle_time(&mut self, cycle_time: u16) -> Result<(), Error>
Set the LED pulse on time in milliseconds (0 disables).
Sourcepub fn led_pulse_off_time(&mut self) -> Result<u16, Error>
pub fn led_pulse_off_time(&mut self) -> Result<u16, Error>
The duration in milliseconds the LED is off while pulsing.
Sourcepub fn set_led_pulse_off_time(&mut self, off_time: u16) -> Result<(), Error>
pub fn set_led_pulse_off_time(&mut self, off_time: u16) -> Result<(), Error>
Set the LED off time in milliseconds (0 disables).
Sourcepub fn device_address(&mut self) -> Result<u8, Error>
pub fn device_address(&mut self) -> Result<u8, Error>
The address of this button LED.