xyControl  0.1
Quadrotor Flight Controller on AVR Basis
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Groups
Macros | Functions | Variables
mag.c File Reference

LSM303DLHC Magnetometer API Implementation. More...

#include <avr/io.h>
#include <stdint.h>
#include <stdlib.h>
#include <twi.h>
#include <mag.h>
#include <error.h>
#include <config.h>

Go to the source code of this file.

Macros

#define MAGREG_CRB   0x01
 Magnetometer Gain Register. More...
 
#define MAGREG_MR   0x02
 Magnetometer Mode Register. More...
 
#define MAGREG_XH   0x03
 First Magnetometer Output Register. More...
 

Functions

Error magWriteRegister (uint8_t reg, uint8_t val)
 Write a Magnetometer Register. More...
 
Error magInit (MagRange r)
 Initialize the Magnetometer. More...
 
Error magRead (Vector3f *v)
 Read from the Magnetometer. More...
 

Variables

MagRange magRange
 Stored range to scale returned values. More...
 

Detailed Description

LSM303DLHC Magnetometer API Implementation.

Definition in file mag.c.