|
foxBMS-UnitTests
1.0.0
The foxBMS Unit Tests API Documentation
|
Go to the documentation of this file.
75 while (((bitmask >> retval) & 1u) == 0u) {
103 uint32_t fullScaleReference_mV) {
104 uint16_t temporaryVoltage = 0;
107 temporaryVoltage = temporaryVoltage + 1u;
116 *pTarget = ((temporaryVoltage * fullScaleReference_mV) / 0x3FFFu);
128 uint16_t voltage = 0u;
137 MXM_Convert(lsb, msb, &voltage, conversionType, 5000);
144 MXM_Convert(lsb, msb, &voltage, conversionType, 5000);
151 MXM_Convert(lsb, msb, &voltage, conversionType, 5000);
165 uint8_t lsbMasked = lsb & ((uint8_t)(bitmask &
MXM_BM_LSB));
167 uint8_t msbMasked = msb & ((uint8_t)(msbBitmask >> 8u));
170 *pValue = 0u | (lsbMasked >> start);
173 *pValue = (((uint16_t)msbMasked << (8u - start)) | *pValue);
179 uint16_t value = 0x00u;
206 uint16_t workingCopy = inputValue;
208 workingCopy = workingCopy << 2u;
213 *msb = workingCopy >> 8u;
217 uint32_t temporaryVoltage = voltage_mV;
219 temporaryVoltage = temporaryVoltage * 0x3FFFu;
221 return (uint16_t)(temporaryVoltage / fullscaleReference_mV);
225 const uint16_t moduleNumber,
226 uint8_t *pStringNumber,
227 uint16_t *pModuleNumberInString) {
239 *pModuleNumberInString = 0u;
@ MXM_CONVERSION_BLOCK_VOLTAGE
#define MXM_BM_LSB
Monitoring Register LSB.
enum MXM_CONVERSION_TYPE MXM_CONVERSION_TYPE_e
#define BS_NR_OF_MODULES
number of modules in battery pack
enum STD_RETURN_TYPE STD_RETURN_TYPE_e
Register map of the MAX1785x monitoring IC.
#define MXM_REG_VERSION_VER
Monitoring Register Version/Silicon Version.
#define MXM_MAXIMUM_NR_OF_MODULES
Maximum number of modules.
#define MXM_BM_MSB
Monitoring Register MSB.
@ MXM_CONVERSION_UNIPOLAR
#define FAS_ASSERT(x)
Assertion macro that asserts that x is true.
#define must_check_return
Allows functions to generate warnings in GCC for unused returns.
#define MXM_BM_NULL
Monitoring Register Null byte.
uint16_t MXM_REG_BM
Type for register access for monitoring ICs.
#define MXM_REG_ADC_14BIT_VALUE
Monitoring Register 14bit ADC value.
#define NULL_PTR
Null pointer.
#define MXM_REG_VERSION_MOD
Monitoring Register Version/Model.
#define FAS_TRAP
Define that evaluates to essential boolean false thus tripping an assert.