using System; using System.Runtime.InteropServices; using NvAPIWrapper.Native.Interfaces; namespace NvAPIWrapper.Native.GPU.Structures { /// /// Holds information regarding a illumination device /// [StructLayout(LayoutKind.Sequential, Pack = 8)] public struct IlluminationDeviceInfoV1 : IInitializable { private const int MaximumNumberOfReserved = 64; private const int MaximumNumberOfDeviceData = 64; internal IlluminationDeviceType _DeviceType; internal IlluminationZoneControlMode _ControlModes; [MarshalAs(UnmanagedType.ByValArray, SizeConst = MaximumNumberOfDeviceData)] internal byte[] _DeviceData; [MarshalAs(UnmanagedType.ByValArray, SizeConst = MaximumNumberOfReserved)] internal byte[] _Reserved; /// /// Gets the illumination device type /// public IlluminationDeviceType DeviceType { get => _DeviceType; } /// /// Gets the illumination device control mode /// public IlluminationZoneControlMode ControlMode { get => _ControlModes; } /// /// Gets the I2C index for a MCUV10 device /// /// Device type is not MCUV10. public byte MCUV10DeviceI2CIndex { get { if (DeviceType != IlluminationDeviceType.MCUV10) { throw new InvalidOperationException("Device type is not MCUV10."); } return _DeviceData[0]; } } } }