64 #define CAN_SIGNAL_MAX_SIZE (64u)
67 #define CAN_MESSAGE_BIT_MASK_ONE_BYTE (0xFFu)
70 #define CAN_BYTE_LENGTH (8u)
76 56u, 57u, 58u, 59u, 60u, 61u, 62u, 63u, 48u, 49u, 50u, 51u, 52u, 53u, 54u, 55u, 40u, 41u, 42u, 43u, 44u, 45u,
77 46u, 47u, 32u, 33u, 34u, 35u, 36u, 37u, 38u, 39u, 24u, 25u, 26u, 27u, 28u, 29u, 30u, 31u, 16u, 17u, 18u, 19u,
78 20u, 21u, 22u, 23u, 8u, 9u, 10u, 11u, 12u, 13u, 14u, 15u, 0u, 1u, 2u, 3u, 4u, 5u, 6u, 7u};
129 position = position - (bitLength - 1u);
146 if (*pSignal > signalProperties.
max) {
147 *pSignal = signalProperties.
max;
148 }
else if (*pSignal < signalProperties.
min) {
149 *pSignal = signalProperties.
min;
155 *pSignal = *pSignal + signalProperties.
offset;
158 *pSignal = *pSignal / signalProperties.
factor;
164 *pSignalConverted = (signalRaw * signalProperties.
factor) - signalProperties.
offset;
180 uint64_t position = bitStart;
193 uint64_t mask = UINT64_MAX;
203 *pMessage |= (canSignal & mask) << position;
253 uint64_t *pCanSignal,
263 uint64_t position = bitStart;
276 uint64_t mask = UINT64_MAX;
286 *pCanSignal = (message >> position) & mask;
291 const uint8_t *
const kpkCanData,
337 uint8_t returnValue = 0u;
static uint64_t CAN_ConvertBitStartBigEndian(uint64_t bitStart, uint64_t bitLength)
Convert bit start in big endian case. In the big endian case for CAN, the bit start is set to the MSB...
void CAN_TxSetMessageDataWithSignalData(uint64_t *pMessage, uint64_t bitStart, uint8_t bitLength, uint64_t canSignal, CAN_ENDIANNESS_e endianness)
Puts CAN signal data in a 64-bit variable. This function is used to compose a 64-bit CAN message....
static const uint8_t can_bigEndianTable[CAN_SIGNAL_MAX_SIZE]
void CAN_TxSetCanDataWithMessageData(uint64_t message, uint8_t *pCanData, CAN_ENDIANNESS_e endianness)
Copy CAN data from a 64-bit variable to 8 bytes. This function is used to copy a 64-bit CAN message t...
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.
uint8_t CAN_ConvertBooleanToInteger(bool input)
Transform a bool to a bit (set if true)
void CAN_TxPrepareSignalData(float *pSignal, CAN_SIGNAL_TYPE_s signalProperties)
Prepare signal data. This function takes the signal data and applies factor, applies offset and compa...
#define CAN_MESSAGE_BIT_MASK_ONE_BYTE
#define CAN_SIGNAL_MAX_SIZE
void CAN_RxConvertRawSignalData(float *pSignalConverted, float signalRaw, CAN_SIGNAL_TYPE_s signalProperties)
Convert raw signal data. This function takes the raw signal data and applies offset and factor to con...
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 CAN_BYTE_2_POSITION
#define CAN_BYTE_4_POSITION
#define CAN_BYTE_0_POSITION
#define CAN_BYTE_6_POSITION
#define CAN_BYTE_7_POSITION
#define CAN_BYTE_3_POSITION
#define CAN_BYTE_5_POSITION
#define CAN_BYTE_1_POSITION
#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.
math library for often used math functions
#define NULL_PTR
Null pointer.