This repository has been archived on 2020-06-14. You can view files and clone it, but cannot push or open issues or pull requests.
Jonas Holmberg fcc0bd41ae Added some comments.
Added some comments to the barometer code. More will be added.
2016-11-08 09:25:52 +01:00

59 lines
1.9 KiB
C

/*
* barometer.h
*
* Created on: 18 okt. 2016
* Author: holmis
*/
#ifndef DRIVERS_BAROMETER_H_
#define DRIVERS_BAROMETER_H_
typedef enum {
CALCSTATE_D2_CALCULATION = 0, //Tell the sensor that we want to read D2
CALCSTATE_D2_READ, //Read D2 from the sensor
CALCSTATE_D1_CALCULATION, //Tell the sensor that we want to read D1
CALCSTATE_D1_READ, //Read D1 from the sensor
CALCSTATE_CALCULATE_PTA //preassure, temp, altidute calc
}calculationState;
/***********************************************************************
* BRIEF: Initializes the barometer.
* INFORMATION: Initializes the barometer and it needs to be called
* before anything else when using the barometer.
***********************************************************************/
bool barometer_init();
/***********************************************************************
* BRIEF: Resets the barometer.
* INFORMATION: Resets the barometer needs to be called after the init
***********************************************************************/
bool barometer_reset();
/***********************************************************************
* BRIEF:
* INFORMATION:
***********************************************************************/
void barometer_CaclulateValues();
/***********************************************************************
* BRIEF:
* INFORMATION:
***********************************************************************/
double barometer_GetCurrentPreassure();
/***********************************************************************
* BRIEF:
* INFORMATION:
***********************************************************************/
double barometer_GetCurrentTemperature();
/***********************************************************************
* BRIEF:
* INFORMATION:
***********************************************************************/
float barometer_GetCurrentAltitude();
#endif /* DRIVERS_BAROMETER_H_ */