projet_voilier/keil_project/Services/Accelerometer.h
2020-11-15 18:21:34 +01:00

39 lines
1.1 KiB
C

/**
******************************************************************************
* @file Accelerometer.h
* @author GALLOIS, Leonie and GÜLDENSTEIN, Jasper and FOUSSATS, Morgane
* @brief Service for reading the analog signals of the Accelerometer.
******************************************************************************
*/
#ifndef ACCELERO_H
#define ACCELERO_H
/**
* @brief Initializes for reading the Accelerometer
* Peripherals used: ADC1
* Pins used: PC0 (Analog Input, X channel accelerometer)
* Pins used: PC1 (Analog Input, Y channel accelerometer)
*/
void ACCELEROMETER_Init(void);
/**
* @brief Reads the accelerometer x channel
* @retval acceleration in x direction in g
*/
double ACCELEROMETER_GetX(void);
/**
* @brief Reads the accelerometer y channel
* @retval acceleration in y direction in g
*/
double ACCELEROMETER_GetY(void);
/**
* @brief Reads the accelerometer x and y channel
Calculates if the roll angle lies between -40 and 40 degrees
* @retval state (0 or 1)
*/
int ACCELEROMETER_AngleGood(void);
#endif