Commit 2c105d52 authored by Christian Sponfeldner's avatar Christian Sponfeldner

Merge branch 'feat/new_object_for_can_powerbus' into 'master'

Feat/new object for can powerbus

See merge request nathan/Powermanagement-for-NATHAN!2
parents a74d739e 5503120c
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>EB-NTH-PB-25A-20A</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name>
<triggers>clean,full,incremental,</triggers>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder</name>
<triggers>full,incremental,</triggers>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.cdt.core.cnature</nature>
<nature>org.eclipse.cdt.core.ccnature</nature>
<nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature>
<nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature>
</natures>
</projectDescription>
......@@ -54,7 +54,6 @@
#pragma once
#include "../../../MCU/Inc/main.h"
/*******************************************************************************
CANopen DATA TYPES
*******************************************************************************/
......@@ -96,10 +95,10 @@
/*******************************************************************************
FILE INFO:
FileName: EB-NTH-PB-25A-20A.eds
FileName: new_EB-NTH-PB-25A-20A.dcf
FileVersion: 0
CreationTime: 1:04PM
CreationDate: 08-28-2018
CreationTime: 11:02AM
CreationDate: 05-21-2019
CreatedBy: Johannes Geier
******************************************************************************/
......@@ -130,7 +129,7 @@
/*******************************************************************************
OBJECT DICTIONARY
*******************************************************************************/
#define CO_OD_NoOfElements 77
#define CO_OD_NoOfElements 79
/*******************************************************************************
......@@ -226,7 +225,6 @@
INTEGER32 PCBTemperature_0_1degC;
UNSIGNED32 powermanagementState;
UNSIGNED32 powermanagementAlerts;
BOOLEAN CAN24V_PowerbusQSwitch;
} OD_powermanagement_t;
/*6110 */ typedef struct {
UNSIGNED8 maxSubIndex;
......@@ -295,6 +293,11 @@
UNSIGNED8 maxSubIndex;
UNSIGNED8 intensitySetpoint_percent;
} OD_FAN2_t;
/*6122 */ typedef struct {
UNSIGNED8 maxSubIndex;
BOOLEAN QSwitch;
UNSIGNED8 outputState;
} OD_connector24VCANopenLogicSupply_t;
/*6200 */ typedef struct {
UNSIGNED8 maxSubIndex;
INTEGER16 batteryMeasuredVoltage_mV;
......@@ -401,6 +404,11 @@
UNSIGNED8 intensityMaximum_percent;
UNSIGNED8 intensityMinimum_percent;
} OD_FAN2Parameters_t;
/*7122 */ typedef struct {
UNSIGNED8 maxSubIndex;
BOOLEAN enable;
BOOLEAN startupDefault;
} OD_connector24VCANopenLogicSupplyParameters_t;
/*7200 */ typedef struct {
UNSIGNED8 maxSubIndex;
INTEGER16 batteryCC_Offset;
......@@ -794,7 +802,6 @@
#define OD_6100_6_powermanagement_PCBTemperature_0_1degC 6
#define OD_6100_7_powermanagement_powermanagementState 7
#define OD_6100_8_powermanagement_powermanagementAlerts 8
#define OD_6100_9_powermanagement_CAN24V_PowerbusQSwitch 9
/*6110 */
#define OD_6110_connectorMotor1 0x6110
......@@ -887,6 +894,13 @@
#define OD_6121_0_FAN2_maxSubIndex 0
#define OD_6121_1_FAN2_intensitySetpoint_percent 1
/*6122 */
#define OD_6122_connector24VCANopenLogicSupply 0x6122
#define OD_6122_0_connector24VCANopenLogicSupply_maxSubIndex 0
#define OD_6122_1_connector24VCANopenLogicSupply_QSwitch 1
#define OD_6122_2_connector24VCANopenLogicSupply_outputState 2
/*6200 */
#define OD_6200_calibration 0x6200
......@@ -1023,6 +1037,13 @@
#define OD_7121_2_FAN2Parameters_intensityMaximum_percent 2
#define OD_7121_3_FAN2Parameters_intensityMinimum_percent 3
/*7122 */
#define OD_7122_connector24VCANopenLogicSupplyParameters 0x7122
#define OD_7122_0_connector24VCANopenLogicSupplyParameters_maxSubIndex 0
#define OD_7122_1_connector24VCANopenLogicSupplyParameters_enable 1
#define OD_7122_2_connector24VCANopenLogicSupplyParameters_startupDefault 2
/*7200 */
#define OD_7200_calibrationParameters 0x7200
......@@ -1102,6 +1123,7 @@ struct sCO_OD_RAM{
/*6119 */ OD_connector5VExtension2_t connector5VExtension2;
/*6120 */ OD_FAN1_t FAN1;
/*6121 */ OD_FAN2_t FAN2;
/*6122 */ OD_connector24VCANopenLogicSupply_t connector24VCANopenLogicSupply;
/*6200 */ OD_calibration_t calibration;
/*8000 */ OD_testbench_t testbench;
......@@ -1134,6 +1156,7 @@ struct sCO_OD_EEPROM{
/*7119 */ OD_connector5VExtension2Parameters_t connector5VExtension2Parameters;
/*7120 */ OD_FAN1Parameters_t FAN1Parameters;
/*7121 */ OD_FAN2Parameters_t FAN2Parameters;
/*7122 */ OD_connector24VCANopenLogicSupplyParameters_t connector24VCANopenLogicSupplyParameters;
/*7200 */ OD_calibrationParameters_t calibrationParameters;
UNSIGNED32 LastWord;
......@@ -1327,6 +1350,9 @@ extern struct sCO_OD_EEPROM CO_OD_EEPROM;
/*6121, Data Type: FAN2_t */
#define OD_FAN2 CO_OD_RAM.FAN2
/*6122, Data Type: connector24VCANopenLogicSupply_t */
#define OD_connector24VCANopenLogicSupply CO_OD_RAM.connector24VCANopenLogicSupply
/*6200, Data Type: calibration_t */
#define OD_calibration CO_OD_RAM.calibration
......@@ -1372,6 +1398,9 @@ extern struct sCO_OD_EEPROM CO_OD_EEPROM;
/*7121, Data Type: FAN2Parameters_t */
#define OD_FAN2Parameters CO_OD_EEPROM.FAN2Parameters
/*7122, Data Type: connector24VCANopenLogicSupplyParameters_t */
#define OD_connector24VCANopenLogicSupplyParameters CO_OD_EEPROM.connector24VCANopenLogicSupplyParameters
/*7200, Data Type: calibrationParameters_t */
#define OD_calibrationParameters CO_OD_EEPROM.calibrationParameters
......
......@@ -69,7 +69,7 @@ struct sCO_OD_ROM CO_OD_ROM = {
/*1007*/ 0x0000L,
/*1008*/ {'E', 'B', '-', 'N', 'T', 'H', '-', 'P', 'B', '-', '2', '5', 'A', '-', '2', '0', 'A'},
/*1009*/ {'W', '0', '0', '4'},
/*100a*/ {'1', '.', '0'},
/*100a*/ {'1', '.', '1'},
/*1016*/ {0x0000L, 0x0000L, 0x0000L, 0x0000L},
/*1018*/ {0x4L, 0x026cL, 0x005dL, 0x0004L, 0x0000L},
/*1019*/ 0x0L,
......@@ -113,7 +113,7 @@ struct sCO_OD_RAM CO_OD_RAM = {
/*2104*/ 0x00,
/*2107*/ {0x3e8, 0x00, 0x00, 0x00, 0x00},
/*6000*/ {0xdL, 0x0L, 0x0000L, 0x0000L, 0x0000L, 0x0L, 0x0000L, 0x0000L, 0x0000L, 0x0000L, 0x0000L, 0x0000L, 0x00, 0x0L},
/*6100*/ {0x9L, 0x0000L, 0x0000L, 0x0L, 0x0000L, 0x0L, 0x0000L, 0x0000L, 0x0000L, 0},
/*6100*/ {0x8L, 0x0000L, 0x0000L, 0x0L, 0x0000L, 0x0L, 0x0000L, 0x0000L, 0x0000L},
/*6110*/ {0x3L, 0, 0x0L, 0x0000L},
/*6111*/ {0x3L, 0, 0x0L, 0x0000L},
/*6112*/ {0x3L, 0, 0x0L, 0x0000L},
......@@ -126,6 +126,7 @@ struct sCO_OD_RAM CO_OD_RAM = {
/*6119*/ {0x2L, 0, 0x0L},
/*6120*/ {0x2L, 0x0L},
/*6121*/ {0x1L, 0x0L},
/*6122*/ {0x2L, 0, 0x0L},
/*6200*/ {0x5L, 0x00, 0x00, 0x00, 0x0L, 0x0L},
/*8000*/ {0x4L, 0x0L, 0x0L, 0x0L, 0x0L},
......@@ -159,6 +160,7 @@ struct sCO_OD_EEPROM CO_OD_EEPROM = {
/*7119*/ {0x2L, 0x1L, 0x1L},
/*7120*/ {0x3L, 0x1L, 0x64L, 0x0L},
/*7121*/ {0x3L, 0x1L, 0x64L, 0x0L},
/*7122*/ {0x2L, 1, 0},
/*7200*/ {0x8L, 0xfa87, 0xf3, 1864134.38, 1.5625, 0x1d, 0x2, 0x8bfb, 0x1L},
CO_OD_FIRST_LAST_WORD,
......@@ -380,7 +382,7 @@ struct sCO_OD_EEPROM CO_OD_EEPROM = {
{(void*)&CO_OD_RAM.battery.batteryFullcharge, 0x3e, 0x1 },
};
/*0x6100*/ const CO_OD_entryRecord_t OD_record6100[10] = {
/*0x6100*/ const CO_OD_entryRecord_t OD_record6100[9] = {
{(void*)&CO_OD_RAM.powermanagement.maxSubIndex, 0x06, 0x1 },
{(void*)&CO_OD_RAM.powermanagement.powerbusVoltage_mV, 0xa6, 0x4 },
{(void*)&CO_OD_RAM.powermanagement.batterySwitchTemperature_0_1degC, 0xa6, 0x4 },
......@@ -390,7 +392,6 @@ struct sCO_OD_EEPROM CO_OD_EEPROM = {
{(void*)&CO_OD_RAM.powermanagement.PCBTemperature_0_1degC, 0xa6, 0x4 },
{(void*)&CO_OD_RAM.powermanagement.powermanagementState, 0xbe, 0x4 },
{(void*)&CO_OD_RAM.powermanagement.powermanagementAlerts, 0xbe, 0x4 },
{(void*)&CO_OD_RAM.powermanagement.CAN24V_PowerbusQSwitch, 0x3e, 0x1 },
};
/*0x6110*/ const CO_OD_entryRecord_t OD_record6110[4] = {
......@@ -472,6 +473,12 @@ struct sCO_OD_EEPROM CO_OD_EEPROM = {
{(void*)&CO_OD_RAM.FAN2.intensitySetpoint_percent, 0x3e, 0x1 },
};
/*0x6122*/ const CO_OD_entryRecord_t OD_record6122[3] = {
{(void*)&CO_OD_RAM.connector24VCANopenLogicSupply.maxSubIndex, 0x06, 0x1 },
{(void*)&CO_OD_RAM.connector24VCANopenLogicSupply.QSwitch, 0x0e, 0x1 },
{(void*)&CO_OD_RAM.connector24VCANopenLogicSupply.outputState, 0x3e, 0x1 },
};
/*0x6200*/ const CO_OD_entryRecord_t OD_record6200[6] = {
{(void*)&CO_OD_RAM.calibration.maxSubIndex, 0x06, 0x1 },
{(void*)&CO_OD_RAM.calibration.batteryMeasuredVoltage_mV, 0x8e, 0x2 },
......@@ -593,6 +600,12 @@ struct sCO_OD_EEPROM CO_OD_EEPROM = {
{(void*)&CO_OD_EEPROM.FAN2Parameters.intensityMinimum_percent, 0x0f, 0x1 },
};
/*0x7122*/ const CO_OD_entryRecord_t OD_record7122[3] = {
{(void*)&CO_OD_EEPROM.connector24VCANopenLogicSupplyParameters.maxSubIndex, 0x07, 0x1 },
{(void*)&CO_OD_EEPROM.connector24VCANopenLogicSupplyParameters.enable, 0x0f, 0x1 },
{(void*)&CO_OD_EEPROM.connector24VCANopenLogicSupplyParameters.startupDefault, 0x0f, 0x1 },
};
/*0x7200*/ const CO_OD_entryRecord_t OD_record7200[9] = {
{(void*)&CO_OD_EEPROM.calibrationParameters.maxSubIndex, 0x07, 0x1 },
{(void*)&CO_OD_EEPROM.calibrationParameters.batteryCC_Offset, 0x87, 0x2 },
......@@ -616,7 +629,7 @@ struct sCO_OD_EEPROM CO_OD_EEPROM = {
/*******************************************************************************
OBJECT DICTIONARY
*******************************************************************************/
const CO_OD_entry_t CO_OD[77] = {
const CO_OD_entry_t CO_OD[79] = {
{0x1000, 0x00, 0x85, 4, (void*)&CO_OD_ROM.deviceType},
{0x1001, 0x00, 0x26, 1, (void*)&CO_OD_RAM.errorRegister},
......@@ -665,7 +678,7 @@ const CO_OD_entry_t CO_OD[77] = {
{0x2106, 0x00, 0x87, 4, (void*)&CO_OD_EEPROM.powerOnCounter},
{0x2107, 0x05, 0x8e, 2, (void*)&CO_OD_RAM.performance[0]},
{0x6000, 0x0d, 0x00, 1, (void*)&OD_record6000},
{0x6100, 0x09, 0x00, 4, (void*)&OD_record6100},
{0x6100, 0x08, 0x00, 4, (void*)&OD_record6100},
{0x6110, 0x03, 0x00, 1, (void*)&OD_record6110},
{0x6111, 0x03, 0x00, 1, (void*)&OD_record6111},
{0x6112, 0x03, 0x00, 1, (void*)&OD_record6112},
......@@ -678,6 +691,7 @@ const CO_OD_entry_t CO_OD[77] = {
{0x6119, 0x02, 0x00, 1, (void*)&OD_record6119},
{0x6120, 0x01, 0x00, 1, (void*)&OD_record6120},
{0x6121, 0x01, 0x00, 1, (void*)&OD_record6121},
{0x6122, 0x02, 0x00, 1, (void*)&OD_record6122},
{0x6200, 0x05, 0x00, 2, (void*)&OD_record6200},
{0x7000, 0x0a, 0x00, 0, (void*)&OD_record7000},
{0x7100, 0x0b, 0x00, 2, (void*)&OD_record7100},
......@@ -693,6 +707,7 @@ const CO_OD_entry_t CO_OD[77] = {
{0x7119, 0x02, 0x00, 1, (void*)&OD_record7119},
{0x7120, 0x03, 0x00, 1, (void*)&OD_record7120},
{0x7121, 0x03, 0x00, 1, (void*)&OD_record7121},
{0x7122, 0x02, 0x00, 1, (void*)&OD_record7122},
{0x7200, 0x08, 0x00, 2, (void*)&OD_record7200},
{0x8000, 0x04, 0x00, 1, (void*)&OD_record8000},
};
[FileInfo]
FileName=EB-NTH-PB-25A-20A.eds
FileName=new_EB-NTH-PB-25A-20A.eds
FileVersion=0
FileRevision=0
LastEDS=
EDSVersion=4.0
Description=General CANopen Dictionary for the NATHAN PowerboardW004 (EB-NTH-PB-25A-20A)
CreationTime=1:04PM
CreationDate=08-28-2018
CreationTime=11:02AM
CreationDate=05-21-2019
CreatedBy=Johannes Geier
ModificationTime=12:00AM
ModificationDate=08-28-2018
ModificationTime=11:02AM
ModificationDate=05-21-2019
ModifiedBy=
[DeviceInfo]
......@@ -125,7 +125,7 @@ DefaultValue=0x00000000
PDOMapping=0
[OptionalObjects]
SupportedObjects=66
SupportedObjects=68
1=0x1002
2=0x1003
3=0x1005
......@@ -175,23 +175,25 @@ SupportedObjects=66
47=0x6119
48=0x6120
49=0x6121
50=0x6200
51=0x7000
52=0x7100
53=0x7110
54=0x7111
55=0x7112
56=0x7113
57=0x7114
58=0x7115
59=0x7116
60=0x7117
61=0x7118
62=0x7119
63=0x7120
64=0x7121
65=0x7200
66=0x8000
50=0x6122
51=0x6200
52=0x7000
53=0x7100
54=0x7110
55=0x7111
56=0x7112
57=0x7113
58=0x7114
59=0x7115
60=0x7116
61=0x7117
62=0x7118
63=0x7119
64=0x7120
65=0x7121
66=0x7122
67=0x7200
68=0x8000
[1002]
ParameterName=Manufacturer status register
......@@ -1916,7 +1918,7 @@ PDOMapping=1
ParameterName=Powermanagement
ObjectType=0x9
;StorageLocation=RAM
SubNumber=0xA
SubNumber=0x9
[6100sub0]
ParameterName=max sub-index
......@@ -1924,7 +1926,7 @@ ObjectType=0x7
;StorageLocation=RAM
DataType=0x0005
AccessType=ro
DefaultValue=9
DefaultValue=8
PDOMapping=0
[6100sub1]
......@@ -1999,15 +2001,6 @@ AccessType=rw
DefaultValue=
PDOMapping=1
[6100sub9]
ParameterName=CAN24V Powerbus QSwitch
ObjectType=0x7
;StorageLocation=RAM
DataType=0x0001
AccessType=rw
DefaultValue=
PDOMapping=1
[6110]
ParameterName=Connector Motor1
ObjectType=0x9
......@@ -2467,6 +2460,39 @@ AccessType=rw
DefaultValue=
PDOMapping=1
[6122]
ParameterName=Connector 24VCANopenLogicSupply
ObjectType=0x9
;StorageLocation=RAM
SubNumber=0x3
[6122sub0]
ParameterName=max sub-index
ObjectType=0x7
;StorageLocation=RAM
DataType=0x0005
AccessType=ro
DefaultValue=2
PDOMapping=0
[6122sub1]
ParameterName=QSwitch
ObjectType=0x7
;StorageLocation=RAM
DataType=0x0001
AccessType=rw
DefaultValue=
PDOMapping=0
[6122sub2]
ParameterName=Output state
ObjectType=0x7
;StorageLocation=RAM
DataType=0x0005
AccessType=rw
DefaultValue=
PDOMapping=1
[6200]
ParameterName=Calibration
ObjectType=0x9
......@@ -3241,6 +3267,39 @@ AccessType=rw
DefaultValue=0
PDOMapping=0
[7122]
ParameterName=Connector 24VCANopenLogicSupply parameters
ObjectType=0x9
;StorageLocation=EEPROM
SubNumber=0x3
[7122sub0]
ParameterName=max sub-index
ObjectType=0x7
;StorageLocation=EEPROM
DataType=0x0005
AccessType=ro
DefaultValue=2
PDOMapping=0
[7122sub1]
ParameterName=Enable
ObjectType=0x7
;StorageLocation=EEPROM
DataType=0x0001
AccessType=rw
DefaultValue=1
PDOMapping=0
[7122sub2]
ParameterName=startupDefault
ObjectType=0x7
;StorageLocation=EEPROM
DataType=0x0001
AccessType=rw
DefaultValue=0
PDOMapping=0
[7200]
ParameterName=Calibration parameters
ObjectType=0x9
......
......@@ -377,9 +377,9 @@
<CANopenSubObject subIndex="0d" name="batteryFullcharge" objectType="VAR" dataType="0x05" accessType="rw" PDOmapping="optional" defaultValue="" TPDOdetectCOS="false" />
<accessFunctionPreCode />
</CANopenObject>
<CANopenObject index="6100" name="Powermanagement" objectType="REC" memoryType="RAM" dataType="0x04" accessType="rw" PDOmapping="no" defaultValue="" subNumber="10" accessFunctionName="" disabled="false" TPDOdetectCOS="false">
<CANopenObject index="6100" name="Powermanagement" objectType="REC" memoryType="RAM" dataType="0x04" accessType="rw" PDOmapping="no" defaultValue="" subNumber="9" accessFunctionName="" disabled="false" TPDOdetectCOS="false">
<description>Powermanagement record. Inherits live data and control entries reagrding general powermanagement functions.</description>
<CANopenSubObject subIndex="00" name="max sub-index" objectType="VAR" dataType="0x05" accessType="ro" PDOmapping="no" defaultValue="9" TPDOdetectCOS="false" />
<CANopenSubObject subIndex="00" name="max sub-index" objectType="VAR" dataType="0x05" accessType="ro" PDOmapping="no" defaultValue="8" TPDOdetectCOS="false" />
<CANopenSubObject subIndex="01" name="Powerbus voltage_mV" objectType="VAR" dataType="0x04" accessType="ro" PDOmapping="optional" defaultValue="" TPDOdetectCOS="false" />
<CANopenSubObject subIndex="02" name="Battery switch temperature_0_1degC" objectType="VAR" dataType="0x04" accessType="ro" PDOmapping="optional" defaultValue="" TPDOdetectCOS="false" />
<CANopenSubObject subIndex="03" name="Battery switch state" objectType="VAR" dataType="0x05" accessType="ro" PDOmapping="optional" defaultValue="" TPDOdetectCOS="false" />
......@@ -388,7 +388,6 @@
<CANopenSubObject subIndex="06" name="PCB temperature_0_1degC" objectType="VAR" dataType="0x04" accessType="ro" PDOmapping="optional" defaultValue="" TPDOdetectCOS="false" />
<CANopenSubObject subIndex="07" name="Powermanagement state" objectType="VAR" dataType="0x07" accessType="rw" PDOmapping="optional" defaultValue="" TPDOdetectCOS="false" />
<CANopenSubObject subIndex="08" name="Powermanagement alerts" objectType="VAR" dataType="0x07" accessType="rw" PDOmapping="optional" defaultValue="" TPDOdetectCOS="false" />
<CANopenSubObject subIndex="09" name="CAN24V Powerbus QSwitch" objectType="VAR" dataType="0x01" accessType="rw" PDOmapping="optional" defaultValue="" TPDOdetectCOS="false" />
<accessFunctionPreCode />
</CANopenObject>
<CANopenObject index="6110" name="Connector Motor1" objectType="REC" memoryType="RAM" dataType="0x01" accessType="rw" PDOmapping="no" defaultValue="" subNumber="4" accessFunctionName="" disabled="false" TPDOdetectCOS="false">
......@@ -482,6 +481,13 @@
<CANopenSubObject subIndex="01" name="Intensity setpoint_percent" objectType="VAR" dataType="0x05" accessType="rw" PDOmapping="optional" defaultValue="" TPDOdetectCOS="false" />
<accessFunctionPreCode />
</CANopenObject>
<CANopenObject index="6122" name="Connector 24VCANopenLogicSupply" objectType="REC" memoryType="RAM" dataType="0x05" accessType="rw" PDOmapping="no" defaultValue="" subNumber="3" accessFunctionName="" disabled="false" TPDOdetectCOS="false">
<description>Connection for CANopen and logic supply for CANopen slaves</description>
<CANopenSubObject subIndex="00" name="max sub-index" objectType="VAR" dataType="0x05" accessType="ro" PDOmapping="no" defaultValue="2" TPDOdetectCOS="false" />
<CANopenSubObject subIndex="01" name="QSwitch" objectType="VAR" dataType="0x01" accessType="rw" PDOmapping="no" defaultValue="" TPDOdetectCOS="false" />
<CANopenSubObject subIndex="02" name="Output state" objectType="VAR" dataType="0x05" accessType="rw" PDOmapping="optional" defaultValue="" TPDOdetectCOS="false" />
<accessFunctionPreCode />
</CANopenObject>
<CANopenObject index="6200" name="Calibration" objectType="REC" memoryType="RAM" dataType="0x03" accessType="rw" PDOmapping="no" defaultValue="" subNumber="6" accessFunctionName="" disabled="false" TPDOdetectCOS="false">
<description>Calibration record. Inherits parameters and controls to calibrate board specific measurements. Handle with care.</description>
<CANopenSubObject subIndex="00" name="max sub-index" objectType="VAR" dataType="0x05" accessType="ro" PDOmapping="no" defaultValue="5" TPDOdetectCOS="false" />
......@@ -618,6 +624,13 @@
<CANopenSubObject subIndex="03" name="Intensity minimum_percent" objectType="VAR" dataType="0x05" accessType="rw" PDOmapping="no" defaultValue="0" TPDOdetectCOS="false" />
<accessFunctionPreCode />
</CANopenObject>
<CANopenObject index="7122" name="Connector 24VCANopenLogicSupply parameters" objectType="REC" memoryType="EEPROM" dataType="0x05" accessType="rw" PDOmapping="no" defaultValue="" subNumber="3" accessFunctionName="" disabled="false" TPDOdetectCOS="false">
<description>Parameters for Connection for CANopen and logic supply for CANopen slaves</description>
<CANopenSubObject subIndex="00" name="max sub-index" objectType="VAR" dataType="0x05" accessType="ro" PDOmapping="no" defaultValue="2" TPDOdetectCOS="false" />
<CANopenSubObject subIndex="01" name="Enable" objectType="VAR" dataType="0x01" accessType="rw" PDOmapping="no" defaultValue="1" TPDOdetectCOS="false" />
<CANopenSubObject subIndex="02" name="startupDefault" objectType="VAR" dataType="0x01" accessType="rw" PDOmapping="no" defaultValue="0" TPDOdetectCOS="false" />
<accessFunctionPreCode />
</CANopenObject>
<CANopenObject index="7200" name="Calibration parameters" objectType="REC" memoryType="EEPROM" dataType="0x03" accessType="rw" PDOmapping="no" defaultValue="" subNumber="9" accessFunctionName="" disabled="false" TPDOdetectCOS="false">
<description>Calibration parameters record. This is mostly an object to readback the calibration values used by the board at the moment. Use the self calibration methods to calibrate the device.</description>
<CANopenSubObject subIndex="00" name="max sub-index" objectType="VAR" dataType="0x05" accessType="ro" PDOmapping="no" defaultValue="8" TPDOdetectCOS="false" />
......@@ -642,7 +655,7 @@
</CANopenObject>
</CANopenObjectList>
<other>
<file fileCreator="Johannes Geier" fileCreationDate="08-28-2018" fileCreationTime="1:04" fileModifedBy="" fileMotifcationDate="08-28-2018" fileModificationTime="12:00" fileVersion="0" fileRevision="0" exportFolder="" EdsFile="C:\REPOS\Powermanagement-for-NATHAN\Software\EB-NTH-PB-25A-20A\Application\CANopenObjectDictionary\doc\EB-NTH-PB-25A-20A.eds" />
<file fileName="EB-NTH-PB-25A-20A.xml" fileCreator="Johannes Geier" fileCreationDate="05-21-2019" fileCreationTime="11:02" fileModifedBy="" fileMotifcationDate="05-21-2019" fileModificationTime="11:02" fileVersion="0" fileRevision="0" exportFolder="" EdsFile="C:\REPOS\Powermanagement-for-NATHAN\Software\EB-NTH-PB-25A-20A\Application\CANopenObjectDictionary\doc\EB-NTH-PB-25A-20A.eds" />
<DeviceIdentity>
<vendorName>Nanotec Electronic GmbH &amp; Co. KG</vendorName>
<vendorNumber>620</vendorNumber>
......@@ -733,4 +746,4 @@
<dummy entry="False" />
</dummyUsage>
</other>
</device>
</device>
\ No newline at end of file
......@@ -67,6 +67,7 @@ public:
CO_SmartODentry<OD_connectorPowerExtension2_t>* mSmartODentry_PowerExtension2;
CO_SmartODentry<OD_connector5VExtension1_t>* mSmartODentry_5VExt1;
CO_SmartODentry<OD_connector5VExtension2_t>* mSmartODentry_5VExt2;
CO_SmartODentry<OD_connector24VCANopenLogicSupply_t>* mSmartODentry_24VCANopenLogicSupply;
CO_SmartODentry<OD_connectorEM5_t>* mSmartODentry_EM5;
CO_SmartODentry<OD_connectorPC_t>* mSmartODentry_PC;
......@@ -90,6 +91,8 @@ public:
CO_Config<OD_connectorPowerExtension1Parameters_t>* mSmartOD_Parameter_PowerExtension1;
CO_Config<OD_connectorPowerExtension2Parameters_t>* mSmartOD_Parameter_PowerExtension2;
CO_Config<OD_connector24VCANopenLogicSupplyParameters_t>* mSmartOD_Parameter_24VCANopenLogicSupply;
CO_Config<OD_connectorEM5Parameters_t>* mSmartOD_Parameter_EM5;
CO_Config<OD_connectorPCParameters_t>* mSmartOD_Parameter_PC;
CO_Config<OD_FAN1Parameters_t>* mSmartOD_Parameter_FAN1;
......@@ -126,7 +129,7 @@ public:
/*Fans and Temperature sensors---------------------------------------------------- */
DigitalOutput* mDcDc5VenableHandle;
DigitalOutput* mCANTransceiverEnableHandle;
DigitalOutput* mCAN_UBlogicHandle;
//DigitalOutput* mCAN_UBlogicHandle;
PowerSwitch* mBatterySwitchHandle;
PowerSwitch* mPowersupplySwitchHandle;
......@@ -167,6 +170,7 @@ public:
PowerExtension<CO_SmartODentry<OD_connector5VExtension1_t>, CO_Config<OD_connector5VExtension1Parameters_t>>* m5VExt1Handle;
PowerExtension<CO_SmartODentry<OD_connector5VExtension2_t>, CO_Config<OD_connector5VExtension2Parameters_t>>* m5VExt2Handle;
PowerExtension<CO_SmartODentry<OD_connector24VCANopenLogicSupply_t>, CO_Config<OD_connector24VCANopenLogicSupplyParameters_t>>* m24VCANopenLogicSupply;
DigitalOutput* mCANublogicHandle;
......
......@@ -60,6 +60,8 @@ void Modules::pseudoConstructor() {
mSmartODentry_5VExt1 = new CO_SmartODentry<OD_connector5VExtension1_t>(CO_OD_RAM.connector5VExtension1);
mSmartODentry_5VExt2 = new CO_SmartODentry<OD_connector5VExtension2_t>(CO_OD_RAM.connector5VExtension2);
mSmartODentry_24VCANopenLogicSupply = new CO_SmartODentry<OD_connector24VCANopenLogicSupply_t>(CO_OD_RAM.connector24VCANopenLogicSupply);
mSmartOD_Parameter_Motor1 = new CO_Config<OD_connectorMotor1Parameters_t>(CO_OD_EEPROM.connectorMotor1Parameters, Config::APPLICATION);
mSmartOD_Parameter_Motor2 = new CO_Config<OD_connectorMotor2Parameters_t>(CO_OD_EEPROM.connectorMotor2Parameters, Config::APPLICATION);
mSmartOD_Parameter_Motor3 = new CO_Config<OD_connectorMotor3Parameters_t>(CO_OD_EEPROM.connectorMotor3Parameters, Config::APPLICATION);
......@@ -73,6 +75,7 @@ void Modules::pseudoConstructor() {
mSmartOD_Parameter_5VExt1 = new CO_Config<OD_connector5VExtension1Parameters_t>(CO_OD_EEPROM.connector5VExtension1Parameters, Config::APPLICATION);
mSmartOD_Parameter_5VExt2 = new CO_Config<OD_connector5VExtension2Parameters_t>(CO_OD_EEPROM.connector5VExtension2Parameters, Config::APPLICATION);
mSmartOD_Parameter_24VCANopenLogicSupply = new CO_Config<OD_connector24VCANopenLogicSupplyParameters_t>(CO_OD_EEPROM.connector24VCANopenLogicSupplyParameters, Config::APPLICATION);
mSmartODentry_PC = new CO_SmartODentry<OD_connectorPC_t>(CO_OD_RAM.connectorPC);
......@@ -150,8 +153,8 @@ void Modules::pseudoConstructor() {
U_LED_ERROR_GPIO_Port);
mWakeUpButtonLEDHandle = new PWMpin(U_EXT_WAKE_LED_Pin, U_EXT_WAKE_LED_GPIO_Port, PWM_TIMER::TIMER12, PWM_TIMCHANNEL::CHANNEL1);
mCAN_UBlogicHandle = new DigitalOutput(U_PWRBUS_EN_Pin,
U_PWRBUS_EN_GPIO_Port);
// mCAN_UBlogicHandle = new DigitalOutput(U_PWRBUS_EN_Pin,
// U_PWRBUS_EN_GPIO_Port);
mGPIO_PC_0Handle = new DigitalOutput(U_GPIO_PC_0_Pin, U_GPIO_PC_0_GPIO_Port, GPIO_MODE::MODE_OUTPUT_OD, GPIO_PULL::NOPULL);
......@@ -195,7 +198,7 @@ void Modules::pseudoConstructor() {
tempHSSw = new ITS4142(U_SMHS7_EN_Pin, U_SMHS7_EN_GPIO_Port, *mBatteryControlHandle, &(mSmartOD_Parameter_EM5->data().warningVoltage_percent), &(mSmartODentry_EM5->data().outputVoltage_mV));
mEM5ExtHandle = new PowerExtension<CO_SmartODentry<OD_connectorEM5_t>, CO_Config<OD_connectorEM5Parameters_t>>(*tempHSSw, mSmartODentry_EM5, mSmartOD_Parameter_EM5);
mCANublogicHandle = new DigitalOutput(U_PWRBUS_EN_Pin, U_PWRBUS_EN_GPIO_Port, GPIO_MODE::MODE_OUTPUT_OD, GPIO_PULL::NOPULL);
//mCANublogicHandle = new DigitalOutput(U_PWRBUS_EN_Pin, U_PWRBUS_EN_GPIO_Port, GPIO_MODE::MODE_OUTPUT_OD, GPIO_PULL::NOPULL);
mPCextHandle = new PCControl(U_5V_PC_EN_Pin,
U_5V_PC_EN_GPIO_Port, mSmartODentry_PC, mSmartOD_Parameter_PC, mGPIO_PC_0Handle, mGPIO_PC_1Handle);
......@@ -206,7 +209,8 @@ void Modules::pseudoConstructor() {
tempHSSw = new HighSideSwitch(U_5VHS2_EN_Pin, U_5VHS2_EN_GPIO_Port, nullptr);
m5VExt2Handle = new PowerExtension<CO_SmartODentry<OD_connector5VExtension2_t>, CO_Config<OD_connector5VExtension2Parameters_t>>(*tempHSSw, mSmartODentry_5VExt2, mSmartOD_Parameter_5VExt2);
tempHSSw = new HighSideSwitch(U_PWRBUS_EN_Pin, U_PWRBUS_EN_GPIO_Port, nullptr);
m24VCANopenLogicSupply = new PowerExtension<CO_SmartODentry<OD_connector24VCANopenLogicSupply_t>, CO_Config<OD_connector24VCANopenLogicSupplyParameters_t>>(*tempHSSw, mSmartODentry_24VCANopenLogicSupply, mSmartOD_Parameter_24VCANopenLogicSupply);
//m5VExt1Handle = new DigitalOutput(U_5VHS1_EN_Pin,
//U_5VHS1_EN_GPIO_Port);
//m5VExt2Handle = new DigitalOutput(U_5VHS2_EN_Pin,
......
......@@ -205,13 +205,15 @@ int8_t PowermanagementControl::init_hardware(void) {
m5VExt1Handle->initHW(GPIO::GPIO_State_t::LOW);
m5VExt2Handle->initHW(GPIO::GPIO_State_t::LOW);
m24VCANopenLogicSupply->initHW(GPIO::GPIO_State_t::LOW);
mGlobalBallastEnable->Init(GPIO::GPIO_State_t::LOW);
//Subsystem
mDcDc5VenableHandle->Init(GPIO::GPIO_State_t::LOW);
mCANTransceiverEnableHandle->Init(GPIO::GPIO_State_t::HIGH); //!reset
mCAN_UBlogicHandle->Init(GPIO::GPIO_State_t::LOW);
//mCAN_UBlogicHandle->Init(GPIO::GPIO_State_t::LOW);
mBatterySwitchHandle->Init(GPIO::GPIO_State_t::LOW);
mGreenLEDHandle->Init(GPIO::GPIO_State_t::LOW);
mRedLEDredHandle->Init(GPIO::GPIO_State_t::LOW);
......@@ -375,6 +377,11 @@ int8_t PowermanagementControl::init_SmartODs(void) {
OD_6119_connector5VExtension2) <= 0) {
return (-1);
}
if (m24VCANopenLogicSupply->mData->registerODuser(m24VCANopenLogicSupply,
OD_6122_connector24VCANopenLogicSupply) <= 0) {
return (-1);
}
if (mFansHandle->sODentry_FAN1->registerODuser(mFansHandle, OD_6120_FAN1)
<= 0) {
return (-1);
......@@ -447,13 +454,13 @@ int8_t PowermanagementControl::refreshCOOD(void) {
int8_t res = +1;
if (!(CO_ODentryUser::mSDOprocessFlag)) {
if (mCAN_UBlogicHandle->value) {
Modules::mSmartODentry_Powermanagement->data().CAN24V_PowerbusQSwitch =
true;
} else {
Modules::mSmartODentry_Powermanagement->data().CAN24V_PowerbusQSwitch =
false;
}
// if (mCAN_UBlogicHandle->value) {
// Modules::mSmartODentry_Powermanagement->data().CAN24V_PowerbusQSwitch =
// true;
// } else {
// Modules::mSmartODentry_Powermanagement->data().CAN24V_PowerbusQSwitch =
// false;
// }
}
if (mBatterySwitchHandle->value) {
......@@ -487,11 +494,11 @@ int8_t PowermanagementControl::refreshCOOD(void) {
/// \brief Actuate on data from CANopen directory
/////////////////////////////////////////////////////////////////////////
CO_SDO_abortCode_t PowermanagementControl::actuate_on_SDOdownload(void) {
if (Modules::mSmartODentry_Powermanagement->data().CAN24V_PowerbusQSwitch) {
mCAN_UBlogicHandle->setPin();
} else {
mCAN_UBlogicHandle->resetPin();
}
// if (Modules::mSmartODentry_Powermanagement->data().CAN24V_PowerbusQSwitch) {
// mCAN_UBlogicHandle->setPin();
// } else {
// mCAN_UBlogicHandle->resetPin();
// }
mSDOprocessFlag = false;
return (CO_SDO_AB_NONE);
......
......@@ -204,6 +204,9 @@ void boardState_Running::A1_on_entry(void) {
if(pMaster->m5VExt2Handle->mParameters->data().startupDefault){
pMaster->m5VExt2Handle->switchOn();
}
if(pMaster->m24VCANopenLogicSupply->mParameters->data().startupDefault){
pMaster->m24VCANopenLogicSupply->switchOn();
}
SoftRtosWDG::instance().watchMe();
pMaster->mHMI_Control->set_StatusLED_on();
......
......@@ -54,6 +54,14 @@ public:
};
// These will be overwritten by makefile and are only used here to supress compiler errors
#ifndef VALIDATIONKEY
#define VALIDATIONKEY 0xFFFFFFFFU //Makefile will define this: 0x00MMDDYY
#endif
#ifndef VALIDATIONKEY_LENGTH
#define VALIDATIONKEY_LENGTH 4U
#endif
///////////////////////////////////////////////////////////////////////
/// \class CO_ConfigurationManager