nRF51 SDK - S210 SoftDevice
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
MPU6050 gyro/accelerometer driver

MPU6050 gyro/accelerometer driver. More...

Functions

bool mpu6050_init (uint8_t device_address)
 Function for initializing MPU6050 and verifies it's on the bus. More...
 
bool mpu6050_register_write (uint8_t register_address, const uint8_t value)
 Function for writing a MPU6050 register contents over TWI. More...
 
bool mpu6050_register_read (uint8_t register_address, uint8_t *destination, uint8_t number_of_bytes)
 Function for reading MPU6050 register contents over TWI. Reads one or more consecutive registers. More...
 
bool mpu6050_verify_product_id (void)
 Function for reading and verifying MPU6050 product ID. More...
 

Detailed Description

MPU6050 gyro/accelerometer driver.

Function Documentation

bool mpu6050_init ( uint8_t  device_address)

Function for initializing MPU6050 and verifies it's on the bus.

Parameters
device_addressDevice TWI address in bits [6:0].
Returns
Return values
trueMPU6050 found on the bus and ready for operation.
falseMPU6050 not found on the bus or communication failure.
bool mpu6050_register_read ( uint8_t  register_address,
uint8_t *  destination,
uint8_t  number_of_bytes 
)

Function for reading MPU6050 register contents over TWI. Reads one or more consecutive registers.

Parameters
[in]register_addressRegister address to start reading from
[in]number_of_bytesNumber of bytes to read
[out]destinationPointer to a data buffer where read data will be stored
Return values
trueRegister read succeeded
falseRegister read failed
bool mpu6050_register_write ( uint8_t  register_address,
const uint8_t  value 
)

Function for writing a MPU6050 register contents over TWI.

Parameters
[in]register_addressRegister address to start writing to
[in]valueValue to write to register
Return values
trueRegister write succeeded
falseRegister write failed
bool mpu6050_verify_product_id ( void  )

Function for reading and verifying MPU6050 product ID.

Return values
trueProduct ID is what was expected
falseProduct ID was not what was expected