[3] | 1 | /** |
---|
| 2 | ****************************************************************************** |
---|
| 3 | * @file sysdata.c |
---|
| 4 | * @author ECS, Falko Jahn |
---|
| 5 | * @version V1.0.0 |
---|
| 6 | * @date 30-Jan-2021 |
---|
| 7 | * @brief SYSTEM DATEN Modul |
---|
| 8 | * Beschreibung in Header |
---|
| 9 | ****************************************************************************** |
---|
| 10 | */ |
---|
| 11 | |
---|
| 12 | // --- INCLUDES ---------------------------------------------------------------- |
---|
| 13 | #include "sysdata.h" |
---|
| 14 | #include "modbus.h" |
---|
| 15 | |
---|
| 16 | //--- GGF. EXTERNE VARIABLEN --------------------------------------------------- |
---|
| 17 | |
---|
| 18 | //--- LOKALE DEFINES - bitte hier dokumentieren -------------------------------- |
---|
| 19 | |
---|
| 20 | |
---|
| 21 | //--- LOKALE TYPE DEFS - bitte hier dokumentieren------------------------------- |
---|
| 22 | |
---|
| 23 | //--- DEFINATIONEN GLOBALER VARIABLEN - Bitte in Header dokumentieren ---------- |
---|
| 24 | sys_data_t sysData; |
---|
| 25 | |
---|
| 26 | |
---|
| 27 | //--- LOKALE VARIABLEN - bitte hier dokumentieren ------------------------------ |
---|
| 28 | |
---|
| 29 | |
---|
| 30 | //--- LOKALE FUNKTIONS PROTOTYPEN ---------------------------------------------- |
---|
| 31 | |
---|
| 32 | |
---|
| 33 | //--- LOKALE FUNKTIONEN - bitte hier dokumentieren ----------------------------- |
---|
| 34 | |
---|
| 35 | |
---|
| 36 | //--- GLOBALE FUNKTIONEN - bitte in Header dokumentieren------------------------ |
---|
| 37 | |
---|
| 38 | accessMode_t accessModeTable[MAX_ADRESS+1] = { |
---|
| 39 | ACCESS_MODE_READ_ONLY, //0 DEVICE_TYPE_ID |
---|
| 40 | ACCESS_MODE_READ_ONLY, //1 RESERVIERT |
---|
| 41 | ACCESS_MODE_WRITE_PROTECTABLE, //2 SN1 |
---|
| 42 | ACCESS_MODE_WRITE_PROTECTABLE, //3 SN2 |
---|
| 43 | ACCESS_MODE_READ_ONLY, //4 FW |
---|
| 44 | ACCESS_MODE_READ_ONLY, //5 FW |
---|
| 45 | ACCESS_MODE_READ_ONLY, //6 FW |
---|
| 46 | ACCESS_MODE_READ_ONLY, //7 RESERVIERT |
---|
| 47 | ACCESS_MODE_WRITE_PROTECTABLE, //8 BAUDRATE |
---|
| 48 | ACCESS_MODE_WRITE_PROTECTABLE, //9 BAUDRATE |
---|
| 49 | ACCESS_MODE_WRITE_PROTECTABLE, //10 PARITY MODE |
---|
| 50 | ACCESS_MODE_WRITE_PROTECTABLE, //11 STOPP_BITS |
---|
| 51 | ACCESS_MODE_READ_WRITE, //12 SLAVE_ADRESS |
---|
| 52 | ACCESS_MODE_READ_WRITE, //13 CMD |
---|
| 53 | ACCESS_MODE_READ_ONLY, //14 RESERVED |
---|
| 54 | ACCESS_MODE_READ_ONLY, //15 RESERVED |
---|
| 55 | ACCESS_MODE_READ_ONLY, //16 RESERVED |
---|
| 56 | ACCESS_MODE_READ_ONLY, //17 RESERVED |
---|
| 57 | ACCESS_MODE_READ_ONLY, //18 RESERVED |
---|
| 58 | ACCESS_MODE_READ_ONLY, //19 RESERVED |
---|
| 59 | ACCESS_MODE_WRITE_PROTECTABLE, //20 OVP ALARM |
---|
| 60 | ACCESS_MODE_WRITE_PROTECTABLE, //21 LVP ALARM |
---|
| 61 | ACCESS_MODE_WRITE_PROTECTABLE, //22 OVP START |
---|
| 62 | ACCESS_MODE_WRITE_PROTECTABLE, //23 OVP STOP |
---|
| 63 | ACCESS_MODE_WRITE_PROTECTABLE, //24 LVP START |
---|
| 64 | ACCESS_MODE_WRITE_PROTECTABLE, //25 LVP STOP |
---|
| 65 | ACCESS_MODE_WRITE_PROTECTABLE, //26 V SHUTDOWN START |
---|
| 66 | ACCESS_MODE_WRITE_PROTECTABLE, //27 V SHUTDOWN STOP |
---|
| 67 | ACCESS_MODE_WRITE_PROTECTABLE, //28 OT SHUTDOWN START |
---|
| 68 | ACCESS_MODE_WRITE_PROTECTABLE, //29 OT SHUTDOWN STOP |
---|
| 69 | ACCESS_MODE_WRITE_PROTECTABLE, //30 UTP CHARGE VSHUTDOWN START |
---|
| 70 | ACCESS_MODE_WRITE_PROTECTABLE, //31 UTP CHARGE SHUTDOWN STOP |
---|
| 71 | ACCESS_MODE_WRITE_PROTECTABLE, //32 UTP LOAD VSHUTDOWN START |
---|
| 72 | ACCESS_MODE_WRITE_PROTECTABLE, //33 UTP LOAD SHUTDOWN STOP |
---|
| 73 | ACCESS_MODE_WRITE_PROTECTABLE, //34 LVP TIME |
---|
| 74 | ACCESS_MODE_WRITE_PROTECTABLE, //35 DEFAULT BAL VOLTAGE |
---|
| 75 | ACCESS_MODE_WRITE_PROTECTABLE, //36 REF TEMP |
---|
| 76 | ACCESS_MODE_WRITE_PROTECTABLE, //37 OVP ALARM TEMPCO |
---|
| 77 | ACCESS_MODE_WRITE_PROTECTABLE, //38 LVP ALARM TEMPCO |
---|
| 78 | ACCESS_MODE_WRITE_PROTECTABLE, //39 OVP START TEMPCO |
---|
| 79 | ACCESS_MODE_WRITE_PROTECTABLE, //40 OVP STOPP TEMPCO |
---|
| 80 | ACCESS_MODE_WRITE_PROTECTABLE, //41 LVP START TEMPCO |
---|
| 81 | ACCESS_MODE_WRITE_PROTECTABLE, //42 LVP START TEMPCO |
---|
| 82 | ACCESS_MODE_WRITE_PROTECTABLE, //43 V SHUTDOWN START TEMPCO |
---|
| 83 | ACCESS_MODE_WRITE_PROTECTABLE, //44 V SHUTDOWN STOP TEMPCO |
---|
| 84 | ACCESS_MODE_WRITE_PROTECTABLE, //45 BALANCER VOLTAGE TEMPCO |
---|
| 85 | ACCESS_MODE_READ_WRITE, //46 Balancer voltage remote |
---|
| 86 | ACCESS_MODE_READ_ONLY, //47 WRITE LOCKED |
---|
| 87 | ACCESS_MODE_READ_ONLY, //48 KEY ACCEPTED |
---|
| 88 | ACCESS_MODE_READ_WRITE, //49 LOCK KEY |
---|
| 89 | ACCESS_MODE_WRITE_PROTECTABLE, //50 NEW LOCK KEY |
---|
| 90 | |
---|
| 91 | //Alle anderen sind 0 , also automatisch auf read only |
---|
| 92 | }; |
---|
| 93 | |
---|
| 94 | |
---|
| 95 | |
---|
| 96 | |
---|
| 97 | void SYSDATA_Init() |
---|
| 98 | { |
---|
| 99 | sysData.s.deviceTypeId = 103; //100: LiPro 1-x, 101: LiPro1-x active , 102 ist LiPro 1-x V2 |
---|
| 100 | sysData.s.fwMajor = 1; |
---|
| 101 | sysData.s.fwMinor = 0; |
---|
[10] | 102 | sysData.s.fwRevision = 3; |
---|
[3] | 103 | sysData.s.minVoltage = MIN_VOLTAGE_DEFAULT; |
---|
| 104 | sysData.s.maxVoltage = MAX_VOLTAGE_DEFAULT; |
---|
| 105 | sysData.s.minTemperature = MIN_TEMPERATURE_DEFAULT; |
---|
| 106 | sysData.s.maxTemperature = MAX_TEMPERATURE_DEFAULT; |
---|
| 107 | |
---|
| 108 | } |
---|