foxBMS - Unit Tests
1.4.1
The foxBMS Unit Tests API Documentation
|
Functions in order to have a registry of monitoring ICs. More...
Go to the source code of this file.
Functions | |
void | MXM_MonRegistryInit (MXM_MONITORING_INSTANCE_s *pState) |
Initialize monitoring registry. More... | |
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. More... | |
uint8_t | MXM_MonRegistryGetHighestConnected5XDevice (const MXM_MONITORING_INSTANCE_s *const kpkState) |
Parse number of highest connected device from monitoring- register. More... | |
void | MXM_MonRegistryParseIdIntoDevices (MXM_MONITORING_INSTANCE_s *pState, uint8_t rxBufferLength, MXM_REG_NAME_e type) |
Parse ID (1 or 2) into the registry. More... | |
void | MXM_MonRegistryParseVersionIntoDevices (MXM_MONITORING_INSTANCE_s *pState, uint8_t rxBufferLength) |
Parse Version into the registry. More... | |
void | MXM_MonRegistryParseStatusFmeaIntoDevices (MXM_MONITORING_INSTANCE_s *pState, uint8_t rxBufferLength) |
Parse STATUS or FMEA into the registry. More... | |
bool | MXM_CheckIfADeviceHasBeenReset (const MXM_MONITORING_INSTANCE_s *const kpkState) |
check if one of the devices in the registry has the ALRTRST bit set More... | |
bool | MXM_CheckIfADeviceIsConnected (const MXM_MONITORING_INSTANCE_s *const kpkState, uint8_t device) |
check if a device is connected More... | |
Functions in order to have a registry of monitoring ICs.
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:
Monitoring registry stores information about the connected ICs.
Definition in file mxm_registry.h.
bool MXM_CheckIfADeviceHasBeenReset | ( | const MXM_MONITORING_INSTANCE_s *const | kpkState | ) |
check if one of the devices in the registry has the ALRTRST bit set
If a monitoring device is reset, it will set the ALRTRST bit in MXM_REG_STATUS1. This should not happen during normal operation. If this happens, initialization of the devices is lost and has to be restored. This is done by reseting the state machine.
[in,out] | kpkState | state-pointer |
Definition at line 239 of file mxm_registry.c.
bool MXM_CheckIfADeviceIsConnected | ( | const MXM_MONITORING_INSTANCE_s *const | kpkState, |
uint8_t | device | ||
) |
check if a device is connected
Checks the connected state in the registry
[in] | kpkState | state-pointer |
[in] | device | device number |
Definition at line 262 of file mxm_registry.c.
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.
Takes the number of connected (adjacent!) devices and marks them in the registry.
[in,out] | pState | state-pointer |
[in] | numberOfDevices | number of normal satellites |
Definition at line 96 of file mxm_registry.c.
uint8_t MXM_MonRegistryGetHighestConnected5XDevice | ( | const MXM_MONITORING_INSTANCE_s *const | kpkState | ) |
Parse number of highest connected device from monitoring- register.
[in] | kpkState | state-pointer |
Definition at line 115 of file mxm_registry.c.
void MXM_MonRegistryInit | ( | MXM_MONITORING_INSTANCE_s * | pState | ) |
Initialize monitoring registry.
Sets the connected state of every entry of the registry of monitoring ICs to false.
[in] | pState | state-pointer |
Definition at line 79 of file mxm_registry.c.
void MXM_MonRegistryParseIdIntoDevices | ( | MXM_MONITORING_INSTANCE_s * | pState, |
uint8_t | rxBufferLength, | ||
MXM_REG_NAME_e | type | ||
) |
Parse ID (1 or 2) into the registry.
[in,out] | pState | state-pointer |
[in] | rxBufferLength | length of the rxBuffer |
[in] | type | type of register (has to be MXM_REG_ID1 or MXM_REG_ID2) |
Definition at line 121 of file mxm_registry.c.
void MXM_MonRegistryParseStatusFmeaIntoDevices | ( | MXM_MONITORING_INSTANCE_s * | pState, |
uint8_t | rxBufferLength | ||
) |
Parse STATUS or FMEA into the registry.
[in,out] | pState | state-pointer |
[in] | rxBufferLength | length of the rxBuffer |
Definition at line 192 of file mxm_registry.c.
void MXM_MonRegistryParseVersionIntoDevices | ( | MXM_MONITORING_INSTANCE_s * | pState, |
uint8_t | rxBufferLength | ||
) |
Parse Version into the registry.
[in,out] | pState | state-pointer |
[in] | rxBufferLength | length of the rxBuffer |
Definition at line 152 of file mxm_registry.c.