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

Function get_als_reading

framework_lib/src/power.rs:248–257  ·  view source on GitHub ↗

Not supported on TGL EC

(ec: &CrosEc, index: usize)

Source from the content-addressed store, hash-verified

246
247/// Not supported on TGL EC
248pub fn get_als_reading(ec: &CrosEc, index: usize) -> Option<u32> {
249 let als = ec.read_memory(EC_MEMMAP_ALS, 0x04)?;
250 let offset = index + 4 * index;
251 Some(u32::from_le_bytes([
252 als[offset],
253 als[1 + offset],
254 als[2 + offset],
255 als[3 + offset],
256 ]))
257}
258
259pub fn get_accel_data(ec: &CrosEc) -> (AccelData, AccelData, LidAngle) {
260 // bit 4 = busy

Callers 1

print_sensorsFunction · 0.85

Calls 1

read_memoryMethod · 0.80

Tested by

no test coverage detected