+ gpus: nvapi::PhysicalGpu::enumerate()?,
+ };
+
+ // machine.set_mode_3080ti();
+ Ok(machine)
+ }
+
+ // Doesn't work: "Error: NotSupported".
+ // From OpenRGB, see the following files:
+ // * Controllers\GigabyteRGBFusion2GPUController\GigabyteRGBFusion2GPUControllerDetect.cpp
+ // * Controllers\GigabyteRGBFusion2GPUController\RGBController_GigabyteRGBFusion2GPU.cpp
+ // * Controllers\GigabyteRGBFusion2GPUController\GigabyteRGBFusion2GPUController.cpp
+ // * i2c_smbus\i2c_smbus_nvapi.cpp
+ // Implementation of nvapi-rs: https://github.com/arcnmx/nvapi-rs/blob/master/src/gpu.rs#L645
+ pub fn test_i2c(&self) {
+ // Test from 'GigabyteRGBFusion2GPUControllerDetect.cpp'
+ let data = [0xAB, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00];
+ self.gpus[0]
+ .i2c_write(
+ 0,
+ Some(1),
+ false,
+ GIGABYTE_RTX3080TI_VISION_OC_ADDR,
+ &[],
+ &data,
+ i2c::I2cSpeed::Default,
+ )
+ .expect("Error");
+ }
+
+ fn set_mode_3080ti(&self) {
+ let data = [
+ RGB_FUSION2_GPU_REG_MODE,
+ 0x01, // Mode (1: static).
+ 0x00, // Speed.
+ 0x63, // Brightness max.
+ 0x00, // Mistery flag.
+ 0x01, // Zone.
+ 0x00,
+ 0x00,
+ ];
+ self.gpus[0]
+ .i2c_write(
+ 0,
+ Some(1),
+ false,
+ GIGABYTE_RTX3080TI_VISION_OC_ADDR,
+ &[],
+ &data,
+ i2c::I2cSpeed::Default,
+ )
+ .expect("Error");
+ }
+
+ fn set_color_3080ti(&self, color: &rgb::RGB) {
+ // TODO.
+ self.test_i2c();