9436f49fd73d604cfa6e70594fa948fa89c37842
2 a770
, asus_aura_usb
, corsair_lighting_pro
, corsair_vengeance
, cpu_temperature
, intel_arc
, rgb
,
6 fn set_color(&mut self, color
: &rgb
::RGB
);
7 fn get_gpu_tmp(&self) -> f32;
8 fn get_cpu_tmp(&self) -> f32;
11 pub struct MachineJiji
{
12 ram
: Vec
<corsair_vengeance
::Controller
>,
13 b650e_device
: asus_aura_usb
::Device
,
15 gpu_devices
: intel_arc
::Devices
,
19 pub fn new() -> Self {
20 let api
= hidapi
::HidApi
::new().unwrap();
23 corsair_vengeance
::Controller
::new(0x19),
24 corsair_vengeance
::Controller
::new(0x1B),
26 b650e_device
: asus_aura_usb
::Device
::new(&api
, asus_aura_usb
::Motherboard
::Asus650e
),
27 a770
: a770
::A770
::new(),
28 gpu_devices
: unsafe { intel_arc
::GetDevices() },
33 impl Machine
for MachineJiji
{
34 fn set_color(&mut self, color
: &rgb
::RGB
) {
35 for controller
in &self.ram
{
36 controller
.set_color(&color
);
38 self.b650e_device
.set_color(&color
);
39 self.a770
.set_color(color
.red
, color
.green
, color
.blue
);
42 fn get_gpu_tmp(&self) -> f32 {
43 unsafe { intel_arc
::GetTemperature(self.gpu_devices
, 0) as f32 }
46 fn get_cpu_tmp(&self) -> f32 {
47 cpu_temperature
::read()
51 impl Drop
for MachineJiji
{
54 intel_arc
::FreeDevices(self.gpu_devices
);
59 pub struct MachineLyssMetal
{
60 crosshair_device
: asus_aura_usb
::Device
,
61 corsair_lignting_pro
: corsair_lighting_pro
::Device
,
62 gpus
: Vec
<nvapi
::PhysicalGpu
>,
65 impl MachineLyssMetal
{
66 pub fn new() -> Self {
67 let api
= hidapi
::HidApi
::new().unwrap();
69 nvapi
::initialize().expect("Unable to initialize nvapi (Nvidia API)");
72 crosshair_device
: asus_aura_usb
::Device
::new(
74 asus_aura_usb
::Motherboard
::AsusCrosshairVIIIHero
,
76 corsair_lignting_pro
: corsair_lighting_pro
::Device
::new(
84 gpus
: nvapi
::PhysicalGpu
::enumerate().unwrap(),
89 impl Machine
for MachineLyssMetal
{
90 fn set_color(&mut self, color
: &rgb
::RGB
) {
91 self.crosshair_device
.set_color(&color
);
92 self.corsair_lignting_pro
.set_color(&color
);
95 fn get_gpu_tmp(&self) -> f32 {
96 self.gpus
[0].thermal_settings(None
).unwrap()[0]
101 fn get_cpu_tmp(&self) -> f32 {
102 cpu_temperature
::read()