• Cortex-M0+
– uint8_t MotionFX_CM0P_GetLibVersion(char *version)
◦
retrieves the version of the library
◦ *version is a pointer to an array of 35 characters
◦ returns the number of characters in the version string
– void MotionFX_CM0P_Initialize(void)
◦ performs MotionFX library initialization and setup of the internal mechanism
◦ the CRC module in STM32 microcontroller (in RCC peripheral clock enable register) has to be
enabled before using the library
Note: This function must be called before using the sensor fusion library.
– void MotionFX_CM0P_setOrientation(const char acc_orientation[4], const char
gyro_orientation[4], const char mag_orientation[4])
◦ sets sensors orientation
◦ acc_orienation/gyro_orientation/mag_orientation orientation strings
– MFX_CM0P_engine_state_t MotionFX_CM0P_getStatus_6X(void)
◦ gets the 6 axes library status
◦ returns 1 if enabled, 0 if disabled
– MFX_CM0P_engine_state_t MotionFX_CM0P__getStatus_9X(void)
◦ gets the 9 axes library status
◦ returns 1 if enabled, 0 if disabled
– MFX_CM0P_engine_state_t MotionFX_CM0P__getStatus_euler(void)
◦ gets the status of euler angles calculation
◦ returns 1 if enabled, 0 if disabled
– MFX_CM0P_engine_state_t MotionFX_CM0P__getStatus_gbias(void)
◦ gets the status of gyroscope calibration
◦ returns 1 if enabled, 0 if disabled
– void MotionFX_CM0P_enable_6X(MFX_CM0P_engine_state_t enable)
◦ enables or disables the 6 axes function (ACC + GYRO)
◦ enable parameter is 1 to enable, 0 to disable
– void MotionFX_CM0P_enable_9X(MFX_CM0P_engine_state_t enable)
◦ enables or disables the 9 axes function (ACC + GYRO+MAG)
◦ enable parameter is 1 to enable, 0 to disable
– void MotionFX_CM0P_enable_euler(MFX_CM0P_engine_state_t enable)
◦ enables or disables the euler angles calculation
◦ enable parameter is 1 to enable, 0 to disable
– void MotionFX_CM0P_enable_gbias(MFX_CM0P_engine_state_t enable)
◦ enables or disables the gyroscope calibration
◦ enable parameter is 1 to enable, 0 to disable
– void MotionFX_CM0P_setGbias(float *gbias)
◦ sets the initial gbias
◦ *gbias parameter is a pointer to a float array containing the gyro bias value for each axis
– void MotionFX_CM0P_getGbias(float *gbias)
◦ gets the initial gbias
◦ *gbias parameter is a pointer to a float array containing the gyro bias value for each axis
UM2220
MotionFX library
UM2220 - Rev 7
page 10/24