2015-12-31 13:02:30 -08:00
|
|
|
/**
|
2018-01-21 13:11:39 -08:00
|
|
|
* @file map.h
|
|
|
|
*
|
2020-01-13 18:57:43 -08:00
|
|
|
* @author Andrey Belomutskiy, (c) 2012-2020
|
2015-12-31 13:02:30 -08:00
|
|
|
*/
|
2020-01-20 22:40:11 -08:00
|
|
|
|
|
|
|
#pragma once
|
2015-07-10 06:01:56 -07:00
|
|
|
|
2020-12-30 05:43:49 -08:00
|
|
|
|
|
|
|
struct air_pressure_sensor_config_s;
|
2015-07-10 06:01:56 -07:00
|
|
|
|
2021-11-16 01:15:29 -08:00
|
|
|
void initMapDecoder();
|
2015-07-10 06:01:56 -07:00
|
|
|
|
2019-11-22 20:27:24 -08:00
|
|
|
#define KPA_PER_PSI 6.89475728f
|
2018-01-21 13:11:39 -08:00
|
|
|
|
2020-10-27 22:01:54 -07:00
|
|
|
#define PSI2KPA(psi) (KPA_PER_PSI * (psi))
|
|
|
|
|
2020-10-31 21:33:18 -07:00
|
|
|
#define BAR2KPA(bar) (100 * (bar))
|
2020-11-22 22:10:12 -08:00
|
|
|
#define KPA2BAR(kpa) (0.01f * (kpa))
|
2020-10-31 21:33:18 -07:00
|
|
|
|
2018-01-21 13:11:39 -08:00
|
|
|
// PSI (relative to atmosphere) to kPa (relative to vacuum)
|
2020-10-27 22:01:54 -07:00
|
|
|
#define PSI2KPA_RELATIVE(psi) (101.32500411216164f + PSI2KPA(psi))
|
2018-01-21 13:11:39 -08:00
|
|
|
|
2020-11-22 22:10:12 -08:00
|
|
|
#define INHG2KPA(inhg) ((inhg) * 3.386375f)
|
|
|
|
#define KPA2INHG(kpa) ((kpa) / 3.386375f)
|
2016-06-26 11:01:41 -07:00
|
|
|
|