foxBMS  1.6.0
The foxBMS Battery Management System API Documentation
adi_ades183x.c
Go to the documentation of this file.
1 /**
2  *
3  * @copyright © 2010 - 2023, 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 adi_ades183x.c
44  * @author foxBMS Team
45  * @date 2020-12-09 (date of creation)
46  * @updated 2023-10-12 (date of last update)
47  * @version v1.6.0
48  * @ingroup DRIVERS
49  * @prefix ADI
50  *
51  * @brief Driver for the ADI analog front-end.
52  *
53  */
54 
55 /*========== Includes =======================================================*/
56 /* clang-format off */
57 #include "adi_ades183x.h"
58 /* clang-format on */
59 
60 #include "adi_ades183x_balancing.h"
61 #include "adi_ades183x_buffers.h"
62 #include "adi_ades183x_commands.h"
65 #include "adi_ades183x_helpers.h"
67 #include "adi_ades183x_pec.h"
69 #include "adi_ades183x_voltages.h"
70 #include "database.h"
71 #include "ftask.h"
72 #include "infinite-loop-helper.h"
73 #include "os.h"
74 #include "pex.h"
75 
76 #include <stdbool.h>
77 #include <stdint.h>
78 
79 /*========== Macros and Definitions =========================================*/
80 
81 /*========== Static Constant and Variable Definitions =======================*/
82 /**
83  * PEC buffer for RX and TX
84  * @{
85  */
86 #pragma SET_DATA_SECTION(".sharedRAM")
89 #pragma SET_DATA_SECTION()
90 /**@}*/
91 
92 /** local copies of database tables */
93 /**@{*/
111 static ADI_ERROR_TABLE_s adi_errorTable = {0}; /*!< init in ADI_ResetErrorTable-function */
112 /**@}*/
113 
114 /*========== Extern Constant and Variable Definitions =======================*/
115 
117  .measurementStarted = false,
118  .firstMeasurementMade = false,
119  .firstDiagnosticMade = false,
120  .currentString = 0u,
121  .redundantAuxiliaryChannel = {0u},
122  .data.txBuffer = adi_bufferTxPec,
123  .data.rxBuffer = adi_bufferRxPec,
124  .data.cellVoltage = &adi_cellVoltage,
125  .data.cellVoltageAverage = &adi_cellVoltageAverage,
126  .data.cellVoltageFiltered = &adi_cellVoltageFiltered,
127  .data.cellVoltageRedundant = &adi_cellVoltageRedundant,
128  .data.cellTemperature = &adi_cellTemperature,
129  .data.balancingControl = &adi_balancingControl,
130  .data.errorTable = &adi_errorTable,
131  .data.allGpioVoltages = &adi_allGpioVoltage,
132  .data.allGpioVoltagesRedundant = &adi_allGpioVoltageRedundant,
133  .data.cellVoltageOpenWireEven = &adi_cellVoltageOpenWireEven,
134  .data.cellVoltageOpenWireOdd = &adi_cellVoltageOpenWireOdd,
135  .data.cellVoltageAverageOpenWire = &adi_cellVoltageAverageOpenWire,
136  .data.cellVoltageRedundantOpenWire = &adi_cellVoltageRedundantOpenWire,
137  .data.allGpioVoltageOpenWire = &adi_allGpioVoltageOpenWire,
138  .data.openWire = &adi_openWire,
139 };
140 
141 /*========== Static Function Prototypes =====================================*/
142 
143 /**
144  * @brief Read local variables from database and write local variables to
145  * database.
146  * @param adiState state of the ADI driver
147  */
148 
149 static void ADI_AccessToDatabase(ADI_STATE_s *adiState);
150 
151 /**
152  * @brief Sets the balancing according to the control values read in the
153  * database.
154  * @brief To set balancing for the cells, the corresponding bits have to be
155  * written in the configuration register.
156  * The ades183x driver only executes the balancing orders written by
157  * the BMS in the database.
158  * @param adiState state of the ADI driver
159  */
160 static void ADI_BalanceControl(ADI_STATE_s *adiState);
161 
162 /**
163  * @brief Checks the requests made to the ades183x driver.
164  * @param request request to be made with string addressed
165  * @return STD_OK if request queue was full, STD_NOT_OK otherwise
166  */
168 
169 /**
170  * @brief Runs the initialization sequence of the driver.
171  * @param adiState state of the ADI driver
172  * @param request request to be made with string addressed
173  * @return true if measurement has been started, false otherwise
174  *
175  */
176 static bool ADI_ProcessMeasurementNotStartedState(ADI_STATE_s *adiState, AFE_REQUEST_e *request);
177 
178 /**
179  * @brief sets the measurement initialization status.
180  */
182 
183 /*========== Static Function Implementations ================================*/
184 
185 static void ADI_AccessToDatabase(ADI_STATE_s *adiState) {
186  FAS_ASSERT(adiState != NULL_PTR);
187 
188  /* Increment state variable each time new values are written into database */
189  (void)DATA_WRITE_DATA(
190  adiState->data.cellVoltage,
191  adiState->data.cellVoltageFiltered,
192  adiState->data.allGpioVoltages,
193  adiState->data.cellTemperature);
194  ADI_Wait(2u); /* Block task to leave CPU time for the other tasks */
195 
196  (void)DATA_READ_DATA(adiState->data.balancingControl);
197 }
198 
199 /* RequirementId: D7.1 V0R4 FUN-6.10.01.01 */
200 static void ADI_BalanceControl(ADI_STATE_s *adiState) {
201  FAS_ASSERT(adiState != NULL_PTR);
202 
203  /* Unmute balancing, cell voltage measurements must have been stopped before */
205  ADI_TransmitCommand(adi_command, adiState);
206 
207  /* Write the balancing registers of the ades183x */
209 
210  /* Wait ADI_BALANCING_TIME_ms milliseconds in order to balance
211  Measurements are stopped during this time */
213 
214  /* Mute balancing, so that cell voltage measurements can be restarted */
216  ADI_TransmitCommand(adi_command, adiState);
217 }
218 
220  FAS_ASSERT(request != NULL_PTR);
221  STD_RETURN_TYPE_e requestReceived = STD_NOT_OK;
222  OS_STD_RETURN_e receivedFromQueue =
224  if (receivedFromQueue == OS_SUCCESS) {
225  /* request queue was full, request retrieved */
226  requestReceived = STD_OK;
227  }
228  return requestReceived;
229 }
230 
232  FAS_ASSERT(adiState != NULL_PTR);
233  FAS_ASSERT(request != NULL_PTR);
234 
235  bool measurementStarted = false;
236  STD_RETURN_TYPE_e requestReceived = ADI_GetRequest(request);
237  if (requestReceived == STD_OK) { /* request queue was not empty */
238  if (*request == AFE_START_REQUEST) {
239  ADI_InitializeMeasurement(adiState);
240  measurementStarted = true;
241  } else { /* Until requested to start, block task to leave CPU time for the other tasks */
242  ADI_Wait(1u);
243  }
244  } else { /* Until requested to start, block task to leave CPU time for the other tasks */
245  ADI_Wait(1u);
246  }
247  return measurementStarted;
248 }
249 
251  FAS_ASSERT(adiState != NULL_PTR);
252 
253  /* Start auxiliary voltage measurement, all channels */
259  ADI_TransmitCommand(adi_command, adiState);
260  /* Start redundant auxiliary voltage measurement, one channel */
263  adi_command,
266  adiState->redundantAuxiliaryChannel[adiState->currentString]);
267  ADI_TransmitCommand(adi_command, adiState);
268 
270 
271  /* Snapshot to freeze cell voltage measurement result registers */
273  ADI_TransmitCommand(adi_command, adiState);
274  /* Retrieve filtered cell voltages */
277  /* Release snapshot to refresh cell voltage measurement result registers again */
279  ADI_TransmitCommand(adi_command, adiState);
280 
281  /* Wait until auxiliary measurement cycle is finished */
283 
284  /* Retrieve GPIO voltages (all channels) */
286  /* Get temperatures via GPIO voltages */
287  ADI_GetTemperatures(adiState);
288 
289  ADI_AccessToDatabase(adiState);
290 
291  /* If at least one cell is balanced, measurements are stopped before activating balancing */
292  if (adiState->data.balancingControl->nrBalancedCells[adiState->currentString] > 0u) {
293  /* Stop cell voltage measurements before activating balancing */
295  /* Activate balancing (if necessary) */
296  ADI_BalanceControl(adiState);
297  /* Wait ADI_BALANCING_TIME_ms milliseconds in order to balance
298  Measurements are stopped during this time */
300  /* Restart cell voltage measurements before activating balancing */
302  }
303 
304  ADI_Diagnostic(adiState);
305 
306  /* Cycle finished for string, clear values to check that they are not stuck during next reading */
308  ADI_TransmitCommand(adi_command, adiState);
309 }
310 
312  FAS_ASSERT(adiState != NULL_PTR);
314  adiState->firstMeasurementMade = true;
316 }
317 
318 /*========== Extern Function Implementations ================================*/
319 
320 /* START extern functions to adapt if running in other environment (e.g., bare metal) */
321 
322 extern void ADI_ActivateInterfaceBoard(void) {
323  /* Set 3rd PE pins to enable daisy chains */
340 }
341 
343  FAS_ASSERT(request < AFE_REQUEST_E_MAX);
344 
345  STD_RETURN_TYPE_e requestSubmitted = STD_NOT_OK;
346 
348  /* request queue was empty, request submitted */
349  requestSubmitted = STD_OK;
350  }
351  return requestSubmitted;
352 }
353 
355  FAS_ASSERT(adiState != NULL_PTR);
356  return (adiState->firstMeasurementMade);
357 }
358 
359 /* END extern functions to adapt if running in other environment (e.g., bare metal) */
360 
361 /* RequirementId: D7.1 V0R4 FUN-1.10.01.03 */
362 /* RequirementId: D7.1 V0R4 FUN-2.10.01.03 */
363 /* RequirementId: D7.1 V0R4 FUN-4.10.01.03 */
364 extern void ADI_MeasurementCycle(ADI_STATE_s *adiState) {
365  FAS_ASSERT(adiState != NULL_PTR);
366  STD_RETURN_TYPE_e requestReceived = STD_OK;
367  AFE_REQUEST_e request = AFE_NO_REQUEST;
368 
369  /* AXIVION Next Line Style MisraC2012-2.2 FaultDetection-DeadBranches: non-blocking driver requires an infinite
370  * loop for the driver implementation */
371  while (FOREVER()) {
372  if (adiState->measurementStarted == false) { /* Wait until requested to start */
373  adiState->measurementStarted = ADI_ProcessMeasurementNotStartedState(adiState, &request);
374  } else {
375  while (adiState->currentString < adiState->spiNumberInterfaces) {
377  ++adiState->currentString;
378  }
379  adiState->currentString = 0u;
380  if (ADI_IsFirstMeasurementCycleFinished(adiState) == false) {
382  }
383  requestReceived = ADI_GetRequest(&request);
384  if (requestReceived == STD_OK) {
385  /* request queue was not empty */
386  if (request == AFE_STOP_REQUEST) {
387  adiState->measurementStarted = false;
388  }
389  }
390  }
391 
392 #ifdef UNITY_UNIT_TEST /* break out of loop in unit test*/
393  break;
394 #endif
395  }
396 }
397 
398 /*========== Externalized Static Function Implementations (Unit Test) =======*/
399 #ifdef UNITY_UNIT_TEST
400 extern void TEST_ADI_AccessToDatabase(ADI_STATE_s *adiState) {
401  ADI_AccessToDatabase(adiState);
402 }
403 extern void TEST_ADI_BalanceControl(ADI_STATE_s *adiState) {
404  ADI_BalanceControl(adiState);
405 }
406 extern STD_RETURN_TYPE_e TEST_ADI_GetRequest(AFE_REQUEST_e *request) {
407  return ADI_GetRequest(request);
408 }
409 extern bool TEST_ADI_ProcessMeasurementNotStartedState(ADI_STATE_s *adiState, AFE_REQUEST_e *request) {
410  return ADI_ProcessMeasurementNotStartedState(adiState, request);
411 }
412 extern void TEST_ADI_RunCurrentStringMeasurement(ADI_STATE_s *adiState) {
414 }
415 extern void TEST_ADI_SetFirstMeasurementCycleFinished(ADI_STATE_s *adiState) {
417 }
418 #endif
void ADI_DetermineBalancingRegisterConfiguration(ADI_STATE_s *adiState)
Determines how the balancing registers need to be set.
void ADI_GetGpioVoltages(ADI_STATE_s *adiState, ADI_AUXILIARY_REGISTER_TYPE_e registerType, ADI_AUXILIARY_STORE_LOCATION_e storeLocation)
Stores GPIO voltages.
static void ADI_SetFirstMeasurementCycleFinished(ADI_STATE_s *adiState)
sets the measurement initialization status.
Definition: adi_ades183x.c:311
static DATA_BLOCK_OPEN_WIRE_s adi_openWire
Definition: adi_ades183x.c:110
static bool ADI_ProcessMeasurementNotStartedState(ADI_STATE_s *adiState, AFE_REQUEST_e *request)
Runs the initialization sequence of the driver.
Definition: adi_ades183x.c:231
static DATA_BLOCK_ALL_GPIO_VOLTAGES_s adi_allGpioVoltageOpenWire
Definition: adi_ades183x.c:108
static void ADI_RunCurrentStringMeasurement(ADI_STATE_s *adiState)
Definition: adi_ades183x.c:250
STD_RETURN_TYPE_e ADI_MakeRequest(AFE_REQUEST_e request)
Makes a request to the ADI driver.
Definition: adi_ades183x.c:342
static DATA_BLOCK_CELL_VOLTAGE_s adi_cellVoltageFiltered
Definition: adi_ades183x.c:96
static DATA_BLOCK_CELL_VOLTAGE_s adi_cellVoltageRedundant
Definition: adi_ades183x.c:97
static DATA_BLOCK_BALANCING_CONTROL_s adi_balancingControl
Definition: adi_ades183x.c:99
static DATA_BLOCK_CELL_VOLTAGE_s adi_cellVoltage
Definition: adi_ades183x.c:94
static void ADI_BalanceControl(ADI_STATE_s *adiState)
Sets the balancing according to the control values read in the database.
Definition: adi_ades183x.c:200
ADI_STATE_s adi_stateBase
Definition: adi_ades183x.c:116
static DATA_BLOCK_CELL_VOLTAGE_s adi_cellVoltageAverage
Definition: adi_ades183x.c:95
void ADI_MeasurementCycle(ADI_STATE_s *adiState)
Implements the actual measurement sequence for the ADI driver.
Definition: adi_ades183x.c:364
static DATA_BLOCK_CELL_VOLTAGE_s adi_cellVoltageAverageOpenWire
Definition: adi_ades183x.c:105
static DATA_BLOCK_ALL_GPIO_VOLTAGES_s adi_allGpioVoltage
Definition: adi_ades183x.c:100
static DATA_BLOCK_CELL_TEMPERATURE_s adi_cellTemperature
Definition: adi_ades183x.c:98
static void ADI_AccessToDatabase(ADI_STATE_s *adiState)
Read local variables from database and write local variables to database.
Definition: adi_ades183x.c:185
static STD_RETURN_TYPE_e ADI_GetRequest(AFE_REQUEST_e *request)
Checks the requests made to the ades183x driver.
Definition: adi_ades183x.c:219
static DATA_BLOCK_CELL_VOLTAGE_s adi_cellVoltageRedundantOpenWire
Definition: adi_ades183x.c:106
static ADI_ERROR_TABLE_s adi_errorTable
Definition: adi_ades183x.c:111
bool ADI_IsFirstMeasurementCycleFinished(ADI_STATE_s *adiState)
Gets the measurement initialization status.
Definition: adi_ades183x.c:354
static DATA_BLOCK_ALL_GPIO_VOLTAGES_s adi_allGpioVoltageRedundant
Definition: adi_ades183x.c:101
static DATA_BLOCK_CELL_VOLTAGE_s adi_cellVoltageOpenWireOdd
Definition: adi_ades183x.c:104
void ADI_ActivateInterfaceBoard(void)
Sets the pins to activate the interface board.
Definition: adi_ades183x.c:322
static uint16_t adi_bufferRxPec[ADI_N_BYTES_FOR_DATA_TRANSMISSION]
Definition: adi_ades183x.c:87
static DATA_BLOCK_CELL_VOLTAGE_s adi_cellVoltageOpenWireEven
Definition: adi_ades183x.c:103
static uint16_t adi_bufferTxPec[ADI_N_BYTES_FOR_DATA_TRANSMISSION]
Definition: adi_ades183x.c:88
Headers for the driver for the ADI analog front-end.
Headers for the driver for the ADI analog front-end.
uint16_t adi_command[ADI_COMMAND_DEFINITION_LENGTH]
Header for the buffers used by the driver for the ADI analog front-end.
const uint16_t adi_cmdUnmute[ADI_COMMAND_DEFINITION_LENGTH]
const uint16_t adi_cmdMute[ADI_COMMAND_DEFINITION_LENGTH]
const uint16_t adi_cmdClrcell[ADI_COMMAND_DEFINITION_LENGTH]
const uint16_t adi_cmdAdax2[ADI_COMMAND_DEFINITION_LENGTH]
const uint16_t adi_cmdSnap[ADI_COMMAND_DEFINITION_LENGTH]
const uint16_t adi_cmdUnsnap[ADI_COMMAND_DEFINITION_LENGTH]
const uint16_t adi_cmdAdax[ADI_COMMAND_DEFINITION_LENGTH]
Header file of some software.
#define ADI_WAIT_TIME_1_FOR_ADAX_FULL_CYCLE
@ ADI_CELL_VOLTAGE_REGISTER
@ ADI_FILTERED_CELL_VOLTAGE_REGISTER
#define ADI_ADAX_CH4_POS
#define ADI_ADAX_OW_POS
#define ADI_ADAX_CH03_LEN
#define ADI_ADAX_PUP_POS
#define ADI_BALANCING_TIME_ms
#define ADI_ADAX_CH03_POS
#define ADI_ADAX_OW_LEN
#define ADI_WAIT_TIME_2_FOR_ADAX_FULL_CYCLE
#define ADI_ADAX_CH4_LEN
#define ADI_QUEUE_TIMEOUT_MS
#define ADI_N_BYTES_FOR_DATA_TRANSMISSION
#define ADI_ADAX2_CH03_POS
#define ADI_ADAX2_CH03_LEN
#define ADI_ADAX_PUP_LEN
@ ADI_AUXILIARY_REGISTER
@ ADI_FILTERED_CELL_VOLTAGE
@ ADI_CELL_VOLTAGE
@ ADI_AUXILIARY_VOLTAGE
Headers for the diagnostic driver for the ADI analog front-end.
void ADI_Diagnostic(ADI_STATE_s *adiState)
Make diagnostics with the built-in AFE functions.
Header file of some software.
void ADI_WriteCommandConfigurationBits(uint16_t *configuredCommand, uint8_t position, uint8_t length, uint16_t configuration)
write configuration bits in commands (e.g., channel in ADAX command).
void ADI_TransmitCommand(uint16_t *command, ADI_STATE_s *adiState)
send command to the ades183x daisy-chain (e.g., start voltage measurement).
void ADI_Wait(uint32_t waitTime)
wait for a certain number of milliseconds
void ADI_CopyCommandBits(const uint16_t *sourceCommand, uint16_t *destinationCommand)
copy command bits in variables.
Headers for the diagnostic driver for the ADI analog front-end.
void ADI_InitializeMeasurement(ADI_STATE_s *adiState)
Implements the initialization for the ades183x driver.
Header file of some software.
Headers for the PEC computations.
void ADI_GetTemperatures(ADI_STATE_s *adiState)
Store temperatures converted from GPIO voltages.
Header file of some software.
void ADI_StopContinuousCellVoltageMeasurements(ADI_STATE_s *adiState)
Stop cell voltage measurement.
void ADI_GetVoltages(ADI_STATE_s *adiState, ADI_VOLTAGE_REGISTER_TYPE_e registerType, ADI_VOLTAGE_STORE_LOCATION_e storeLocation)
Reads and stores cell voltages.
void ADI_RestartContinuousCellVoltageMeasurements(ADI_STATE_s *adiState)
Restart cell voltage measurement.
Header file of some software.
AFE_REQUEST_e
Definition: afe.h:69
@ AFE_STOP_REQUEST
Definition: afe.h:71
@ AFE_START_REQUEST
Definition: afe.h:70
@ AFE_REQUEST_E_MAX
Definition: afe.h:73
@ AFE_NO_REQUEST
Definition: afe.h:72
Database module header.
#define DATA_READ_DATA(...)
Definition: database.h:86
#define DATA_WRITE_DATA(...)
Definition: database.h:96
@ DATA_BLOCK_ID_BALANCING_CONTROL
Definition: database_cfg.h:83
@ DATA_BLOCK_ID_CELL_TEMPERATURE_BASE
Definition: database_cfg.h:87
@ DATA_BLOCK_ID_OPEN_WIRE_BASE
Definition: database_cfg.h:103
@ DATA_BLOCK_ID_CELL_VOLTAGE_BASE
Definition: database_cfg.h:90
@ DATA_BLOCK_ID_ALL_GPIO_VOLTAGES_BASE
Definition: database_cfg.h:81
#define FAS_ASSERT(x)
Assertion macro that asserts that x is true.
Definition: fassert.h:255
STD_RETURN_TYPE_e
Definition: fstd_types.h:82
@ STD_NOT_OK
Definition: fstd_types.h:84
@ STD_OK
Definition: fstd_types.h:83
#define NULL_PTR
Null pointer.
Definition: fstd_types.h:77
Header of task driver implementation.
OS_QUEUE ftsk_afeRequestQueue
Macros for implementing testable infinite loops.
#define FOREVER()
Declaration of the OS wrapper interface.
OS_STD_RETURN_e
Definition: os.h:85
@ OS_SUCCESS
Definition: os.h:86
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:264
void OS_ExitTaskCritical(void)
Exit Critical interface function for use in FreeRTOS-Tasks and FreeRTOS-ISR.
Definition: os_freertos.c:154
void OS_EnterTaskCritical(void)
Enter Critical interface function for use in FreeRTOS-Tasks and FreeRTOS-ISR.
Definition: os_freertos.c:150
OS_STD_RETURN_e OS_SendToBackOfQueue(OS_QUEUE xQueue, const void *const pvItemToQueue, uint32_t ticksToWait)
Post an item to the back the provided queue.
Definition: os_freertos.c:277
void PEX_SetPin(uint8_t portExpander, uint8_t pin)
sets pin to high.
Definition: pex.c:336
void PEX_SetPinDirectionOutput(uint8_t portExpander, uint8_t pin)
sets pin to input.
Definition: pex.c:409
Header for the driver for the NXP PCA9539 port expander module.
#define PEX_PIN16
Definition: pex_cfg.h:96
#define PEX_PIN13
Definition: pex_cfg.h:93
#define PEX_PIN10
Definition: pex_cfg.h:90
#define PEX_PORT_EXPANDER3
Definition: pex_cfg.h:77
#define PEX_PIN17
Definition: pex_cfg.h:97
#define PEX_PIN12
Definition: pex_cfg.h:92
#define PEX_PIN15
Definition: pex_cfg.h:95
#define PEX_PIN11
Definition: pex_cfg.h:91
#define PEX_PIN14
Definition: pex_cfg.h:94
DATA_BLOCK_CELL_VOLTAGE_s * cellVoltageFiltered
DATA_BLOCK_BALANCING_CONTROL_s * balancingControl
DATA_BLOCK_CELL_TEMPERATURE_s * cellTemperature
DATA_BLOCK_CELL_VOLTAGE_s * cellVoltage
DATA_BLOCK_ALL_GPIO_VOLTAGES_s * allGpioVoltages
uint8_t spiNumberInterfaces
uint8_t redundantAuxiliaryChannel[BS_NR_OF_STRINGS]
DATA_BLOCK_HEADER_s header
Definition: database_cfg.h:323
DATA_BLOCK_HEADER_s header
Definition: database_cfg.h:255
uint16_t nrBalancedCells[BS_NR_OF_STRINGS]
Definition: database_cfg.h:263
DATA_BLOCK_HEADER_s header
Definition: database_cfg.h:153
DATA_BLOCK_HEADER_s header
Definition: database_cfg.h:135
DATA_BLOCK_ID_e uniqueId
Definition: database_cfg.h:125
DATA_BLOCK_HEADER_s header
Definition: database_cfg.h:310