<mipdefs>
	<struct name="Vector3f">
		<param name="v" type="float" index="0" />
	</struct>
	<struct name="Matrix3f">
		<param name="v" type="float" index="0" />
	</struct>
	<struct name="DescriptorRate">
		<param name="descriptor" type="u8" index="0" />
		<param name="decimation" type="u16" index="1" />
	</struct>
	<descriptor_set name="CALIBRATION" descriptor="0x61">
		<field descriptor="0x01" name="enable" proprietary="true">
			<param name="security_key" index="0" type="u32" />
			<param name="enable" index="4" type="u8" />
			<param name="databits" index="5" type="u8" />
			<param name="datarate" index="6" type="u32" />
		</field>
		<field descriptor="0x02" name="read_eeprom" proprietary="true">
			<param name="address" index="0" type="u32" />
			<response descriptor="0x80">
				<param name="address" index="0" type="u32" />
				<param name="value" index="4" type="u16" />
			</response>
		</field>
		<field descriptor="0x03" name="write_eeprom" proprietary="true">
			<param name="address" index="0" type="u32" />
			<param name="value" index="4" type="u16" />
		</field>
		<field descriptor="0x04" name="read_firmware_version" proprietary="true">
			<response descriptor="0x81">
				<param name="version" index="0" type="u32" />
			</response>
		</field>
		<field descriptor="0x05" name="read_device_id_string" proprietary="true">
			<param name="id" index="0" type="u8" />
			<response descriptor="0x82">
				<param name="id" index="0" type="u8" />
				<param name="string" index="1" type="char" count="16" />
			</response>
		</field>
		<field descriptor="0x06" name="write_device_id_string" proprietary="true">
			<param name="id" index="0" type="u8" />
			<param name="string" index="1" type="char" count="16" />
		</field>
		<field descriptor="0x0D" name="factory_bits" proprietary="true" functions="WRSLD">
			<param name="bits" index="0" type="u32" />
			<response descriptor="0x89">
				<param name="bits" index="0" type="u32" />
			</response>
		</field>
		<field descriptor="0x0E" name="message_format" proprietary="true" functions="WRSLD">
			<param name="num_descriptors" index="0" type="u8" />
			<param name="descriptors" index="1" type="DescriptorRate" count="num_descriptors" />
			<response descriptor="0x8A">
				<param name="num_descriptors" index="0" type="u8" />
				<param name="descriptors" index="1" type="DescriptorRate" count="num_descriptors" />
			</response>
		</field>
		<field descriptor="0x12" name="gyro_test_offset" proprietary="true">
			<param name="enabled" index="0" type="bool" />
			<param name="offset_applied" index="1" type="bool" />
			<param name="period_ms" index="2" type="u32" />
			<param name="pulse_width_ms" index="6" type="u32" />
			<param name="offset_start_time_ms" index="10" type="u32" />
		</field>
		<field descriptor="0x0C" name="mag_cal_offset" proprietary="true" functions="WR">
			<param name="enabled" index="0" type="bool" />
			<param name="period_ms" index="1" type="u32" />
			<param name="pulse_width_ms" index="5" type="u32" />
			<response descriptor="0x88">
				<param name="enabled" index="0" type="bool" />
				<param name="period_ms" index="1" type="u32" />
				<param name="pulse_width_ms" index="5" type="u32" />
			</response>
		</field>
		<field descriptor="0x19" name="accel_coefficients" proprietary="true" functions="WR">
			WRITE writes to RAM tables, READ reads from RAM tables
			<param name="temp_index" index="0" type="u8" functions="WR" />
			<param name="sensor_index" index="1" type="u8" functions="WR" />
			<param name="column_index" index="2" type="u8" functions="WR" />
			<param name="temperature" index="3" type="float" />
			<param name="coefficient" index="7" type="float" />
			<response descriptor="0x99">
				<param name="temp_index" index="0" type="u8" />
				<param name="sensor_index" index="1" type="u8" />
				<param name="column_index" index="2" type="u8" />
				<param name="temperature" index="3" type="float" />
				<param name="coefficient" index="7" type="float" />
			</response>
		</field>
		<field descriptor="0x1A" name="gyro_coefficients" proprietary="true" functions="WR">
			WRITE writes to RAM tables, READ reads from RAM tables
			<param name="temp_index" index="0" type="u8" functions="WR" />
			<param name="sensor_index" index="1" type="u8" functions="WR" />
			<param name="column_index" index="2" type="u8" functions="WR" />
			<param name="temperature" index="3" type="float" />
			<param name="coefficient" index="7" type="float" />
			<response descriptor="0x9A">
				<param name="temp_index" index="0" type="u8" />
				<param name="sensor_index" index="1" type="u8" />
				<param name="column_index" index="2" type="u8" />
				<param name="temperature" index="3" type="float" />
				<param name="coefficient" index="7" type="float" />
			</response>
		</field>
		<field descriptor="0x1B" name="mag_coefficients" proprietary="true" functions="WR">
			WRITE writes to RAM tables, READ reads from RAM tables
			<param name="temp_index" index="0" type="u8" functions="WR" />
			<param name="sensor_index" index="1" type="u8" functions="WR" />
			<param name="column_index" index="2" type="u8" functions="WR" />
			<param name="temperature" index="3" type="float" />
			<param name="coefficient" index="7" type="float" />
			<response descriptor="0x9B">
				<param name="temp_index" index="0" type="u8" />
				<param name="sensor_index" index="1" type="u8" />
				<param name="column_index" index="2" type="u8" />
				<param name="temperature" index="3" type="float" />
				<param name="coefficient" index="7" type="float" />
			</response>
		</field>
		<field descriptor="0x18" name="tables" proprietary="true" functions="SLD">
			DEFAULT clears selected tables in RAM, SAVE saves all RAM tables to flash, LOAD loads all tables from flash into RAM, WRITE and READ not used
			<param name="bits" index="0" type="u8" functions="WD" />
		</field>
		<field descriptor="0x08" name="surveyed_gyro_matrix" proprietary="true" functions="WRSLD">
			Surveyed gyro rotation matrix values
			<param name="rotation_matrix" index="0" type="Matrix3f" />
			<response descriptor="0x84">
				<param name="rotation_matrix" index="0" type="Matrix3f" />
			</response>
		</field>
		<field descriptor="0x09" name="surveyed_gyro_offset" proprietary="true" functions="WRSLD">
			Surveyed gyro offset values
			<param name="offset" index="0" type="Vector3f" />
			<response descriptor="0x85">
				<param name="offset" index="0" type="Vector3f" />
			</response>
		</field>
		<field descriptor="0x0A" name="surveyed_accel_matrix" proprietary="true" functions="WRSLD">
			Surveyed accel rotation matrix values
			<param name="rotation_matrix" index="0" type="Matrix3f" />
			<response descriptor="0x86">
				<param name="rotation_matrix" index="0" type="Matrix3f" />
			</response>
		</field>
		<field descriptor="0x0B" name="surveyed_accel_offset" proprietary="true" functions="WRSLD">
			Surveyed accel offset values
			<param name="offset" index="0" type="Vector3f" />
			<response descriptor="0x87">
				<param name="offset" index="0" type="Vector3f" />
			</response>
		</field>
		<field descriptor="0x6F" name="sensor_test" proprietary="true" functions="WR">
			Used to control the self-test feature on mems devices for production testing
			<enum name="SensorType" type="u8">
				<value name="ACCEL" value="1" />
				<value name="GYRO" value="2" />
				<value name="MAG" value="3" />
				<value name="PRESS" value="4" />
			</enum>
			<param name="sensor" index="0" type="SensorType" functions="WR" />
			<param name="axis" index="1" type="u8" functions="WR" />
			<param name="range" index="2" type="u8" />
			<param name="mode" index="3" type="u8" />
			<param name="reserved" index="4" type="u8" />
			<response descriptor="0xEF">
				<param name="sensor" index="0" type="SensorType" functions="WR" />
				<param name="axis" index="1" type="u8" functions="WR" />
				<param name="range" index="2" type="u8" />
				<param name="mode" index="3" type="u8" />
				<param name="reserved" index="4" type="u8" />
			</response>
		</field>
	</descriptor_set>
</mipdefs>
