39#ifdef PREINIT_SUPPORTED
43#ifdef MikroCCoreVersion
44 #if MikroCCoreVersion >= 1
49#include "drv_digital_out.h"
50#include "drv_digital_in.h"
51#include "drv_i2c_master.h"
73#define ACCEL17_REG_ACCEL_CONFIG 0x00
74#define ACCEL17_REG_ACCEL_X_MSB 0x01
75#define ACCEL17_REG_ACCEL_X_LSB 0x02
76#define ACCEL17_REG_ACCEL_Y_MSB 0x03
77#define ACCEL17_REG_ACCEL_Y_LSB 0x04
95#define ACCEL17_TOEN_MASK 0x08
96#define ACCEL17_TOEN_DISABLE 0x00
97#define ACCEL17_TOEN_ENABLE 0x08
98#define ACCEL17_BGTST_MASK 0x04
99#define ACCEL17_BGTST_NORMAL 0x00
100#define ACCEL17_BGTST_BANDGAP 0x04
101#define ACCEL17_ST_MASK 0x02
102#define ACCEL17_ST_OFF 0x00
103#define ACCEL17_ST_ON 0x02
104#define ACCEL17_PD_MASK 0x01
105#define ACCEL17_PD_ON 0x00
106#define ACCEL17_PD_DOWN 0x01
112#define ACCEL17_OFFSET 2048
113#define ACCEL17_SENSITIVITY 512.0
114#define ACCEL17_DEGREE_RES 90
121#define ACCEL17_SET_DEV_ADDR 0x10
139#define ACCEL17_MAP_MIKROBUS( cfg, mikrobus ) \
140 cfg.scl = MIKROBUS( mikrobus, MIKROBUS_SCL ); \
141 cfg.sda = MIKROBUS( mikrobus, MIKROBUS_SDA );
accel17_return_value_t
Accel 17 Click return value data.
Definition accel17.h:190
@ ACCEL17_OK
Definition accel17.h:191
@ ACCEL17_ERROR
Definition accel17.h:192
err_t accel17_generic_write(accel17_t *ctx, uint8_t reg, uint8_t tx_data)
Accel 17 I2C writing function.
void accel17_cfg_setup(accel17_cfg_t *cfg)
Accel 17 configuration object setup function.
err_t accel17_init(accel17_t *ctx, accel17_cfg_t *cfg)
Accel 17 initialization function.
err_t accel17_default_cfg(accel17_t *ctx)
Accel 17 default configuration function.
err_t accel17_generic_read(accel17_t *ctx, uint8_t reg, uint8_t *rx_buf, uint8_t rx_len)
Accel 17 I2C reading function.
err_t accel17_get_axes_data(accel17_t *ctx, accel17_axes_t *axes)
Accel data reading.
Accel 17 Click axes data.
Definition accel17.h:179
float y
Definition accel17.h:181
float x
Definition accel17.h:180
Accel 17 Click configuration object.
Definition accel17.h:165
uint32_t i2c_speed
Definition accel17.h:169
pin_name_t scl
Definition accel17.h:166
pin_name_t sda
Definition accel17.h:167
uint8_t i2c_address
Definition accel17.h:170
Accel 17 Click context object.
Definition accel17.h:151
i2c_master_t i2c
Definition accel17.h:153
uint8_t slave_address
Definition accel17.h:156