Mercurial > public > ostc4
annotate Small_CPU/Inc/batteryCharger.h @ 794:bb37d4f3e50e
Restructure UART based sensor handling:
In the previous version every UART sensor instance had its own protocol handling instance (requests, timeout, errors). With the introduction of the multiplexer these functionalities had to be harmonized. E.g. only one errorhandling which is applied to all sensors. In the new structure the sensor communication is split into one function which takes care for the control needs of a sensor and one function which handles the incoming data. The functions behalf the same independend if the sensor are connected to multiplexer or directly to the OSTC.
Second big change in the external sensor concepts is that the data processing is no longer focussed at the three existing ADC channels. Every external sensor (up to 3 ADC and 4 UART) sensor has its own instance. If the ADC slots are not in use then they may be used for visiualization of UART sensors by creating a mirror instance but this is no longer a must.
author | Ideenmodellierer |
---|---|
date | Mon, 31 Jul 2023 19:46:29 +0200 |
parents | 1b995079c045 |
children | d32901746950 |
rev | line source |
---|---|
38 | 1 /** |
2 ****************************************************************************** | |
3 * @file batteryCharger.h | |
4 * @author heinrichs weikamp gmbh | |
5 * @date 09-Dec-2014 | |
6 * @version V0.0.1 | |
7 * @since 09-Dec-2014 | |
8 * @brief LTC4054 Standalone Linear Li-Ion Battery Charger | |
9 * | |
10 @verbatim | |
11 ============================================================================== | |
12 ##### How to use ##### | |
13 ============================================================================== | |
14 @endverbatim | |
15 ****************************************************************************** | |
16 * @attention | |
17 * | |
18 * <h2><center>© COPYRIGHT(c) 2015 heinrichs weikamp</center></h2> | |
19 * | |
20 ****************************************************************************** | |
21 */ | |
22 | |
23 /* Define to prevent recursive inclusion -------------------------------------*/ | |
24 #ifndef BATTERY_CHARGER_H | |
25 #define BATTERY_CHARGER_H | |
26 | |
27 #ifdef __cplusplus | |
28 extern "C" { | |
29 #endif | |
30 | |
31 /* Includes ------------------------------------------------------------------*/ | |
32 #include <stdint.h> | |
33 | |
662 | 34 #define CHARGE_IN_PIN GPIO_PIN_2 |
35 #define CHARGE_IN_GPIO_PORT GPIOC | |
36 #define CHARGE_IN_GPIO_ENABLE() __GPIOC_CLK_ENABLE() | |
37 | |
38 #define CHARGE_OUT_PIN GPIO_PIN_1 | |
39 #define CHARGE_OUT_GPIO_PORT GPIOC | |
40 #define CHARGE_OUT_GPIO_ENABLE() __GPIOC_CLK_ENABLE() | |
38 | 41 |
662 | 42 typedef enum |
43 { | |
44 Charger_NotConnected = 0, /* This is identified reading CHARGE_IN_PIN == HIGH */ | |
45 Charger_WarmUp, /* Charging started but counter did not yet reach a certain limit (used to debounce connect / disconnect events to avoid multiple increases of statistic charging cycle counter) */ | |
46 Charger_Active, /* Charging identified by CHARGE_IN_PIN == LOW for a certain time */ | |
47 Charger_Finished, | |
48 Charger_LostConnection, /* Intermediate state to debounce disconnecting events (including charging error state like over temperature) */ | |
49 Charger_ColdStart, /* Cold start condition => check if an loaded battery has been inserted */ | |
50 Charger_END | |
51 } chargerState_t; | |
52 | |
53 | |
54 uint8_t get_charge_status(void); | |
38 | 55 void init_battery_charger_status(void); |
662 | 56 void set_charge_state(chargerState_t newState); |
57 uint8_t get_charge_state(void); | |
38 | 58 void ReInit_battery_charger_status_pins(void); |
59 void DeInit_battery_charger_status_pins(void); | |
643
5149cd644fbc
Reimplemented charger status generation (deactivated):
Ideenmodellierer
parents:
38
diff
changeset
|
60 void battery_charger_get_status_and_contral_battery_gas_gauge(uint8_t cycleTimeBase); |
38 | 61 |
62 #ifdef __cplusplus | |
63 } | |
64 #endif | |
65 | |
66 #endif /* BATTERY_CHARGER_H */ | |
67 | |
68 /************************ (C) COPYRIGHT heinrichs weikamp *****END OF FILE****/ |