42#ifdef PREINIT_SUPPORTED
46#ifdef MikroCCoreVersion
47 #if MikroCCoreVersion >= 1
52#include "drv_digital_in.h"
53#include "drv_i2c_master.h"
65#define C6DOFIMU7_MAP_MIKROBUS( cfg, mikrobus ) \
66 cfg.scl = MIKROBUS( mikrobus, MIKROBUS_SCL ); \
67 cfg.sda = MIKROBUS( mikrobus, MIKROBUS_SDA ); \
68 cfg.int2 = MIKROBUS( mikrobus, MIKROBUS_PWM ); \
69 cfg.int1 = MIKROBUS( mikrobus, MIKROBUS_INT )
76#define C6DOFIMU7_RETVAL uint8_t
78#define C6DOFIMU7_OK 0x00
79#define C6DOFIMU7_INIT_ERROR 0xFF
86#define C6DOFIMU7_SLAVE_ADDRESS 0x68
87#define C6DOFIMU7_PWR_MGMT 0x06
88#define C6DOFIMU7_PWM_MGMT_L 0x80
89#define C6DOFIMU7_PWM_MGMT_H 0x01
90#define C6DOFIMU7_TEMP_OUT_H 0x39
91#define C6DOFIMU7_ACCEL_XOUT_H 0x2D
92#define C6DOFIMU7_ACCEL_YOUT_H 0x2F
93#define C6DOFIMU7_ACCEL_ZOUT_H 0x31
94#define C6DOFIMU7_GYRO_XOUT_H 0x33
95#define C6DOFIMU7_GYRO_YOUT_H 0x35
96#define C6DOFIMU7_GYRO_ZOUT_H 0x37
103#define C6DOFIMU7_TEMPERATURE_SENSITIVITY 333.87
104#define C6DOFIMU7_TEMPERATURE_OFFSET 6.3
105#define C6DOFIMU7_ACCEL_SENSITIVITY 8.192
106#define C6DOFIMU7_GYRO_SENSITIVITY 65.5
#define C6DOFIMU7_RETVAL
Definition c6dofimu7.h:76
float c6dofimu7_get_temp_data(c6dofimu7_t *ctx, float temp_sensitivity, float temp_offset)
Get temperature data function.
void c6dofimu7_cfg_setup(c6dofimu7_cfg_t *cfg)
Config Object Initialization function.
C6DOFIMU7_RETVAL c6dofimu7_init(c6dofimu7_t *ctx, c6dofimu7_cfg_t *cfg)
Initialization function.
void c6dofimu7_get_gyro_data(c6dofimu7_t *ctx, c6dofimu7_axis_t *gyro, float sensitivity)
Get gyroscope data function.
void c6dofimu7_generic_read(c6dofimu7_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
Generic read function.
int16_t c6dofimu7_read_word(c6dofimu7_t *ctx, uint8_t address)
Read word function.
void c6dofimu7_generic_write(c6dofimu7_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
Generic write function.
void c6dofimu7_get_accel_data(c6dofimu7_t *ctx, c6dofimu7_axis_t *accel, float sensitivity)
Get accelerometer data function.
uint8_t c6dofimu7_get_int_input(c6dofimu7_t *ctx)
Get INT input function.
uint8_t c6dofimu7_get_pwm_input(c6dofimu7_t *ctx)
Get PWM input function.
void c6dofimu7_default_cfg(c6dofimu7_t *ctx)
Click Default Configuration function.
Sensor axis structure.
Definition c6dofimu7.h:120
float z_axis
Definition c6dofimu7.h:123
float x_axis
Definition c6dofimu7.h:121
float y_axis
Definition c6dofimu7.h:122
Click configuration structure definition.
Definition c6dofimu7.h:151
pin_name_t int1
Definition c6dofimu7.h:160
pin_name_t int2
Definition c6dofimu7.h:159
uint32_t i2c_speed
Definition c6dofimu7.h:164
pin_name_t scl
Definition c6dofimu7.h:154
pin_name_t sda
Definition c6dofimu7.h:155
uint8_t i2c_address
Definition c6dofimu7.h:165
Click ctx object definition.
Definition c6dofimu7.h:131
digital_in_t int2
Definition c6dofimu7.h:134
digital_in_t int1
Definition c6dofimu7.h:135
i2c_master_t i2c
Definition c6dofimu7.h:139
uint8_t slave_address
Definition c6dofimu7.h:143