foxBMS - Unit Tests
1.4.1
The foxBMS Unit Tests API Documentation
|
Header for the configuration for the MC33775A monitoring chip. More...
#include "battery_system_cfg.h"
#include "nxp_afe_dma.h"
#include "nxp_mc33775a_defs.h"
#include "spi.h"
Go to the source code of this file.
Functions | |
int16_t | N775_ConvertVoltagesToTemperatures (uint16_t adcVoltage_mV) |
converts a raw voltage from multiplexer to a temperature value in deci °C. More... | |
Variables | |
N775_MUX_CH_CFG_s | n775_muxSequence [N775_MUX_SEQUENCE_LENGTH] |
Header for the configuration for the MC33775A monitoring chip.
SPDX-License-Identifier: BSD-3-Clause
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
We kindly request you to use one or more of the following phrases to refer to foxBMS in your hardware, software, documentation or advertising materials:
Definition in file nxp_mc33775a_cfg.h.
#define N775_I2C_NR_BYTES_FOR_MUX_WRITE (4u) |
Number of bytes to be sent over I2C to write and read I2C mux register in order to choose channel
Definition at line 68 of file nxp_mc33775a_cfg.h.
#define N775_I2C_NR_BYTES_TO_SWITCH_TO_READ_FOR_UX_READ (2u) |
Number of bytes in I2C transaction after which the I2C bus should change to read
Definition at line 71 of file nxp_mc33775a_cfg.h.
#define N775_MAX_N_BYTES_FOR_DATA_RECEPTION (N775_TX_MESSAGE_LENGTH * N775_MAX_NUMBER_OF_VOLTAGES) |
Max number of Bytes to be received from daisy-chain This limit is not due to the hardware. It is only to set the length of the receive buffer for DMA.
Definition at line 184 of file nxp_mc33775a_cfg.h.
#define N775_MAX_NUMBER_OF_VOLTAGES (14u) |
775A maximum number of cell voltages that can be measured.
Definition at line 133 of file nxp_mc33775a_cfg.h.
#define N775_N_N775 (BS_NR_OF_MODULES_PER_STRING) |
Number of used N775-ICs
Definition at line 113 of file nxp_mc33775a_cfg.h.
#define N775_NO_NOTIFIED_VALUE (0x0u) |
Default notification value, signals that no notification was received
Definition at line 90 of file nxp_mc33775a_cfg.h.
#define N775_NOTIFICATION_RX_INDEX (2u) |
Index used for FreeRTOS notification sent when RX DMA interrupt comes
Definition at line 86 of file nxp_mc33775a_cfg.h.
#define N775_NOTIFICATION_RX_TIMEOUT_ms (2u) |
Time in ms to wait for DMA RX notification, after this delay the transaction is considered to have failed
Definition at line 108 of file nxp_mc33775a_cfg.h.
#define N775_NOTIFICATION_TX_INDEX (1u) |
Index used for FreeRTOS notification sent when TX DMA interrupt comes
Definition at line 82 of file nxp_mc33775a_cfg.h.
#define N775_NOTIFICATION_TX_TIMEOUT_ms (1u) |
Time in ms to wait for DMA TX notification, after this delay the transaction is considered to have failed
Definition at line 103 of file nxp_mc33775a_cfg.h.
#define N775_NUMBER_OF_N775_PER_MODULE (1u) |
Number of N775-ICs per battery module
Definition at line 118 of file nxp_mc33775a_cfg.h.
#define N775_RX_MESSAGE_LENGTH (4u) |
775A Rx message length in bytes.
Definition at line 128 of file nxp_mc33775a_cfg.h.
#define N775_RX_NOTIFIED_VALUE (0x60u) |
Notification value sent when RX DMA interrupt comes
Definition at line 98 of file nxp_mc33775a_cfg.h.
#define N775_SendData | ( | txbuf, | |
rxbuf, | |||
length | |||
) | SPI_TransmitReceiveDataDma(&spi_nxp775InterfaceTx[0], txbuf, rxbuf, length) |
Transmit functions
Definition at line 189 of file nxp_mc33775a_cfg.h.
#define N775_STATEMACH_SHORTTIME (1u) |
N775 statemachine short time definition in ms
Definition at line 144 of file nxp_mc33775a_cfg.h.
#define N775_TDWAKE_MS (4u) |
N775 Time between two consecutive wake-up messages in ms 4ms in data sheet
Definition at line 156 of file nxp_mc33775a_cfg.h.
#define N775_TIME_AFTER_ENUMERATION_MS (1u) |
N775 time after enumeraiton in ms
Definition at line 171 of file nxp_mc33775a_cfg.h.
#define N775_TIME_BETWEEN_WAKEUP_MS (4u) |
N775 time between two wake up commands in ms
Definition at line 166 of file nxp_mc33775a_cfg.h.
#define N775_TIME_DAISYCHAIN_WAKEUP_MS (N775_N_N775 * (N775_TWAKECOM_MS + N775_TDWAKE_MS)) |
N775 time for daisy-chain to wake-up in ms
Definition at line 161 of file nxp_mc33775a_cfg.h.
#define N775_TRANSMISSION_TIMEOUT (10u) |
Timeout in milliseconds added to the transmission time for interrupt-based SPI transmission.
Definition at line 139 of file nxp_mc33775a_cfg.h.
#define N775_TRANSMIT_SPIERRLIMIT (3u) |
Maximum number of re-tries in case of SPI error during the communication with daisy chain before going into error state
Definition at line 177 of file nxp_mc33775a_cfg.h.
#define N775_TWAKECOM_MS (3u) |
N775 Maximum time from wakeup event to possible communication in ms 2.4ms in data sheet
Definition at line 150 of file nxp_mc33775a_cfg.h.
#define N775_TX_MESSAGE_LENGTH (7u) |
775A Tx message length in bytes.
Definition at line 123 of file nxp_mc33775a_cfg.h.
#define N775_TX_NOTIFIED_VALUE (0x50u) |
Notification value sent when TX DMA interrupt comes
Definition at line 94 of file nxp_mc33775a_cfg.h.
#define N775_USE_NOTIFICATIONS (true) |
If false, driver runs blocking for SPI transactions If true, driver blocks task and waits for notification for SPI transaction
Definition at line 77 of file nxp_mc33775a_cfg.h.
int16_t N775_ConvertVoltagesToTemperatures | ( | uint16_t | adcVoltage_mV | ) |
converts a raw voltage from multiplexer to a temperature value in deci °C.
The temperatures are read from NTC elements via voltage dividers. This function implements the look-up table between voltage and temperature, taking into account the NTC characteristics and the voltage divider.
adcVoltage_mV | voltage read from the multiplexer in mV |
Definition at line 186 of file nxp_mc33775a_cfg.c.
|
extern |
Multiplexer measurement sequence
Default multiplexer measurement sequence Must be adapted to the application
Definition at line 70 of file nxp_mc33775a_cfg.c.