core/accelerometer/accelero.c File Reference

#include "sceptre.h"
#include "accelero.h"

Go to the source code of this file.

Defines

#define ADC_START_CONVERSION   AD0CR |= (1<<24)
#define ADC_STOP_CONVERSION   AD0CR &= 0xf8ffffff
#define ADC_CHANNEL_123   0x0000000e
#define ADC_GDR_DONE   (1<<31)

Functions

void accelero_init (int adc_clock)
void accelero_sleep (int sleep)
float accelero_read_one (int channel)
int accelero_read (float *p_dst)

Detailed Description

Low-level accelerometer driver implementation.

Definition in file accelero.c.


Function Documentation

void accelero_init ( int  adc_clock  ) 

Initialize the accelerometer.

Parameters:
adc_clock Clock frequency of the A/D converter.

Definition at line 38 of file accelero.c.

int accelero_read ( float *  p_dst  ) 

Read all channels of the accelerometer.

Parameters:
p_dst Address to write the accelerometer data to.
Returns:
The number of bytes written.

Definition at line 90 of file accelero.c.

float accelero_read_one ( int  channel  ) 

Read one channel of the accelerometer.

Parameters:
channel Accelerometer channel to read.
Returns:
The value of the accelerometer channel.

Definition at line 70 of file accelero.c.

void accelero_sleep ( int  sleep  ) 

Control the accelerometer's sleep mode.

Parameters:
sleep ACCELEROMETER_OFF or ACCELEROMETER_ON

Definition at line 57 of file accelero.c.

 All Data Structures Files Functions Variables Typedefs Enumerations Defines

Generated by  doxygen 1.6.2