39#ifdef PREINIT_SUPPORTED
43#ifdef MikroCCoreVersion
44 #if MikroCCoreVersion >= 1
49#include "drv_digital_out.h"
50#include "drv_digital_in.h"
73#define XSENSMTI3_WAIT_FOR_START 0x00
74#define XSENSMTI3_START_PROCESS 0x01
75#define XSENSMTI3_DATA_PROCESSING 0x02
76#define XSENSMTI3_PARSER_DATA 0x03
83#define XSENSMTI3_TX_DRV_BUFFER_SIZE 100
84#define XSENSMTI3_RX_DRV_BUFFER_SIZE 1000
102#define XSENSMTI3_MAP_MIKROBUS( cfg, mikrobus ) \
103 cfg.tx_pin = MIKROBUS( mikrobus, MIKROBUS_TX ); \
104 cfg.rx_pin = MIKROBUS( mikrobus, MIKROBUS_RX ); \
105 cfg.syn = MIKROBUS( mikrobus, MIKROBUS_AN ); \
106 cfg.rst = MIKROBUS( mikrobus, MIKROBUS_RST ); \
107 cfg.cs = MIKROBUS( mikrobus, MIKROBUS_CS ); \
108 cfg.rts = MIKROBUS( mikrobus, MIKROBUS_PWM ); \
109 cfg.cts = MIKROBUS( mikrobus, MIKROBUS_INT )
170 uint32_t raw_data[ 4 ];
171 float quat_data[ 4 ];
#define XSENSMTI3_TX_DRV_BUFFER_SIZE
XSENS MTi-3 driver buffer size.
Definition xsensmti3.h:83
#define XSENSMTI3_RX_DRV_BUFFER_SIZE
Definition xsensmti3.h:84
void xsensmti3_get_data(xsensmti3_quat_t *quat_obj, xsensmti3_data_t *data_obj)
XSENS MTi-3 get Roll, Pitch and Yaw.
err_t xsensmti3_check_package(uint8_t *package_buf, uint8_t *start_package)
XSENS MTi-3 checks package.
err_t xsensmti3_generic_write(xsensmti3_t *ctx, uint8_t *data_buf, uint16_t len)
XSENS MTi-3 data writing function.
void xsensmti3_cfg_setup(xsensmti3_cfg_t *cfg)
XSENS MTi-3 configuration object setup function.
err_t xsensmti3_generic_read(xsensmti3_t *ctx, uint8_t *data_buf, uint16_t max_len)
XSENS MTi-3 data reading function.
void xsensmti3_parser(uint8_t *rsp_buf, uint8_t start_cnt, xsensmti3_parse_t *obj)
XSENS MTi-3 general parser.
err_t xsensmti3_init(xsensmti3_t *ctx, xsensmti3_cfg_t *cfg)
XSENS MTi-3 initialization function.
XSENS MTi-3 Click configuration object.
Definition xsensmti3.h:143
pin_name_t rts
Definition xsensmti3.h:152
uint32_t baud_rate
Definition xsensmti3.h:156
pin_name_t cts
Definition xsensmti3.h:153
bool uart_blocking
Definition xsensmti3.h:157
uart_data_bits_t data_bit
Definition xsensmti3.h:158
pin_name_t tx_pin
Definition xsensmti3.h:146
pin_name_t rx_pin
Definition xsensmti3.h:145
uart_stop_bits_t stop_bit
Definition xsensmti3.h:160
uart_parity_t parity_bit
Definition xsensmti3.h:159
pin_name_t rst
Definition xsensmti3.h:150
pin_name_t syn
Definition xsensmti3.h:149
pin_name_t cs
Definition xsensmti3.h:151
Click roll/pitch/yaw structure definition.
Definition xsensmti3.h:213
float roll
Definition xsensmti3.h:214
float pitch
Definition xsensmti3.h:215
float yaw
Definition xsensmti3.h:216
Click parse structure definition.
Definition xsensmti3.h:199
xsensmti3_u32_data_t status_obj
Definition xsensmti3.h:203
uint8_t crc_data
Definition xsensmti3.h:205
xsensmti3_quat_t quat_obj
Definition xsensmti3.h:201
uint32_t package_header
Definition xsensmti3.h:200
xsensmti3_u32_data_t time_obj
Definition xsensmti3.h:202
xsensmti3_u16_data_t package_obj
Definition xsensmti3.h:204
Click quat structure definition.
Definition xsensmti3.h:168
uint16_t data_id
Definition xsensmti3.h:169
XSENS MTi-3 Click context object.
Definition xsensmti3.h:119
digital_out_t cs
Definition xsensmti3.h:123
digital_out_t rts
Definition xsensmti3.h:124
digital_out_t syn
Definition xsensmti3.h:121
uart_t uart
Definition xsensmti3.h:130
digital_in_t cts
Definition xsensmti3.h:127
digital_out_t rst
Definition xsensmti3.h:122
Click 16-bit data structure definition.
Definition xsensmti3.h:189
uint16_t data_id
Definition xsensmti3.h:190
uint16_t out_data
Definition xsensmti3.h:191
Click 32-bit data structure definition.
Definition xsensmti3.h:179
uint32_t out_data
Definition xsensmti3.h:181
uint16_t data_id
Definition xsensmti3.h:180
xsensmti3_return_value_t
XSENS MTi-3 Click return value data.
Definition xsensmti3.h:225
@ XSENSMTI3_ERROR
Definition xsensmti3.h:227
@ XSENSMTI3_OK
Definition xsensmti3.h:226