Example #1
0
        public void SetButtonColor(Color c)
        {
            SPIStream stream = spi.GetStream();

            stream.Seek(0x6053, SeekOrigin.Begin);
            stream.Write(c.ToBytes());
        }
Example #2
0
        public Color GetButtonColor()
        {
            SPIStream stream = spi.GetStream();

            stream.Seek(0x6053, SeekOrigin.Begin);
            return(new Color(stream.Read(0x3)));
        }
Example #3
0
        public AnalogConfiguration GetAnalogConfiguration(int id, ConfigurationType type)
        {
            Controller joystick = this.joystick.GetJoystick();
            SPIStream  stream   = spi.GetStream();

            stream.Seek(joystick.GetStickConfigOffset(id, type), SeekOrigin.Begin);
            byte[] data       = stream.Read(0x12);
            int[]  parsedData = ParseAnalogConfiguration(data);
            return(joystick.ParseAnalogConfiguration(id, parsedData));
        }
Example #4
0
        public StickParameters GetStickParameters()
        {
            SPIStream stream = spi.GetStream();

            stream.Seek(0x6086, SeekOrigin.Begin);
            byte[]          data  = stream.Read(0x11);
            StickParameters param = new StickParameters();

            param.deadzone   = data[2];
            param.rangeRatio = data[3];
            return(param);
        }
Example #5
0
        public IMUConfiguration GetIMUConfiguration(ConfigurationType type)
        {
            SPIStream stream = spi.GetStream();
            int       offset;

            switch (type)
            {
            case ConfigurationType.Factory:
                offset = 0x6020;
                break;

            case ConfigurationType.User:
                offset = 0x8028;
                break;

            default:
                goto case ConfigurationType.Factory;
            }
            stream.Seek(offset, SeekOrigin.Begin);
            int[]            data   = stream.Read(0x18).ToInt16();
            IMUConfiguration config = new IMUConfiguration();

            config.xAcc.origin       = data[0];
            config.yAcc.origin       = data[1];
            config.zAcc.origin       = data[2];
            config.xAcc.sensitivity  = data[3];
            config.yAcc.sensitivity  = data[4];
            config.zAcc.sensitivity  = data[5];
            config.xGyro.origin      = data[6];
            config.yGyro.origin      = data[7];
            config.zGyro.origin      = data[8];
            config.xGyro.sensitivity = data[9];
            config.yGyro.sensitivity = data[10];
            config.zGyro.sensitivity = data[11];
            return(config);
        }