-fn test_read_temp() {
- let sensors = sensors_jiji::Sensors::new();
- println!("temp cpu: {}", sensors.read_cpu_temp());
- println!("temp gpu: {}", sensors.read_gpu_temp());
+const F17H_M01H_THM_TCON_CUR_TMP: u32 = 0x00059800;
+const F17H_TEMP_OFFSET_FLAG: u32 = 0x80000;
+const FAMILY_17H_PCI_CONTROL_REGISTER: u32 = 0x60;
+
+fn test_read_temperature_cpu() {
+ println!("temp cpu: {}", cpu_temperature::read())
+}
+
+fn test_read_temperature_a770() {
+ let jiji: &dyn machine::Machine = &machine::MachineJiji::new();
+ println!("temp gpu: {}", jiji.get_gpu_tmp());
+}
+
+fn test_read_temperature_3080() {
+ nvapi::initialize().expect("Unable to initialize nvapi (Nvidia API)");
+ // if let Ok(gpus) = {
+ // for gpu in gpus {
+ // let thermal = gpu.thermal_settings(None).unwrap()[0];
+ // println!("{:?}", thermal.current_temperature.0)
+ // }
+ // }
+ let gpus = nvapi::PhysicalGpu::enumerate().unwrap();
+ let gpu = &gpus[0];
+ let sensor = gpu.thermal_settings(None).unwrap()[0];
+ println!("{:?}", sensor.current_temperature.0);
+ nvapi::unload().unwrap();