65 #define MXM_MON_REGISTRY_STATUS_FMEA_DEFAULT (0xFFFFu)
68 #define MXM_REGISTRY_SHIFT_ONE_BYTE (8u)
104 for (uint8_t i = 0; i < numberOfDevices; i++) {
123 uint8_t rxBufferLength,
131 const uint8_t highestConnectedDevice =
134 const uint8_t startBytes = 2u;
136 for (uint8_t i = 0; i <= highestConnectedDevice; i++) {
137 const uint8_t bufferPosition = startBytes + (i * 2u);
139 FAS_ASSERT((bufferPosition + 1u) <= rxBufferLength);
144 currentDevice->deviceID = id;
147 currentDevice->deviceID = ((uint32_t)
id << 16u) | currentDevice->deviceID;
158 const uint8_t highestConnectedDevice =
161 for (uint8_t i = 0; i <= highestConnectedDevice; i++) {
162 const uint8_t startBytes = 2u;
163 const uint8_t bufferPosition = startBytes + (i * 2u);
165 FAS_ASSERT((bufferPosition + 1u) <= rxBufferLength);
180 uint16_t version = 0;
198 const uint8_t highestConnectedDevice =
202 const uint8_t currentRegister = pState->
rxBuffer[1u];
204 for (uint8_t i = 0; i <= highestConnectedDevice; i++) {
205 const uint8_t startBytes = 2u;
206 const uint8_t bufferPosition = startBytes + (i * 2u);
208 FAS_ASSERT((bufferPosition + 1u) <= rxBufferLength);
209 uint16_t registerValue = 0u;
213 switch (currentRegister) {
215 currentDevice->registerStatus1 = registerValue;
218 currentDevice->registerStatus2 = registerValue;
221 currentDevice->registerStatus3 = registerValue;
224 currentDevice->registerFmea1 = registerValue;
227 currentDevice->registerFmea2 = registerValue;
230 currentDevice->registerBalstat = registerValue;
243 const uint8_t highestConnectedDevice =
246 bool deviceReset =
false;
248 for (uint8_t i = 0; i <= highestConnectedDevice; i++) {
250 const uint8_t lsb = (uint8_t)(status1 &
MXM_BM_LSB);
252 uint16_t alertReset = 0u;
254 if (alertReset == 1u) {
#define FAS_ASSERT(x)
Assertion macro that asserts that x is true.
uint8_t MATH_MinimumOfTwoUint8_t(const uint8_t value1, const uint8_t value2)
Returns the minimum of the passed uint8_t values.
math library for often used math functions
#define NULL_PTR
Null pointer.
#define MXM_BM_LSB
Monitoring Register LSB.
#define MXM_BM_WHOLE_REG
All bits of monitoring register.
#define MXM_BM_MSB
Monitoring Register MSB.
#define MXM_REG_VERSION_VER
Monitoring Register Version/Silicon Version.
#define MXM_REG_VERSION_MOD
Monitoring Register Version/Model.
#define MXM_REG_STATUS1_ALRTRST
ALRTRST bit in STATUS1.
@ MXM_SILICON_VERSION_INVALID
MXM_MODEL_ID_e
Type of monitoring device.
#define MXM_MAXIMUM_NR_OF_MODULES
Maximum number of modules.
#define HELLOALL_START_SEED
MXM_REG_NAME_e
MAX1785x register names.
bool MXM_CheckIfADeviceIsConnected(const MXM_MONITORING_INSTANCE_s *const kpkState, uint8_t device)
check if a device is connected
void MXM_MonRegistryParseIdIntoDevices(MXM_MONITORING_INSTANCE_s *pState, uint8_t rxBufferLength, MXM_REG_NAME_e type)
Parse ID (1 or 2) into the registry.
void MXM_MonRegistryInit(MXM_MONITORING_INSTANCE_s *pState)
Initialize monitoring registry.
STD_RETURN_TYPE_e MXM_MonRegistryConnectDevices(MXM_MONITORING_INSTANCE_s *pState, uint8_t numberOfDevices)
Mark devices as connected in the registry and set the address.
#define MXM_MON_REGISTRY_STATUS_FMEA_DEFAULT
uint8_t MXM_MonRegistryGetHighestConnected5XDevice(const MXM_MONITORING_INSTANCE_s *const kpkState)
Parse number of highest connected device from monitoring- register.
void MXM_MonRegistryParseStatusFmeaIntoDevices(MXM_MONITORING_INSTANCE_s *pState, uint8_t rxBufferLength)
Parse STATUS or FMEA into the registry.
void MXM_MonRegistryParseVersionIntoDevices(MXM_MONITORING_INSTANCE_s *pState, uint8_t rxBufferLength)
Parse Version into the registry.
bool MXM_CheckIfADeviceHasBeenReset(const MXM_MONITORING_INSTANCE_s *const kpkState)
check if one of the devices in the registry has the ALRTRST bit set
#define MXM_REGISTRY_SHIFT_ONE_BYTE
Functions in order to have a registry of monitoring ICs.
uint8_t rxBuffer[MXM_RX_BUFFER_LENGTH]
MXM_REGISTRY_ENTRY_s registry[MXM_MAXIMUM_NR_OF_MODULES]
MXM_SILICON_VERSION_e siliconVersion