XSENS MTi-3 click
XSENS MTi-3 Click is a compact add-on board that contains a fully functional module that can be configured as an Inertial Measurement Unit, Vertical reference Unit, or even an Attitude & Heading Reference System. This board features the MTi-3, a module outputting 3D orientation, 3D rate of turn, 3D accelerations, and 3D magnetic field, depending on the product configuration from Xsens.
click Product page
Click library
- Author : Mikroe Team
- Date : Sep 2021.
- Type : UART type
Software Support
We provide a library for the XSENSMTi3 Click as well as a demo application (example), developed using MikroElektronika compilers. The demo can run on all the main MikroElektronika development boards.
Package can be downloaded/installed directly from NECTO Studio Package Manager(recommended way), downloaded from our LibStock™ or found on Mikroe github account.
Library Description
This library contains API for XSENSMTi3 Click driver.
Standard key functions :
xsensmti3_cfg_setup
Config Object Initialization function.
void xsensmti3_cfg_setup(xsensmti3_cfg_t *cfg)
XSENS MTi-3 configuration object setup function.
XSENS MTi-3 Click configuration object.
Definition xsensmti3.h:143
xsensmti3_init
Initialization function.
err_t xsensmti3_init(xsensmti3_t *ctx, xsensmti3_cfg_t *cfg)
XSENS MTi-3 initialization function.
XSENS MTi-3 Click context object.
Definition xsensmti3.h:119
Example key functions :
xsensmti3_parser
XSENS MTi-3 general parser.
void xsensmti3_parser(uint8_t *rsp_buf, uint8_t start_cnt, xsensmti3_parse_t *obj)
XSENS MTi-3 general parser.
Click parse structure definition.
Definition xsensmti3.h:199
xsensmti3_get_data
XSENS MTi-3 get Roll, Pitch and Yaw.
void xsensmti3_get_data(xsensmti3_quat_t *quat_obj, xsensmti3_data_t *data_obj)
XSENS MTi-3 get Roll, Pitch and Yaw.
Click roll/pitch/yaw structure definition.
Definition xsensmti3.h:213
Click quat structure definition.
Definition xsensmti3.h:168
xsensmti3_check_package
XSENS MTi-3 checks package.
err_t xsensmti3_check_package(uint8_t *package_buf, uint8_t *start_package)
XSENS MTi-3 checks package.
Example Description
This example reads and processes data from XSENS MTi-3 clicks.
The demo application is composed of two sections :
Application Init
Initializes driver and wake-up module.
{
log_cfg_t log_cfg;
LOG_MAP_USB_UART( log_cfg );
log_init( &logger, &log_cfg );
log_info( &logger, " Application Init " );
{
log_error( &logger, " Communication init." );
for ( ; ; );
}
log_info( &logger, " Application Task " );
}
#define XSENSMTI3_MAP_MIKROBUS(cfg, mikrobus)
MikroBUS pin mapping.
Definition xsensmti3.h:102
void application_init(void)
Definition main.c:50
Application Task
Reads the received data and parses it. Shows Roll, Pitch and Yaw data.
{
uint8_t check_data = 0;
uint8_t cnt = 0;
xsensmti3_process( );
{
parser_buf_cnt = 0;
active_flag = 0;
start_rsp = 0;
rsp_cnt = 0;
}
{
}
{
{
}
else
{
}
}
{
log_printf( &logger, ">> Quaternion data <<\r\n" );
for ( cnt = 0; cnt < 4; cnt++ )
{
log_printf( &logger, ">> Q: %f\r\n", parse_data_obj.quat_obj.quat_data[ cnt ] );
}
log_printf( &logger, "--------------\r\n" );
log_printf( &logger, ">> ROLL: %.4f \r\n", data_obj.roll );
log_printf( &logger, ">> PITCH: %.4f \r\n", data_obj.pitch );
log_printf( &logger, ">> YAW: %.4f \r\n", data_obj.yaw );
log_printf( &logger, "--------------\r\n" );
}
}
#define XSENSMTI3_START_PROCESS
Definition xsensmti3.h:74
#define XSENSMTI3_WAIT_FOR_START
XSENS MTi-3 control commands.
Definition xsensmti3.h:73
#define XSENSMTI3_DATA_PROCESSING
Definition xsensmti3.h:75
#define XSENSMTI3_PARSER_DATA
Definition xsensmti3.h:76
void application_task(void)
Definition main.c:80
#define PROCESS_PARSER_BUFFER_SIZE
Definition main.c:28
@ XSENSMTI3_OK
Definition xsensmti3.h:226
The full application code, and ready to use projects can be installed directly from NECTO Studio Package Manager(recommended way), downloaded from our LibStock™ or found on Mikroe github account.
Other Mikroe Libraries used in the example:
- MikroSDK.Board
- MikroSDK.Log
- Click.XSENSMTi3
Additional notes and informations
Depending on the development board you are using, you may need USB UART click, USB UART 2 Click or RS232 Click to connect to your PC, for development systems with no UART to USB interface available on the board. UART terminal is available in all MikroElektronika compilers.