foxBMS  1.4.1
The foxBMS Battery Management System API Documentation
can.c
Go to the documentation of this file.
1 /**
2  *
3  * @copyright © 2010 - 2022, Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V.
4  * All rights reserved.
5  *
6  * SPDX-License-Identifier: BSD-3-Clause
7  *
8  * Redistribution and use in source and binary forms, with or without
9  * modification, are permitted provided that the following conditions are met:
10  *
11  * 1. Redistributions of source code must retain the above copyright notice, this
12  * list of conditions and the following disclaimer.
13  *
14  * 2. Redistributions in binary form must reproduce the above copyright notice,
15  * this list of conditions and the following disclaimer in the documentation
16  * and/or other materials provided with the distribution.
17  *
18  * 3. Neither the name of the copyright holder nor the names of its
19  * contributors may be used to endorse or promote products derived from
20  * this software without specific prior written permission.
21  *
22  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
23  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
25  * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
26  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
27  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
28  * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
29  * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
30  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
31  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32  *
33  * We kindly request you to use one or more of the following phrases to refer to
34  * foxBMS in your hardware, software, documentation or advertising materials:
35  *
36  * - ″This product uses parts of foxBMS®″
37  * - ″This product includes parts of foxBMS®″
38  * - ″This product is derived from foxBMS®″
39  *
40  */
41 
42 /**
43  * @file can.c
44  * @author foxBMS Team
45  * @date 2019-12-04 (date of creation)
46  * @updated 2022-10-27 (date of last update)
47  * @version v1.4.1
48  * @ingroup DRIVERS
49  * @prefix CAN
50  *
51  * @brief Driver for the CAN module
52  *
53  * @details Implementation of the CAN Interrupts, initialization, buffers,
54  * receive and transmit interfaces.
55  */
56 
57 /*========== Includes =======================================================*/
58 #include "can.h"
59 
60 #include "version_cfg.h"
61 
62 #include "HL_het.h"
63 #include "HL_reg_system.h"
64 
65 #include "bender_iso165c.h"
66 #include "can_helper.h"
67 #include "database.h"
68 #include "diag.h"
69 #include "foxmath.h"
70 #include "ftask.h"
71 #include "pex.h"
72 
73 /*========== Macros and Definitions =========================================*/
74 /** lower limit of timestamp counts for a valid CAN timing */
75 #define CAN_TIMING_LOWER_LIMIT_COUNTS (95u)
76 
77 /** upper limit of timestamp counts for a valid CAN timing */
78 #define CAN_TIMING_UPPER_LIMIT_COUNTS (105u)
79 
80 /** return value of function canGetData if no data was lost during reception */
81 #define CAN_HAL_RETVAL_NO_DATA_LOST (1u)
82 
83 /*========== Static Constant and Variable Definitions =======================*/
84 
85 /** tracks the local state of the can module */
87  .periodicEnable = false,
88  .currentSensorPresent = {GEN_REPEAT_U(false, GEN_STRIP(BS_NR_OF_STRINGS))},
89  .currentSensorCCPresent = {GEN_REPEAT_U(false, GEN_STRIP(BS_NR_OF_STRINGS))},
90  .currentSensorECPresent = {GEN_REPEAT_U(false, GEN_STRIP(BS_NR_OF_STRINGS))},
91 };
92 
93 /*========== Extern Constant and Variable Definitions =======================*/
94 
95 /*========== Static Function Prototypes =====================================*/
96 
97 /**
98  * @brief Called in case of CAN TX interrupt.
99  * @param pNode CAN interface on which message was sent
100  * @param messageBox message box on which message was sent
101  */
102 static void CAN_TxInterrupt(canBASE_t *pNode, uint32 messageBox);
103 
104 /**
105  * @brief Called in case of CAN RX interrupt.
106  * @param pNode CAN interface on which message was received
107  * @param messageBox message box on which message was received
108  */
109 static void CAN_RxInterrupt(canBASE_t *pNode, uint32 messageBox);
110 
111 /**
112  * @brief Handles the processing of messages that are meant to be transmitted.
113  * This function looks for the repetition times and the repetition phase of
114  * messages that are intended to be sent periodically. If a comparison with
115  * an internal counter (i.e., the counter how often this function has been called)
116  * states that a transmit is pending, the message is composed by call of CANS_ComposeMessage
117  * and transferred to the buffer of the CAN module. If a callback function
118  * is declared in configuration, this callback is called after successful transmission.
119  * @return #STD_OK if a CAN transfer was made, #STD_NOT_OK otherwise
120  */
122 
123 /**
124  * @brief Checks if the CAN messages come in the specified time window
125  * If the (current time stamp) - (previous time stamp) > 96ms and < 104ms,
126  * the check is true, false otherwise. The result is reported via flags
127  * in the DIAG module.
128  */
129 static void CAN_CheckCanTiming(void);
130 
131 #if CURRENT_SENSOR_PRESENT == true
132 /**
133  * @brief Sets flag to indicate current sensor is present.
134  *
135  * @param command true if current sensor present, otherwise false
136  * @param stringNumber string addressed
137  *
138  * @return none
139  */
140 static void CAN_SetCurrentSensorPresent(bool command, uint8_t stringNumber);
141 
142 /**
143  * @brief Sets flag to indicate current sensor sends C-C values.
144  *
145  * @param command true if coulomb counting message detected, otherwise false
146  * @param stringNumber string addressed
147  *
148  * @return none
149  */
150 static void CAN_SetCurrentSensorCcPresent(bool command, uint8_t stringNumber);
151 
152 /**
153  * @brief Sets flag to indicate current sensor sends C-C values.
154  *
155  * @param command true if energy counting message detected, otherwise false
156  * @param stringNumber string addressed
157  *
158  * @return none
159  */
160 static void CAN_SetCurrentSensorEcPresent(bool command, uint8_t stringNumber);
161 #endif /* CURRENT_SENSOR_PRESENT == true */
162 
163 /** initialize the SPI interface to the CAN transceiver */
164 static void CAN_InitializeTransceiver(void);
165 
166 /** checks that the configured message period for Tx messages is valid */
167 static void CAN_ValidateConfiguredTxMessagePeriod(void);
168 
169 /*========== Static Function Implementations ================================*/
170 
171 static void CAN_InitializeTransceiver(void) {
172  /** Initialize transceiver for CAN1 */
177 
178  /** Initialize transceiver for CAN2 */
183 }
184 
186  for (uint16_t i = 0u; i < can_txLength; i++) {
187  if (can_txMessages[i].timing.period == 0u) {
189  }
190  }
191 }
192 
193 /*========== Extern Function Implementations ================================*/
194 
195 extern void CAN_Initialize(void) {
198 }
199 
200 extern STD_RETURN_TYPE_e CAN_DataSend(canBASE_t *pNode, uint32_t id, uint8 *pData) {
201  FAS_ASSERT(pNode != NULL_PTR);
202  FAS_ASSERT(pData != NULL_PTR);
203  FAS_ASSERT((pNode == CAN_NODE_1) || (pNode == CAN_NODE_2));
204  /* AXIVION Routine Generic-MissingParameterAssert: id: parameter accepts whole range */
205 
206  STD_RETURN_TYPE_e result = STD_NOT_OK;
207 
208  /**
209  * Parse all TX message boxes until we find a free one,
210  * then use it to send the CAN message.
211  * In the HAL, message box numbers start from 1, not 0.
212  */
213  for (uint8_t messageBox = 1u; messageBox <= CAN_NR_OF_TX_MESSAGE_BOX; messageBox++) {
214  if (canIsTxMessagePending(pNode, messageBox) == 0u) {
215  /* id shifted by 18 to use standard frame */
216  /* standard frame: bits [28:18] */
217  /* extended frame: bits [28:0] */
218  /* bit 29 set to 1: to set direction Tx in IF2ARB register */
219  canUpdateID(pNode, messageBox, ((id << 18u) | (1u << 29u)));
220  canTransmit(pNode, messageBox, pData);
221  result = STD_OK;
222  break;
223  }
224  }
225  return result;
226 }
227 
228 extern void CAN_MainFunction(void) {
230  if (can_state.periodicEnable == true) {
232  }
233 }
234 
236  STD_RETURN_TYPE_e retVal = STD_NOT_OK;
237  static uint32_t counterTicks = 0;
238  uint8_t data[8] = {0};
239 
240  for (uint16_t i = 0u; i < can_txLength; i++) {
241  if (((counterTicks * CAN_TICK_ms) % (can_txMessages[i].timing.period)) == can_txMessages[i].timing.phase) {
242  if (can_txMessages[i].callbackFunction != NULL_PTR) {
244  can_txMessages[i].message, data, can_txMessages[i].pMuxId, &can_kShim);
245  /* CAN messages are currently discarded if all message boxes
246  * are full. They will not be retransmitted within the next
247  * call of CAN_PeriodicTransmit() */
248  CAN_DataSend(can_txMessages[i].canNode, can_txMessages[i].message.id, data);
249  retVal = STD_OK;
250  }
251  }
252  }
253 
254  counterTicks++;
255  return retVal;
256 }
257 
258 static void CAN_CheckCanTiming(void) {
259  uint32_t current_time;
262 #if CURRENT_SENSOR_PRESENT == true
264 #endif /* CURRENT_SENSOR_PRESENT == true */
265 
266  current_time = OS_GetTickCount();
267  DATA_READ_DATA(&staterequestTab, &errorFlagsTab);
268 
269  /* Is the BMS still getting CAN messages? */
270  if ((current_time - staterequestTab.header.timestamp) <= CAN_TIMING_UPPER_LIMIT_COUNTS) {
271  if (((staterequestTab.header.timestamp - staterequestTab.header.previousTimestamp) >=
273  ((staterequestTab.header.timestamp - staterequestTab.header.previousTimestamp) <=
276  } else {
278  }
279  } else {
281  }
282 
283 #if CURRENT_SENSOR_PRESENT == true
284  /* check time stamps of current measurements */
285  DATA_READ_DATA(&currentTab);
286 
287  for (uint8_t s = 0u; s < BS_NR_OF_STRINGS; s++) {
288  /* Current has been measured at least once */
289  if (currentTab.timestampCurrent[s] != 0u) {
290  /* Check time since last received string current data */
291  if ((current_time - currentTab.timestampCurrent[s]) > BS_CURRENT_MEASUREMENT_RESPONSE_TIMEOUT_MS) {
293  } else {
295  if (can_state.currentSensorPresent[s] == false) {
297  }
298  }
299  }
300 
301  /* check time stamps of CC measurements */
302  /* if timestamp_cc != 0, this means current sensor cc message has been received at least once */
303  if (currentTab.timestampCurrentCounting[s] != 0) {
304  if ((current_time - currentTab.timestampCurrentCounting[s]) >
307  } else {
309  if (can_state.currentSensorCCPresent[s] == false) {
311  }
312  }
313  }
314 
315  /* check time stamps of EC measurements */
316  /* if timestamp_ec != 0, this means current sensor ec message has been received at least once */
317  if (currentTab.timestampEnergyCounting[s] != 0) {
318  if ((current_time - currentTab.timestampEnergyCounting[s]) >
321  } else {
323  if (can_state.currentSensorECPresent[s] == false) {
325  }
326  }
327  }
328  }
329 #endif /* CURRENT_SENSOR_PRESENT == true */
330 }
331 
332 extern void CAN_ReadRxBuffer(void) {
333  CAN_BUFFER_ELEMENT_s can_rxBuffer = {0};
334  if (ftsk_allQueuesCreated == true) {
335  while (OS_ReceiveFromQueue(ftsk_canRxQueue, (void *)&can_rxBuffer, 0u) == OS_SUCCESS) {
336  /* data queue was not empty */
337  for (uint16_t i = 0u; i < can_rxLength; i++) {
338  if ((can_rxBuffer.canNode == can_rxMessages[i].canNode) &&
339  (can_rxBuffer.id == can_rxMessages[i].message.id)) {
340  if (can_rxMessages[i].callbackFunction != NULL_PTR) {
341  can_rxMessages[i].callbackFunction(can_rxMessages[i].message, can_rxBuffer.data, &can_kShim);
342  }
343  }
344  }
345  }
346  }
347 }
348 
349 /**
350  * @brief enable/disable the periodic transmit/receive.
351  */
352 extern void CAN_EnablePeriodic(bool command) {
353  if (command == true) {
354  can_state.periodicEnable = true;
355  } else {
356  can_state.periodicEnable = false;
357  }
358 }
359 
360 #if CURRENT_SENSOR_PRESENT == true
361 static void CAN_SetCurrentSensorPresent(bool command, uint8_t stringNumber) {
362  if (command == true) {
364  can_state.currentSensorPresent[stringNumber] = true;
366  } else {
368  can_state.currentSensorPresent[stringNumber] = false;
370  }
371 }
372 
373 static void CAN_SetCurrentSensorCcPresent(bool command, uint8_t stringNumber) {
374  if (command == true) {
376  can_state.currentSensorCCPresent[stringNumber] = true;
378  } else {
380  can_state.currentSensorCCPresent[stringNumber] = false;
382  }
383 }
384 
385 static void CAN_SetCurrentSensorEcPresent(bool command, uint8_t stringNumber) {
386  if (command == true) {
388  can_state.currentSensorECPresent[stringNumber] = true;
390  } else {
392  can_state.currentSensorECPresent[stringNumber] = false;
394  }
395 }
396 #endif /* CURRENT_SENSOR_PRESENT == true */
397 
398 extern bool CAN_IsCurrentSensorPresent(uint8_t stringNumber) {
399  FAS_ASSERT(stringNumber < BS_NR_OF_STRINGS);
400  return can_state.currentSensorPresent[stringNumber];
401 }
402 
403 extern bool CAN_IsCurrentSensorCcPresent(uint8_t stringNumber) {
404  FAS_ASSERT(stringNumber < BS_NR_OF_STRINGS);
405  return can_state.currentSensorCCPresent[stringNumber];
406 }
407 
408 extern bool CAN_IsCurrentSensorEcPresent(uint8_t stringNumber) {
409  FAS_ASSERT(stringNumber < BS_NR_OF_STRINGS);
410  return can_state.currentSensorECPresent[stringNumber];
411 }
412 
413 static void CAN_TxInterrupt(canBASE_t *pNode, uint32 messageBox) {
414  /* AXIVION Routine Generic-MissingParameterAssert: pNode: unused parameter */
415  /* AXIVION Routine Generic-MissingParameterAssert: messageBox: unused parameter */
416  (void)pNode;
417  (void)messageBox;
418 }
419 
420 static void CAN_RxInterrupt(canBASE_t *pNode, uint32 messageBox) {
421  FAS_ASSERT(pNode != NULL_PTR);
422 
423  CAN_BUFFER_ELEMENT_s can_rxBuffer = {0u};
424  uint8_t messageData[CAN_DEFAULT_DLC] = {0u};
425  /**
426  * Read even if queues are not created, otherwise message boxes get full.
427  * Possible return values:
428  * - 0: no new data
429  * - 1: no data lost
430  * - 3: data lost */
431  uint32_t retval = canGetData(pNode, messageBox, (uint8 *)&messageData[0]); /* copy to RAM */
432 
433  /* Check that CAN RX queue is started before using it and data is valid */
434  if ((ftsk_allQueuesCreated == true) && (retval == CAN_HAL_RETVAL_NO_DATA_LOST)) {
435  /* id shifted by 18 to use standard frame from IF2ARB register*/
436  /* standard frame: bits [28:18] */
437  /* extended frame: bits [28:0] */
438  uint32_t id = canGetID(pNode, messageBox) >> 18u;
439 
440  can_rxBuffer.canNode = pNode;
441  can_rxBuffer.id = id;
442  can_rxBuffer.data[0] = messageData[0];
443  can_rxBuffer.data[1] = messageData[1];
444  can_rxBuffer.data[2] = messageData[2];
445  can_rxBuffer.data[3] = messageData[3];
446  can_rxBuffer.data[4] = messageData[4];
447  can_rxBuffer.data[5] = messageData[5];
448  can_rxBuffer.data[6] = messageData[6];
449  can_rxBuffer.data[7] = messageData[7];
450 
451  if (OS_SendToBackOfQueueFromIsr(ftsk_canRxQueue, (void *)&can_rxBuffer, NULL_PTR) == OS_SUCCESS) {
452  /* queue is not full */
454  } else {
455  /* queue is full */
457  }
458  }
459 }
460 
461 /** called in case of CAN interrupt, defined as weak in HAL */
462 /* AXIVION Next Codeline Style Linker-Multiple_Definition: TI HAL only provides a weak implementation */
463 void UNIT_TEST_WEAK_IMPL canMessageNotification(canBASE_t *node, uint32 messageBox) {
464  /* AXIVION Routine Generic-MissingParameterAssert: node: unchecked in interrupt */
465  /* AXIVION Routine Generic-MissingParameterAssert: messageBox: unchecked in interrupt */
466 
467  if (messageBox <= CAN_NR_OF_TX_MESSAGE_BOX) {
468  CAN_TxInterrupt(node, messageBox);
469  } else {
470  CAN_RxInterrupt(node, messageBox);
471  }
472 }
473 
474 /*========== Getter for static Variables (Unit Test) ========================*/
475 #ifdef UNITY_UNIT_TEST
476 extern CAN_STATE_s *TEST_CAN_GetCANState(void) {
477  return &can_state;
478 }
479 #endif
480 
481 /*========== Externalized Static Function Implementations (Unit Test) =======*/
#define BS_COULOMB_COUNTING_MEASUREMENT_RESPONSE_TIMEOUT_MS
#define BS_ENERGY_COUNTING_MEASUREMENT_RESPONSE_TIMEOUT_MS
#define BS_NR_OF_STRINGS
Number of parallel strings in the battery pack.
#define BS_CURRENT_MEASUREMENT_RESPONSE_TIMEOUT_MS
Headers for the driver for the insulation monitoring.
static void CAN_RxInterrupt(canBASE_t *pNode, uint32 messageBox)
Called in case of CAN RX interrupt.
Definition: can.c:420
bool CAN_IsCurrentSensorCcPresent(uint8_t stringNumber)
get flag if CC message from current sensor is received.
Definition: can.c:403
void CAN_MainFunction(void)
Calls the functions to drive the CAN interface. Makes the CAN timing checks and sends the periodic me...
Definition: can.c:228
static void CAN_ValidateConfiguredTxMessagePeriod(void)
Definition: can.c:185
static void CAN_SetCurrentSensorCcPresent(bool command, uint8_t stringNumber)
Sets flag to indicate current sensor sends C-C values.
Definition: can.c:373
static STD_RETURN_TYPE_e CAN_PeriodicTransmit(void)
Handles the processing of messages that are meant to be transmitted. This function looks for the repe...
Definition: can.c:235
#define CAN_HAL_RETVAL_NO_DATA_LOST
Definition: can.c:81
static void CAN_CheckCanTiming(void)
Checks if the CAN messages come in the specified time window If the (current time stamp) - (previous ...
Definition: can.c:258
#define CAN_TIMING_LOWER_LIMIT_COUNTS
Definition: can.c:75
static void CAN_InitializeTransceiver(void)
Definition: can.c:171
void UNIT_TEST_WEAK_IMPL canMessageNotification(canBASE_t *node, uint32 messageBox)
Definition: can.c:463
bool CAN_IsCurrentSensorEcPresent(uint8_t stringNumber)
get flag if EC message from current sensor is received
Definition: can.c:408
static void CAN_TxInterrupt(canBASE_t *pNode, uint32 messageBox)
Called in case of CAN TX interrupt.
Definition: can.c:413
STD_RETURN_TYPE_e CAN_DataSend(canBASE_t *pNode, uint32_t id, uint8 *pData)
Sends over CAN the data passed in parameters. This function goes over the message boxes and marks the...
Definition: can.c:200
void CAN_ReadRxBuffer(void)
Checks the data received per CAN. A receive buffer is used because CAN frames are received in an inte...
Definition: can.c:332
bool CAN_IsCurrentSensorPresent(uint8_t stringNumber)
set flag for presence of current sensor.
Definition: can.c:398
static void CAN_SetCurrentSensorEcPresent(bool command, uint8_t stringNumber)
Sets flag to indicate current sensor sends C-C values.
Definition: can.c:385
#define CAN_TIMING_UPPER_LIMIT_COUNTS
Definition: can.c:78
static void CAN_SetCurrentSensorPresent(bool command, uint8_t stringNumber)
Sets flag to indicate current sensor is present.
Definition: can.c:361
void CAN_Initialize(void)
Enables the CAN transceiver.. This function sets th pins to enable the CAN transceiver....
Definition: can.c:195
static CAN_STATE_s can_state
Definition: can.c:86
void CAN_EnablePeriodic(bool command)
enable/disable the periodic transmit/receive.
Definition: can.c:352
Header for the driver for the CAN module.
#define CAN_NR_OF_TX_MESSAGE_BOX
Definition: can.h:71
#define CAN_TICK_ms
Definition: can.h:76
const CAN_SHIM_s can_kShim
Definition: can_cfg.c:92
const CAN_RX_MESSAGE_TYPE_s can_rxMessages[]
Definition: can_cfg_rx.c:74
#define CAN2_ENABLE_PIN
Definition: can_cfg.h:84
#define CAN1_STANDBY_PIN
Definition: can_cfg.h:83
#define CAN_NODE_2
Definition: can_cfg.h:72
#define CAN1_ENABLE_PIN
Definition: can_cfg.h:82
const uint8_t can_txLength
Definition: can_cfg_tx.c:101
#define CAN2_STANDBY_PIN
Definition: can_cfg.h:85
#define CAN_NODE_1
Definition: can_cfg.h:71
const CAN_TX_MESSAGE_TYPE_s can_txMessages[]
Definition: can_cfg_tx.c:84
const uint8_t can_rxLength
Definition: can_cfg_rx.c:92
#define CAN_DEFAULT_DLC
Definition: can_cfg.h:93
Headers for the helper functions for the CAN module.
Database module header.
#define DATA_READ_DATA(...)
Definition: database.h:83
@ DATA_BLOCK_ID_CURRENT_SENSOR
Definition: database_cfg.h:79
@ DATA_BLOCK_ID_ERRORSTATE
Definition: database_cfg.h:86
@ DATA_BLOCK_ID_STATEREQUEST
Definition: database_cfg.h:95
DIAG_RETURNTYPE_e DIAG_Handler(DIAG_ID_e diagId, DIAG_EVENT_e event, DIAG_IMPACT_LEVEL_e impact, uint32_t data)
DIAG_Handler provides generic error handling, based on diagnosis group.
Definition: diag.c:243
Diagnosis driver header.
@ DIAG_EVENT_NOT_OK
Definition: diag_cfg.h:258
@ DIAG_EVENT_OK
Definition: diag_cfg.h:257
@ DIAG_SYSTEM
Definition: diag_cfg.h:270
@ DIAG_STRING
Definition: diag_cfg.h:271
@ DIAG_ID_CAN_CC_RESPONDING
Definition: diag_cfg.h:184
@ DIAG_ID_CAN_TIMING
Definition: diag_cfg.h:182
@ DIAG_ID_CURRENT_SENSOR_RESPONDING
Definition: diag_cfg.h:186
@ DIAG_ID_CAN_RX_QUEUE_FULL
Definition: diag_cfg.h:183
@ DIAG_ID_CAN_EC_RESPONDING
Definition: diag_cfg.h:185
#define FAS_ASSERT(x)
Assertion macro that asserts that x is true.
Definition: fassert.h:252
#define FAS_TRAP
Define that evaluates to essential boolean false thus tripping an assert.
Definition: fassert.h:126
math library for often used math functions
STD_RETURN_TYPE_e
Definition: fstd_types.h:81
@ STD_NOT_OK
Definition: fstd_types.h:83
@ STD_OK
Definition: fstd_types.h:82
#define NULL_PTR
Null pointer.
Definition: fstd_types.h:76
Header of task driver implementation.
volatile bool ftsk_allQueuesCreated
QueueHandle_t ftsk_canRxQueue
#define GEN_REPEAT_U(x, n)
Macro that helps to generate a series of literals (for array initializers).
Definition: general.h:250
#define GEN_STRIP(x)
Definition: general.h:261
#define UNIT_TEST_WEAK_IMPL
Definition: general.h:97
@ OS_SUCCESS
Definition: os.h:78
OS_STD_RETURN_e OS_ReceiveFromQueue(OS_QUEUE xQueue, void *const pvBuffer, uint32_t ticksToWait)
Receive an item from a queue.
Definition: os_freertos.c:157
OS_STD_RETURN_e OS_SendToBackOfQueueFromIsr(OS_QUEUE xQueue, const void *const pvItemToQueue, long *const pxHigherPriorityTaskWoken)
Post an item to the back the provided queue during an ISR.
Definition: os_freertos.c:182
void OS_ExitTaskCritical(void)
Exit Critical interface function for use in FreeRTOS-Tasks and FreeRTOS-ISR.
Definition: os_freertos.c:135
void OS_EnterTaskCritical(void)
Enter Critical interface function for use in FreeRTOS-Tasks and FreeRTOS-ISR.
Definition: os_freertos.c:131
uint32_t OS_GetTickCount(void)
Returns OS based system tick value.
Definition: os_freertos.c:139
void PEX_SetPin(uint8_t portExpander, uint8_t pin)
sets pin to high.
Definition: pex.c:321
void PEX_SetPinDirectionOutput(uint8_t portExpander, uint8_t pin)
sets pin to input.
Definition: pex.c:394
Header for the driver for the NXP PCA9539 port expander module.
#define PEX_PORT_EXPANDER2
Definition: pex_cfg.h:75
uint8_t data[CAN_MAX_DLC]
Definition: can_cfg.h:155
canBASE_t * canNode
Definition: can_cfg.h:153
CAN_RxCallbackFunction_f callbackFunction
Definition: can_cfg.h:223
canBASE_t * canNode
Definition: can_cfg.h:220
CAN_MESSAGE_PROPERTIES_s message
Definition: can_cfg.h:221
bool currentSensorCCPresent[BS_NR_OF_STRINGS]
Definition: can.h:82
bool currentSensorECPresent[BS_NR_OF_STRINGS]
Definition: can.h:83
bool currentSensorPresent[BS_NR_OF_STRINGS]
Definition: can.h:81
bool periodicEnable
Definition: can.h:80
CAN_TxCallbackFunction_f callbackFunction
Definition: can_cfg.h:213
CAN_TX_MESSAGE_TIMING_s timing
Definition: can_cfg.h:212
uint32_t timestampCurrent[BS_NR_OF_STRINGS]
Definition: database_cfg.h:216
DATA_BLOCK_HEADER_s header
Definition: database_cfg.h:211
uint32_t timestampEnergyCounting[BS_NR_OF_STRINGS]
Definition: database_cfg.h:231
uint32_t timestampCurrentCounting[BS_NR_OF_STRINGS]
Definition: database_cfg.h:227
DATA_BLOCK_HEADER_s header
Definition: database_cfg.h:329
uint32_t previousTimestamp
Definition: database_cfg.h:121
DATA_BLOCK_ID_e uniqueId
Definition: database_cfg.h:119
DATA_BLOCK_HEADER_s header
Definition: database_cfg.h:522
Header file for the version information that is generated by the toolchain.