MCPcopy Create free account
hub / github.com/FrameworkComputer/framework-system / set_click_force

Function set_click_force

framework_lib/src/touchpad.rs:78–85  ·  view source on GitHub ↗
(force: ClickForce)

Source from the content-addressed store, hash-verified

76}
77
78pub fn set_click_force(force: ClickForce) -> Result<(), HidError> {
79 let device =
80 open_haptic_touchpad().ok_or_else(|| hid_err("Could not find a haptic touchpad"))?;
81 // Field is 2 bits at the bottom of the report payload
82 let buf = [CLICK_FORCE_REPORT_ID, force as u8];
83 debug!(" send_feature_report (click force) {:X?}", buf);
84 device.send_feature_report(&buf)
85}
86
87fn read_byte(device: &HidDevice, report_id: u8, addr: u8) -> Result<u8, HidError> {
88 device.send_feature_report(&[report_id, addr, 0x10, 0])?;

Callers 1

run_with_argsFunction · 0.85

Calls 2

open_haptic_touchpadFunction · 0.85
hid_errFunction · 0.85

Tested by

no test coverage detected