ChibiOS/EX  1.2.0
lsm303agr.c File Reference

LSM303AGR MEMS interface module code. More...

#include "hal.h"
#include "lsm303agr.h"

Go to the source code of this file.

Enumerations

enum  lsm303agr_sad_t { LSM303AGR_SAD_ACC = 0x19, LSM303AGR_SAD_COMP = 0x1E }
 Accelerometer and Compass Slave Address. More...
 

Functions

static msg_t lsm303agrI2CReadRegister (I2CDriver *i2cp, lsm303agr_sad_t sad, uint8_t reg, uint8_t *rxbuf, size_t n)
 Reads registers value using I2C. More...
 
static msg_t lsm303agrI2CWriteRegister (I2CDriver *i2cp, lsm303agr_sad_t sad, uint8_t *txbuf, size_t n)
 Writes a value into a register using I2C. More...
 
static size_t acc_get_axes_number (void *ip)
 Return the number of axes of the BaseAccelerometer. More...
 
static msg_t acc_read_raw (void *ip, int32_t axes[])
 Retrieves raw data from the BaseAccelerometer. More...
 
static msg_t acc_read_cooked (void *ip, float axes[])
 Retrieves cooked data from the BaseAccelerometer. More...
 
static msg_t acc_set_bias (void *ip, float *bp)
 Set bias values for the BaseAccelerometer. More...
 
static msg_t acc_reset_bias (void *ip)
 Reset bias values for the BaseAccelerometer. More...
 
static msg_t acc_set_sensivity (void *ip, float *sp)
 Set sensitivity values for the BaseAccelerometer. More...
 
static msg_t acc_reset_sensivity (void *ip)
 Reset sensitivity values for the BaseAccelerometer. More...
 
static msg_t acc_set_full_scale (LSM303AGRDriver *devp, lsm303agr_acc_fs_t fs)
 Changes the LSM303AGRDriver accelerometer fullscale value. More...
 
static size_t comp_get_axes_number (void *ip)
 Return the number of axes of the BaseCompass. More...
 
static msg_t comp_read_raw (void *ip, int32_t axes[])
 Retrieves raw data from the BaseCompass. More...
 
static msg_t comp_read_cooked (void *ip, float axes[])
 Retrieves cooked data from the BaseCompass. More...
 
static msg_t comp_set_bias (void *ip, float *bp)
 Set bias values for the BaseCompass. More...
 
static msg_t comp_reset_bias (void *ip)
 Reset bias values for the BaseCompass. More...
 
static msg_t comp_set_sensivity (void *ip, float *sp)
 Set sensitivity values for the BaseCompass. More...
 
static msg_t comp_reset_sensivity (void *ip)
 Reset sensitivity values for the BaseCompass. More...
 
void lsm303agrObjectInit (LSM303AGRDriver *devp)
 Initializes an instance. More...
 
void lsm303agrStart (LSM303AGRDriver *devp, const LSM303AGRConfig *config)
 Configures and activates LSM303AGR Complex Driver peripheral. More...
 
void lsm303agrStop (LSM303AGRDriver *devp)
 Deactivates the LSM303AGR Complex Driver peripheral. More...
 

Detailed Description

LSM303AGR MEMS interface module code.

Definition in file lsm303agr.c.