MCPcopy Index your code
hub / github.com/FrameworkComputer/framework-system / print_thermal

Function print_thermal

framework_lib/src/power.rs:355–469  ·  view source on GitHub ↗
(ec: &CrosEc)

Source from the content-addressed store, hash-verified

353}
354
355pub fn print_thermal(ec: &CrosEc) {
356 let temps = ec.read_memory(EC_MEMMAP_TEMP_SENSOR, 0x0F).unwrap();
357 let fans = ec.read_memory(EC_MEMMAP_FAN, 0x08).unwrap();
358
359 let platform = smbios::get_platform();
360 let family = smbios::get_family();
361 let remaining_sensors = match platform {
362 Some(Platform::IntelGen11) | Some(Platform::IntelGen12) | Some(Platform::IntelGen13) => {
363 println!(" F75303_Local: {:>4}", TempSensor::from(temps[0]));
364 println!(" F75303_CPU: {:>4}", TempSensor::from(temps[1]));
365 println!(" F75303_DDR: {:>4}", TempSensor::from(temps[2]));
366 println!(" Battery: {:>4}", TempSensor::from(temps[3]));
367 println!(" PECI: {:>4}", TempSensor::from(temps[4]));
368 if matches!(
369 platform,
370 Some(Platform::IntelGen12) | Some(Platform::IntelGen13)
371 ) {
372 println!(" F57397_VCCGT: {:>4}", TempSensor::from(temps[5]));
373 }
374 2
375 }
376
377 Some(Platform::IntelCoreUltra1) | Some(Platform::IntelCoreUltra3) => {
378 println!(" F75303_Local: {:>4}", TempSensor::from(temps[0]));
379 println!(" F75303_CPU: {:>4}", TempSensor::from(temps[1]));
380 println!(" Battery: {:>4}", TempSensor::from(temps[2]));
381 println!(" F75303_DDR: {:>4}", TempSensor::from(temps[3]));
382 println!(" PECI: {:>4}", TempSensor::from(temps[4]));
383 3
384 }
385
386 Some(Platform::Framework12IntelGen13) => {
387 println!(" F75303_CPU: {:>4}", TempSensor::from(temps[0]));
388 println!(" F75303_Skin: {:>4}", TempSensor::from(temps[1]));
389 println!(" F75303_Local: {:>4}", TempSensor::from(temps[2]));
390 println!(" Battery: {:>4}", TempSensor::from(temps[3]));
391 println!(" PECI: {:>4}", TempSensor::from(temps[4]));
392 println!(" Charger IC {:>4}", TempSensor::from(temps[5]));
393 2
394 }
395
396 Some(
397 Platform::Framework13Amd7080
398 | Platform::Framework13AmdAi300
399 | Platform::Framework16Amd7080
400 | Platform::Framework16AmdAi300,
401 ) => {
402 println!(" F75303_Local: {:>4}", TempSensor::from(temps[0]));
403 println!(" F75303_CPU: {:>4}", TempSensor::from(temps[1]));
404 println!(" F75303_DDR: {:>4}", TempSensor::from(temps[2]));
405 println!(" APU: {:>4}", TempSensor::from(temps[3]));
406 if family == Some(PlatformFamily::Framework16) {
407 println!(" dGPU VR: {:>4}", TempSensor::from(temps[4]));
408 println!(" dGPU VRAM: {:>4}", TempSensor::from(temps[5]));
409 println!(" dGPU AMB: {:>4}", TempSensor::from(temps[6]));
410 println!(" dGPU temp: {:>4}", TempSensor::from(temps[7]));
411 0
412 } else {

Callers 1

run_with_argsFunction · 0.85

Calls 3

get_platformFunction · 0.85
get_familyFunction · 0.85
read_memoryMethod · 0.80

Tested by

no test coverage detected