Download Embedded Firmware Library User Manual

Transcript
Embedded Firmware Library
UM003
VN100_SPI_GetQuatAcc
Table 24 describes the VN100_SPI_GetQuatAcc function.
Table 24.
VN100_SPI_GetQuatAcc
Function Name
VN100_SPI_GetQuatAcc
Function prototype
VN100_SPI_GetQuatAcc (
unsigned char sensorID,
float* q,
float* acc);
Behavior description
The quaternion is a 4x1 unit vector with the fourth term q[3] as the scalar
term.
Input parameter
sensorID: The sensor to get the requested data from
Output parameter 1
q : Measured quaternion (4x1)
Output parameter 2
acc : Measured acceleration (3x1) in m/s^2
Return value
Pointer to SPI packet returned by the sensor
Required preconditions
None
Called functions
VN100_SPI_ReadRegister()
Example:
/* Get the quaternion and acceleration */
VN100_SPI_Packet
*packet;
float quat[4];
float acc[3];
packet = VN100_SPI_GetQuatAcc(0, quat, acc);
Embedded Firmware Library
43/121