Rev 0 - 06/11/2012 RLEG project - 2012. More...
#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/ioctl.h>
#include <fcntl.h>
#include <linux/i2c-dev.h>
#include "imu_regs.h"
Go to the source code of this file.
Macros | |
#define | ASCII_0 0x30 |
#define | SUCCESS 1 |
#define | FAILURE -1 |
#define | ADD_ADXL345 0x53 |
#define | ADD_ITG3200 0x68 |
#define | ADD_HMC5883 0x1E |
Functions | |
int | acc_write_reg (int i2c_dev, uint8_t reg, uint8_t data) |
WRITE TO REGISTER. More... | |
uint8_t * | acc_read_reg (int i2c_dev, uint8_t reg, uint8_t count) |
READ COUNT 8-BIT REGISTER IN SEQUENCE More... | |
int | acc_init (int i2c_dev, uint8_t full_res, uint16_t rate, uint8_t range) |
INITIALIZE ACCELEROMETER. More... | |
int | acc_read_all_data (int i2c_dev, short int *data) |
READ ALL DATA AT ONCE (X, Y and Z) More... | |
short int | acc_read_data (int i2c_dev, int axis) |
READ DATA (X, Y or Z) More... | |
char * | conv_byte_hex_bin (uint8_t *hvalue) |
int | acc_read_all_reg (int i2c_dev) |
Read all accelerometer data and print in stdio. More... | |
int | gyr_write_reg (int i2c_dev, uint8_t reg, uint8_t data) |
WRITE TO REGISTER. More... | |
uint8_t * | gyr_read_reg (int i2c_dev, uint8_t reg, uint8_t count) |
READ COUNT 8-BIT REGISTER IN SEQUENCE. More... | |
int | gyr_init (int i2c_dev, float rate, short int lpf_bw, char clk_source, char *act) |
INITIALIZE GYROMETER. More... | |
int | gyr_read_all_data (int i2c_dev, short int *data) |
READ ALL DATA AT ONCE (X, Y, Z and T) More... | |
short int | gyr_read_data (int i2c_dev, int type) |
READ DATA (X, Y, Z or T) More... | |
int | mag_write_reg (int i2c_dev, uint8_t reg, uint8_t data) |
WRITE TO REGISTER. More... | |
uint8_t * | mag_read_reg (int i2c_dev, uint8_t reg, uint8_t count) |
READ COUNT 8-BIT REGISTER IN SEQUENCE. More... | |
int | mag_init (int i2c_dev, uint8_t rate, uint8_t range, uint8_t samples_avg, uint8_t meas_mode, uint8_t op_mode) |
INITIALIZE MAGNETOMETER. More... | |
int | mag_read_all_data (int i2c_dev, short int *data) |
READ ALL DATA AT ONCE (X, Y and Z) More... | |
short int | mag_read_data (int i2c_dev, int axis) |
READ DATA (X, Y or Z) More... | |
Rev 0 - 06/11/2012 RLEG project - 2012.
library of the I2C communication between Gumstix Overo Fire and 3 different devices: ADXL345, ITG3200 and HMC5883
Definition in file imu_functions.h.
#define ADD_ADXL345 0x53 |
Definition at line 36 of file imu_functions.h.
Referenced by devices_init(), and read_all_data().
#define ADD_HMC5883 0x1E |
Definition at line 38 of file imu_functions.h.
Referenced by devices_init(), and read_all_data().
#define ADD_ITG3200 0x68 |
Definition at line 37 of file imu_functions.h.
Referenced by devices_init(), and read_all_data().
#define ASCII_0 0x30 |
Definition at line 27 of file imu_functions.h.
Referenced by conv_byte_hex_bin().
#define FAILURE -1 |
Definition at line 30 of file imu_functions.h.
#define SUCCESS 1 |
Definition at line 29 of file imu_functions.h.
char* conv_byte_hex_bin | ( | uint8_t * | hvalue | ) |
Definition at line 184 of file acc_functions.c.
Referenced by acc_read_all_reg().
int mag_init | ( | int | i2c_dev, |
uint8_t | rate, | ||
uint8_t | range, | ||
uint8_t | samples_avg, | ||
uint8_t | meas_mode, | ||
uint8_t | op_mode | ||
) |
INITIALIZE MAGNETOMETER.
Definition at line 53 of file mag_functions.c.
References MAG_CONFIG_A, MAG_CONFIG_B, MAG_MODE, and mag_write_reg().
Referenced by devices_init().