64 #define MXM_MON_REGISTRY_STATUS_FMEA_DEFAULT (0xFFFFu)
67 #define MXM_REGISTRY_SHIFT_ONE_BYTE (8u)
101 for (uint8_t i = 0; i < numberOfDevices; i++) {
120 uint8_t rxBufferLength,
128 const uint8_t highestConnectedDevice =
131 const uint8_t startBytes = 2u;
133 for (uint8_t i = 0; i <= highestConnectedDevice; i++) {
134 const uint8_t bufferPosition = startBytes + (i * 2u);
136 FAS_ASSERT((bufferPosition + 1u) <= rxBufferLength);
141 currentDevice->deviceID = id;
144 currentDevice->deviceID = ((uint32_t)
id << 16u) | currentDevice->deviceID;
155 const uint8_t highestConnectedDevice =
158 for (uint8_t i = 0; i <= highestConnectedDevice; i++) {
159 const uint8_t startBytes = 2u;
160 const uint8_t bufferPosition = startBytes + (i * 2u);
162 FAS_ASSERT((bufferPosition + 1u) <= rxBufferLength);
177 uint16_t version = 0;
195 const uint8_t highestConnectedDevice =
199 const uint8_t currentRegister = pState->
rxBuffer[1u];
201 for (uint8_t i = 0; i <= highestConnectedDevice; i++) {
202 const uint8_t startBytes = 2u;
203 const uint8_t bufferPosition = startBytes + (i * 2u);
205 FAS_ASSERT((bufferPosition + 1u) <= rxBufferLength);
206 uint16_t registerValue = 0u;
210 switch (currentRegister) {
212 currentDevice->registerStatus1 = registerValue;
215 currentDevice->registerStatus2 = registerValue;
218 currentDevice->registerStatus3 = registerValue;
221 currentDevice->registerFmea1 = registerValue;
224 currentDevice->registerFmea2 = registerValue;
237 const uint8_t highestConnectedDevice =
240 bool deviceReset =
false;
242 for (uint8_t i = 0; i <= highestConnectedDevice; i++) {
244 const uint8_t lsb = (uint8_t)(status1 &
MXM_BM_LSB);
246 uint16_t alertReset = 0u;
248 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.
enum STD_RETURN_TYPE STD_RETURN_TYPE_e
#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_MODEL_ID_e
Type of monitoring device.
@ MXM_siliconVersion_invalid
#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_siliconVersion_e siliconVersion