annotate Small_CPU/Inc/batteryGasGauge.h @ 475:4b000e2386c2 Improve_Button_Sleep

Changed default values: Invalid pressure was signalled using the float 100.0 causing the OSTC to enter dive mode if for some I2C communication was disturbed during startup. The default value for button responsitivness was set to 85% without considering the needed HWOS transformation calculation. Applying that the value for 85% is 51 PowerOnReset is state is now identified using the same functionality as already introduced for the battery charge handling. Initialization of pressure sensor in case of I2C problems only if the initialization was not successfull before: The pressure sensor is reset via a I2C commend in case of a I2C error. A reset might be helpfull in case of a "hanging" ADC operation but that would not be indicated by a I2C problem => resetting the sensor in case of a I2C problem might cause (small) change of pressure value
author ideenmodellierer
date Tue, 12 May 2020 22:52:05 +0200
parents 2defc8cd93ce
children 1b995079c045
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2 ******************************************************************************
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3 * @file batteryGasGauge.h
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4 * @author heinrichs weikamp gmbh
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5 * @version V0.0.1
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6 * @date 09-Dec-2014
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
7 * @brief LTC2942
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
8 *
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
9 @verbatim
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
10 ==============================================================================
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
11 ##### How to use #####
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
12 ==============================================================================
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
13 @endverbatim
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
14 ******************************************************************************
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
15 * @attention
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
16 *
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
17 * <h2><center>&copy; COPYRIGHT(c) 2014 heinrichs weikamp</center></h2>
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
18 *
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
19 ******************************************************************************
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
20 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
21
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
22 /* Define to prevent recursive inclusion -------------------------------------*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
23 #ifndef BATTERY_GAS_GAUGE_H
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
24 #define BATTERY_GAS_GAUGE_H
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
25
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
26 #ifdef __cplusplus
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
27 extern "C" {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
28 #endif
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
29
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
30 /* Includes ------------------------------------------------------------------*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
31
330
2defc8cd93ce Added check of configuration.
ideenmodellierer
parents: 38
diff changeset
32 #include <stdint.h>
2defc8cd93ce Added check of configuration.
ideenmodellierer
parents: 38
diff changeset
33
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
34 void init_battery_gas_gauge(void);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
35
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
36 float get_voltage(void);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
37 float get_charge(void);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
39 void battery_gas_gauge_get_data(void);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
40 void battery_gas_gauge_set_charge_full(void);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
41 void battery_gas_gauge_set(float percentage);
330
2defc8cd93ce Added check of configuration.
ideenmodellierer
parents: 38
diff changeset
42 uint8_t battery_gas_gauge_CheckConfigOK(void);
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
43
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
44 #ifdef __cplusplus
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
45 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
46 #endif
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
47
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
48 #endif /* BATTERY_GAS_GAUGE_H */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
49
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
50 /************************ (C) COPYRIGHT heinrichs weikamp *****END OF FILE****/