64 #define MXM_TOOLS_LENGTH_BYTE (8u)
83 while (((bitmask >> retval) & 1u) == 0u) {
116 uint32_t fullScaleReference_mV) {
118 uint16_t temporaryVoltage = 0;
121 temporaryVoltage = temporaryVoltage + (uint16_t)1u;
122 const uint32_t scaledVoltageUnipolar_mV = (temporaryVoltage * fullScaleReference_mV) / 0x3FFFu;
131 if (scaledVoltageUnipolar_mV > (uint16_t)UINT16_MAX) {
132 *pTarget = UINT16_MAX;
134 *pTarget = (uint16_t)scaledVoltageUnipolar_mV;
152 uint16_t voltage = 1;
153 MXM_Convert(lsb, msb, &voltage, conversionType, 5000);
160 MXM_Convert(lsb, msb, &voltage, conversionType, 5000);
167 MXM_Convert(lsb, msb, &voltage, conversionType, 5000);
189 uint8_t lsbMasked = lsb & ((uint8_t)(bitmask &
MXM_BM_LSB));
190 *pValue = ((uint16_t)lsbMasked >> start);
194 *pValue = (uint16_t)msbMasked;
204 uint16_t value = 0x00u;
231 uint16_t workingCopy = inputValue;
233 workingCopy = workingCopy << 2u;
242 uint32_t temporaryVoltage = voltage_mV;
244 temporaryVoltage = temporaryVoltage * 0x3FFFu;
246 return (uint16_t)(temporaryVoltage / fullscaleReference_mV);
250 const uint16_t moduleNumber,
251 uint8_t *pStringNumber,
252 uint16_t *pModuleNumberInString) {
265 *pModuleNumberInString = 0u;
#define BS_NR_OF_MODULES
number of modules in battery pack
#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.
#define NULL_PTR
Null pointer.
enum STD_RETURN_TYPE STD_RETURN_TYPE_e
#define must_check_return
Allows functions to generate warnings in GCC for unused returns.
#define MXM_BM_LSB
Monitoring Register LSB.
#define MXM_BM_MSB
Monitoring Register MSB.
#define MXM_BM_NULL
Monitoring Register Null byte.
#define MXM_REG_VERSION_VER
Monitoring Register Version/Silicon Version.
#define MXM_REG_VERSION_MOD
Monitoring Register Version/Model.
#define MXM_REG_ADC_14BIT_VALUE
Monitoring Register 14bit ADC value.
@ MXM_CONVERSION_UNIPOLAR
@ MXM_CONVERSION_BLOCK_VOLTAGE
#define MXM_MAXIMUM_NR_OF_MODULES
Maximum number of modules.
Register map of the MAX1785x monitoring IC.
uint16_t MXM_REG_BM
Type for register access for monitoring ICs.