62 #define CAN_currentSensorDiagOcs (0x1u)
64 #define CAN_currentSensorDiagActualMeasurementError (0x2u)
66 #define CAN_currentSensorDiagAnyMeasurementError (0x4u)
68 #define CAN_currentSensorDiagSystemError (0x8u)
83 const uint8_t *
const kpkCanData,
96 const CAN_SIGNAL_TYPE_s currentSensorData = {23u, 32u, 1.0f, 0.0f, -2147483648.0f, 2147483648.0f};
98 uint64_t message = 0u;
99 uint64_t canSignal = 0u;
101 int32_t sensorSignalValue = 0;
102 uint8_t diagInfo = 0u;
103 uint8_t stringNumber = 0u;
117 message, currentSensorStatus.
bitStart, currentSensorStatus.
bitLength, &canSignal, endianness);
120 diagInfo = canSignal & 0xF0u;
197 message, currentSensorData.
bitStart, currentSensorData.
bitLength, &canSignal, endianness);
203 sensorSignalValue = (int32_t)canSignal;
214 sensorSignalValue = (int32_t)canSignal;
224 sensorSignalValue = (int32_t)canSignal;
234 sensorSignalValue = (int32_t)canSignal;
244 sensorSignalValue = (int32_t)canSignal;
251 sensorSignalValue = (int32_t)canSignal;
262 sensorSignalValue = (int32_t)canSignal;
272 sensorSignalValue = (int32_t)canSignal;
289 #ifdef UNITY_UNIT_TEST
#define CAN_currentSensorDiagActualMeasurementError
uint32_t CAN_RxCurrentSensor(uint32_t id, uint8_t dlc, CAN_ENDIANNESS_e endianness, const uint8_t *const kpkCanData, const CAN_SHIM_s *const kpkCanShim)
can rx callback function for current sensor measurements
#define CAN_currentSensorDiagOcs
#define CAN_currentSensorDiagAnyMeasurementError
#define CAN_currentSensorDiagSystemError
#define CAN_ID_STRING1_VOLTAGE1
#define CAN_ID_STRING0_CURRENT
#define CAN_ID_STRING2_TEMPERATURE
#define CAN_ID_STRING2_VOLTAGE2
#define CAN_ID_STRING1_TEMPERATURE
#define CAN_ID_STRING2_CURRENT_COUNTER
#define CAN_ID_STRING0_CURRENT_COUNTER
#define CAN_ID_STRING0_TEMPERATURE
#define CAN_ID_STRING0_VOLTAGE3
#define CAN_ID_STRING1_VOLTAGE3
#define CAN_ID_STRING1_CURRENT_COUNTER
#define CAN_ID_STRING1_ENERGY_COUNTER
#define CAN_ID_STRING0_VOLTAGE2
#define CAN_ID_STRING2_VOLTAGE1
#define CAN_ID_STRING1_CURRENT
#define CAN_ID_STRING2_ENERGY_COUNTER
#define CAN_ID_STRING2_POWER
#define CAN_ID_STRING1_VOLTAGE2
#define CAN_ID_STRING2_VOLTAGE3
#define CAN_ID_STRING0_VOLTAGE1
#define CAN_ID_STRING0_POWER
#define CAN_ID_STRING1_POWER
#define CAN_ID_STRING2_CURRENT
#define CAN_ID_STRING0_ENERGY_COUNTER
void CAN_RxGetMessageDataFromCanData(uint64_t *pMessage, const uint8_t *const kpkCanData, CAN_ENDIANNESS_e endianness)
Copy CAN data from 8 bytes to a 64-bit variable.
void CAN_RxGetSignalDataFromMessageData(uint64_t message, uint64_t bitStart, uint8_t bitLength, uint64_t *pCanSignal, CAN_ENDIANNESS_e endianness)
Gets CAN signal data from a 64-bit variable. This function is used to get signal data from a 64-bit C...
Headers for the helper functions for the CAN module.
#define DATA_WRITE_DATA(...)
#define FAS_ASSERT(x)
Assertion macro that asserts that x is true.
#define FAS_TRAP
Define that evaluates to essential boolean false thus tripping an assert.
#define NULL_PTR
Null pointer.
uint32_t OS_GetTickCount(void)
Returns OS based system tick value.
DATA_BLOCK_CURRENT_SENSOR_s * pTableCurrentSensor
uint32_t previousTimestampCurrent[BS_NR_OF_STRINGS]
uint32_t timestampCurrent[BS_NR_OF_STRINGS]
uint32_t previousTimestampHighVoltage[BS_NR_OF_STRINGS][BS_NR_OF_VOLTAGES_FROM_CURRENT_SENSOR]
int32_t current_mA[BS_NR_OF_STRINGS]
uint32_t timestampHighVoltage[BS_NR_OF_STRINGS][BS_NR_OF_VOLTAGES_FROM_CURRENT_SENSOR]
uint32_t previousTimestampPower[BS_NR_OF_STRINGS]
uint8_t invalidSensorTemperatureMeasurement[BS_NR_OF_STRINGS]
int32_t energyCounter_Wh[BS_NR_OF_STRINGS]
uint32_t timestampPower[BS_NR_OF_STRINGS]
uint32_t previousTimestampEnergyCounting[BS_NR_OF_STRINGS]
int32_t highVoltage_mV[BS_NR_OF_STRINGS][BS_NR_OF_VOLTAGES_FROM_CURRENT_SENSOR]
uint8_t invalidCurrentMeasurement[BS_NR_OF_STRINGS]
uint8_t invalidHighVoltageMeasurement[BS_NR_OF_STRINGS][BS_NR_OF_VOLTAGES_FROM_CURRENT_SENSOR]
uint8_t invalidCurrentCountingMeasurement[BS_NR_OF_STRINGS]
uint32_t timestampEnergyCounting[BS_NR_OF_STRINGS]
int32_t power_W[BS_NR_OF_STRINGS]
int32_t currentCounter_As[BS_NR_OF_STRINGS]
uint32_t timestampCurrentCounting[BS_NR_OF_STRINGS]
int32_t sensorTemperature_ddegC[BS_NR_OF_STRINGS]
uint32_t previousTimestampCurrentCounting[BS_NR_OF_STRINGS]
uint8_t invalidPowerMeasurement[BS_NR_OF_STRINGS]
uint8_t invalidEnergyCountingMeasurement[BS_NR_OF_STRINGS]