32 #include <mraa/gpio.h> 36 #include "lsm303agr_defs.h" 54 mraa_i2c_context i2cACC;
55 mraa_i2c_context i2cMAG;
56 mraa_gpio_context gpioACC1;
57 mraa_gpio_context gpioACC2;
58 mraa_gpio_context gpioMAG;
61 LSM303AGR_POWER_MODE_T powerMode;
130 float *x,
float *y,
float *z);
145 float *x,
float *y,
float *z);
165 LSM303AGR_A_FS_T fs);
192 LSM303AGR_POWER_MODE_T mode);
205 LSM303AGR_POWER_MODE_T mode);
216 LSM303AGR_A_ODR_T odr);
227 LSM303AGR_CFG_A_M_ODR_T odr);
335 LSM303AGR_INTERRUPT_PINS_T intr,
336 int gpio, mraa_gpio_edge_t level,
337 void (*isr)(
void *),
void *arg);
347 LSM303AGR_INTERRUPT_PINS_T intr);
367 uint8_t *buffer,
int len);
378 uint8_t reg, uint8_t val);
int lsm303agr_read_regs(const lsm303agr_context dev, uint8_t reg, uint8_t *buffer, int len)
Definition: lsm303agr.c:487
void lsm303agr_get_magnetometer(const lsm303agr_context dev, float *x, float *y, float *z)
Definition: lsm303agr.c:546
upm_result_t lsm303agr_set_acc_odr(const lsm303agr_context dev, LSM303AGR_A_ODR_T odr)
Definition: lsm303agr.c:574
upm_result_t lsm303agr_set_acc_int1_config(const lsm303agr_context dev, uint8_t bits)
Definition: lsm303agr.c:620
void lsm303agr_close(lsm303agr_context dev)
Definition: lsm303agr.c:144
uint8_t lsm303agr_get_mag_int_src(const lsm303agr_context dev)
Definition: lsm303agr.c:702
uint8_t lsm303agr_get_acc_int2_src(const lsm303agr_context dev)
Definition: lsm303agr.c:692
upm_result_t lsm303agr_install_isr(const lsm303agr_context dev, LSM303AGR_INTERRUPT_PINS_T intr, int gpio, mraa_gpio_edge_t level, void(*isr)(void *), void *arg)
Definition: lsm303agr.c:712
upm_result_t lsm303agr_set_power_mode(const lsm303agr_context dev, LSM303AGR_POWER_MODE_T mode)
Definition: lsm303agr.c:256
upm_result_t lsm303agr_update(const lsm303agr_context dev)
Definition: lsm303agr.c:414
void lsm303agr_get_accelerometer(const lsm303agr_context dev, float *x, float *y, float *z)
Definition: lsm303agr.c:561
upm_result_t lsm303agr_set_acc_int2_config(const lsm303agr_context dev, uint8_t bits)
Definition: lsm303agr.c:644
upm_result_t lsm303agr_set_mag_int_config(const lsm303agr_context dev, uint8_t bits)
Definition: lsm303agr.c:668
Definition: lsm303agr.h:53
struct _lsm303agr_context * lsm303agr_context
upm_result_t lsm303agr_write_reg(const lsm303agr_context dev, uint8_t reg, uint8_t val)
Definition: lsm303agr.c:510
upm_result_t lsm303agr_set_full_scale(const lsm303agr_context dev, LSM303AGR_A_FS_T fs)
Definition: lsm303agr.c:315
uint8_t lsm303agr_get_mag_int_config(const lsm303agr_context dev)
Definition: lsm303agr.c:658
upm_result_t lsm303agr_devinit(const lsm303agr_context dev, LSM303AGR_POWER_MODE_T mode)
Definition: lsm303agr.c:160
float lsm303agr_get_temperature(const lsm303agr_context dev)
Definition: lsm303agr.c:536
uint8_t lsm303agr_get_acc_int2_config(const lsm303agr_context dev)
Definition: lsm303agr.c:634
void lsm303agr_uninstall_isr(const lsm303agr_context dev, LSM303AGR_INTERRUPT_PINS_T intr)
Definition: lsm303agr.c:758
lsm303agr_context lsm303agr_init(int bus, int acc_addr, int mag_addr)
Definition: lsm303agr.c:47
upm_result_t lsm303agr_set_mag_odr(const lsm303agr_context dev, LSM303AGR_CFG_A_M_ODR_T odr)
Definition: lsm303agr.c:592
uint8_t lsm303agr_read_reg(const lsm303agr_context dev, uint8_t reg)
Definition: lsm303agr.c:463
uint8_t lsm303agr_get_acc_int1_src(const lsm303agr_context dev)
Definition: lsm303agr.c:682
uint8_t lsm303agr_get_acc_int1_config(const lsm303agr_context dev)
Definition: lsm303agr.c:610