GlobLib
HAL and API libraries for MCUs and hardware.
mpu6050.h File Reference

Header file for Invensence IMU MPU6050. More...

#include <stdio.h>

Go to the source code of this file.

Data Structures

struct  MPU6050
 Data structure containing variables specific to individual slave devices. More...
 

Macros

#define MPU_DEVICE_ADDRESS   0x68
 Standard slave address for the module (ADD -> GND).
 
#define MPU_DEVICE_ADDRESS_ALTERNATE   0x69
 Altenate slave address for the module (ADD -> VCC).
 
#define MPU_DATA_RANGE   32767.0f
 The decimal rangle of the ADC (15-bit <=> 32767).
 

Enumerations

Functions

uint8_t MPU6050_setup (MPU6050 *target, uint8_t i2c_number, uint8_t address)
 Initalizes the slave device and populates data structure variable. More...
 
void MPU6050_writeByte (MPU6050 *target, uint8_t address, uint8_t data)
 Writes a single byte to a given address. More...
 
uint8_t MPU6050_readByte (MPU6050 *target, uint8_t address)
 Read a single byte from a given address. More...
 
uint16_t MPU6050_readHalf (MPU6050 *target, uint8_t address)
 Read a half word from a given address. More...
 
void MPU6050_raw (MPU6050 *target, mpu_data what, int16_t *container)
 Get raw data values (16-bit each) More...
 
void MPU6050_calc (MPU6050 *target, mpu_data what, float *container)
 Get calculated data values. More...
 
void MPU6050_setAcc (MPU6050 *target, mpu_acc range)
 Set acceleration range. More...
 
void MPU6050_setGyr (MPU6050 *target, mpu_gyr range)
 Set gyroscope range. More...
 
uint8_t MPU6050_getAcc (MPU6050 *target)
 Get the acceleration range. More...
 
uint16_t MPU6050_getGyr (MPU6050 *target)
 Get the gyroscope range. More...
 

Detailed Description

Header file for Invensence IMU MPU6050.

Definition in file mpu6050.h.