Device driver for the L3G4200D gyroscope. More...

Detailed Description

Device driver for the L3G4200D gyroscope.

This driver provides [S]ensor [A]ctuator [U]ber [L]ayer capabilities.

Note
The current state of the driver only implements a very basic polling mode.

Modules

 L3G4200D gyroscope driver compile configuration
 

Files

file  l3g4200d.h
 Device driver interface for the L3G4200D gyroscope.
 
file  l3g4200d-regs.h
 Definitions for the L3G4200D gyroscope.
 
file  l3g4200d_params.h
 Default configuration for L3G4200D devices.
 

Data Structures

struct  l3g4200d_data_t
 Result vector for gyro measurement. More...
 
struct  l3g4200d_params_t
 Device initialization parameters. More...
 
struct  l3g4200d_t
 Device descriptor for L3G4200D sensors. More...
 

Enumerations

enum  l3g4200d_scale_t { L3G4200D_SCALE_250DPS = 0x0, L3G4200D_SCALE_500DPS = 0x1, L3G4200D_SCALE_2000DPS = 0x2 }
 Measurement scale for the gyro. More...
 
enum  l3g4200d_mode_t {
  L3G4200D_MODE_100_12 = 0x0, L3G4200D_MODE_100_25 = 0x1, L3G4200D_MODE_200_12 = 0x4, L3G4200D_MODE_200_25 = 0x5,
  L3G4200D_MODE_200_50 = 0x6, L3G4200D_MODE_200_70 = 0x7, L3G4200D_MODE_400_20 = 0x8, L3G4200D_MODE_400_25 = 0x9,
  L3G4200D_MODE_400_50 = 0xa, L3G4200D_MODE_400_110 = 0xb, L3G4200D_MODE_800_30 = 0xc, L3G4200D_MODE_800_35 = 0xd,
  L3G4200D_MODE_800_50 = 0xe, L3G4200D_MODE_800_110 = 0xf
}
 Sampling frequency and bandwidth settings for the gyro. More...
 

Functions

int l3g4200d_init (l3g4200d_t *dev, const l3g4200d_params_t *params)
 Initialize a gyro. More...
 
int l3g4200d_read (const l3g4200d_t *dev, l3g4200d_data_t *acc_data)
 Read angular speed value in degree per second from gyro. More...
 
int l3g4200d_enable (const l3g4200d_t *dev)
 Power-up the given device. More...
 
int l3g4200d_disable (const l3g4200d_t *dev)
 Power-down the given device. More...
 

Enumeration Type Documentation

◆ l3g4200d_mode_t

Sampling frequency and bandwidth settings for the gyro.

Enumerator
L3G4200D_MODE_100_12 

data rate: 100Hz, cut-off: 12.5Hz

L3G4200D_MODE_100_25 

data rate: 100Hz, cut-off: 25Hz

L3G4200D_MODE_200_12 

data rate: 200Hz, cut-off: 12.5Hz

L3G4200D_MODE_200_25 

data rate: 200Hz, cut-off: 25Hz

L3G4200D_MODE_200_50 

data rate: 200Hz, cut-off: 50Hz

L3G4200D_MODE_200_70 

data rate: 200Hz, cut-off: 70Hz

L3G4200D_MODE_400_20 

data rate: 400Hz, cut-off: 20Hz

L3G4200D_MODE_400_25 

data rate: 400Hz, cut-off: 25Hz

L3G4200D_MODE_400_50 

data rate: 400Hz, cut-off: 50Hz

L3G4200D_MODE_400_110 

data rate: 400Hz, cut-off: 110Hz

L3G4200D_MODE_800_30 

data rate: 800Hz, cut-off: 30Hz

L3G4200D_MODE_800_35 

data rate: 800Hz, cut-off: 35Hz

L3G4200D_MODE_800_50 

data rate: 800Hz, cut-off: 50Hz

L3G4200D_MODE_800_110 

data rate: 800Hz, cut-off: 110Hz

Definition at line 78 of file l3g4200d.h.

◆ l3g4200d_scale_t

Measurement scale for the gyro.

Enumerator
L3G4200D_SCALE_250DPS 

scale: 250 degree per second

L3G4200D_SCALE_500DPS 

scale: 500 degree per second

L3G4200D_SCALE_2000DPS 

scale: 2000 degree per second

Definition at line 69 of file l3g4200d.h.

Function Documentation

◆ l3g4200d_disable()

int l3g4200d_disable ( const l3g4200d_t dev)

Power-down the given device.

Parameters
[in]devdevice to power-down
Returns
0 on success
-1 on error

◆ l3g4200d_enable()

int l3g4200d_enable ( const l3g4200d_t dev)

Power-up the given device.

Parameters
[in]devdevice to enable
Returns
0 on success
-1 on error

◆ l3g4200d_init()

int l3g4200d_init ( l3g4200d_t dev,
const l3g4200d_params_t params 
)

Initialize a gyro.

Parameters
[out]devdevice descriptor of sensor to initialize
[in]paramsinitialization parameters
Returns
0 on success
-1 on error

◆ l3g4200d_read()

int l3g4200d_read ( const l3g4200d_t dev,
l3g4200d_data_t acc_data 
)

Read angular speed value in degree per second from gyro.

Parameters
[in]devdevice descriptor of gyro
[out]acc_dataresult vector in dps per axis
Returns
0 on success
-1 on error