42#ifdef PREINIT_SUPPORTED
46#ifdef MikroCCoreVersion
47 #if MikroCCoreVersion >= 1
52#include "drv_digital_out.h"
53#include "drv_digital_in.h"
54#include "drv_i2c_master.h"
67#define LSM303AGR_MAP_MIKROBUS( cfg, mikrobus ) \
68 cfg.scl = MIKROBUS( mikrobus, MIKROBUS_SCL ); \
69 cfg.sda = MIKROBUS( mikrobus, MIKROBUS_SDA ); \
70 cfg.int_pin = MIKROBUS( mikrobus, MIKROBUS_INT )
77#define LSM303AGR_RETVAL uint8_t
79#define LSM303AGR_OK 0x00
80#define LSM303AGR_INIT_ERROR 0xFF
#define LSM303AGR_RETVAL
Definition lsm303agr.h:77
void lsm303agr_default_cfg(lsm303agr_t *ctx)
Click Default Configuration function.
float lsm303agr_get_acc_axis_x(lsm303agr_t *ctx)
Reading the raw X axis data and calculating the value :
float lsm303agr_get_mag_axis_x(lsm303agr_t *ctx)
Reading the raw X axis data and calculating the value :
void lsm303agr_read_data(lsm303agr_t *ctx, uint8_t reg_addr, uint8_t *read_buf, uint8_t read_len)
Generic read data function.
float lsm303agr_get_mag_axis_y(lsm303agr_t *ctx)
Reading the raw Y axis data and calculating the value :
void lsm303agr_cfg_setup(lsm303agr_cfg_t *cfg)
Config Object Initialization function.
void lsm303agr_accelerometer_init(lsm303agr_t *ctx)
Accelerometer init.
float lsm303agr_get_acc_axis_z(lsm303agr_t *ctx)
Reading the raw Z axis data and calculating the value :
LSM303AGR_RETVAL lsm303agr_init(lsm303agr_t *ctx, lsm303agr_cfg_t *cfg)
Initialization function.
void lsm303agr_magnetometer_init(lsm303agr_t *ctx)
Magnetometer init.
void lsm303agr_write_data(lsm303agr_t *ctx, uint8_t reg_addr, uint8_t *write_buf, uint8_t write_len)
Generic write data function.
float lsm303agr_get_mag_axis_z(lsm303agr_t *ctx)
Reading the raw Z axis data and calculating the value :
float lsm303agr_get_acc_axis_y(lsm303agr_t *ctx)
Reading the raw Y axis data and calculating the value :
Click configuration structure definition.
Definition lsm303agr.h:113
uint32_t i2c_speed
Definition lsm303agr.h:125
pin_name_t scl
Definition lsm303agr.h:116
pin_name_t int_pin
Definition lsm303agr.h:121
pin_name_t sda
Definition lsm303agr.h:117
uint8_t i2c_address
Definition lsm303agr.h:126
Click ctx object definition.
Definition lsm303agr.h:94
digital_in_t int_pin
Definition lsm303agr.h:97
i2c_master_t i2c
Definition lsm303agr.h:101
uint8_t slave_address
Definition lsm303agr.h:105