source: trunk/fw_g473rct/SES/src/ltc_current.c@ 66

Last change on this file since 66 was 63, checked in by f.jahn, 5 weeks ago

Added LTC IC files.

File size: 2.1 KB
Line 
1/******************************************************************************
2*
3* @file ltc_current.c
4* @author ECS, Falko Jahn
5* @version V1.0.0
6* @date 2026-03-21
7* @brief
8*
9******************************************************************************/
10
11// --- INCLUDES -----------------------------------------------------------------
12#include "sysdata.h"
13#include "ltc_current.h"
14
15// --- EXTERNE VARIABLEN --------------------------------------------------------
16
17// --- LOKALE DEFINES - bitte hier dokumentieren --------------------------------
18
19// --- LOKALE TYPE DEFS - bitte hier dokumentieren-------------------------------
20
21// --- DEFINITIONEN GLOBALER VARIABLEN - Bitte in Header dokumentieren ----------
22
23// --- LOKALE VARIABLEN - bitte hier dokumentieren ------------------------------
24
25// --- LOKALE FUNKTIONS PROTOTYPEN ----------------------------------------------
26
27// --- LOKALE FUNKTIONEN - bitte hier dokumentieren -----------------------------
28
29/*
30* @brief
31* @param kein
32* @retval kein
33*/
34
35// --- GLOBALE FUNKTIONEN - bitte in Header dokumentieren------------------------
36
37void LTC_CURRENT_Exec(int32_t adcval, int32_t adcval2)
38{
39 double temp1, temp2;
40
41
42 //Umrechnung Spannung in mV
43 temp1 = (adcval * VREF ) / 65536.0;
44 temp2 = (adcval2 * VREF ) / 65536.0;
45
46
47 //Umrechnung in °C mit LM61 Sensor
48 temp1 = temp1 * 600; //6 / 20 / 0.0005;
49 temp2 = temp2 * 600; //6 / 20 / 0.0005;
50
51 //2Nackommastellen
52 //milli grad in grad * 100 /festkomma
53 sys_data.s.values.ltc_discharge_current = temp1;
54 sys_data.s.values.ltc_charge_current = temp2;
55
56
57 if(sys_data.s.values.ltc_discharge_current > sys_data.s.values.ltc_discharge_current_max)
58 {
59 sys_data.s.values.ltc_discharge_current_max = sys_data.s.values.ltc_discharge_current;
60 }
61
62 if(sys_data.s.values.ltc_charge_current > sys_data.s.values.ltc_charge_current_max)
63 {
64 sys_data.s.values.ltc_charge_current_max = sys_data.s.values.ltc_charge_current;
65 }
66
67
68
69}
70/*************************** End of file ****************************/
Note: See TracBrowser for help on using the repository browser.