|
foxBMS
1.0.0
The foxBMS Battery Management System API Documentation
|
Go to the documentation of this file.
57 #ifndef FOXBMS__MXM_BATTERY_MANAGEMENT_H_
58 #define FOXBMS__MXM_BATTERY_MANAGEMENT_H_
71 #define COMMAND_BUFFER_LENGTH (6u)
74 #define MXM_5X_RX_BUFFER_LEN 100u
77 #define HELLOALL_START_SEED 0x00u
79 #define DATA_CHECK_BYTE_SEED 0x00u
81 #define ALIVE_COUNTER_SEED 0x00u
94 #define BATTERY_MANAGEMENT_HELLOALL ((BATTERY_MANAGEMENT_COMMAND_t)0x57u)
99 #define BATTERY_MANAGEMENT_ALERTPACKET ((BATTERY_MANAGEMENT_COMMAND_t)0x21u)
104 #define BATTERY_MANAGEMENT_WRITEDEVICE ((BATTERY_MANAGEMENT_COMMAND_t)0x04u)
109 #define BATTERY_MANAGEMENT_WRITEALL ((BATTERY_MANAGEMENT_COMMAND_t)0x02u)
114 #define BATTERY_MANAGEMENT_READDEVICE ((BATTERY_MANAGEMENT_COMMAND_t)0x05u)
119 #define BATTERY_MANAGEMENT_READALL ((BATTERY_MANAGEMENT_COMMAND_t)0x03u)
124 #define BATTERY_MANAGEMENT_READBLOCK ((BATTERY_MANAGEMENT_COMMAND_t)0x06u)
130 #define BATTERY_MANAGEMENT_DOWNHOST ((BATTERY_MANAGEMENT_COMMAND_t)0x09u)
135 #define BATTERY_MANAGEMENT_UPHOST ((BATTERY_MANAGEMENT_COMMAND_t)0x08u)
146 #define BATTERY_MANAGEMENT_TX_LENGTH_READALL ((uint8_t)4u)
@ MXM_5X_INIT_WAKE_UP_SATELLITE_DEVICES_WAIT_FOR_RX_STATUS_EMPTY
5x statemachine structure
MXM_5X_STATE_REQUEST_STATUS_e * processed
MXM_5X_SUBSTATES_e substate
@ MXM_5X_INIT_WAKE_UP_SATELLITE_DEVICES_CLEAR_RECEIVE_BUFFER_2
@ MXM_5X_INIT_WAKE_UP_SATELLITE_DEVICES_HELLOALL_VERIFY_MSG_AND_COUNT
Headers for the driver for the MAX17841B ASCI and MAX1785x monitoring chip.
@ MXM_5X_INIT_ENABLE_KEEP_ALIVE
enum STD_RETURN_TYPE STD_RETURN_TYPE_e
@ MXM_STATEMACH_5X_41B_FMEA_CHECK
#define COMMAND_BUFFER_LENGTH
@ MXM_STATEMACH_5X_UNINITIALIZED
enum MXM_DC_BYTE MXM_DC_BYTE_e
Register map of the MAX1785x monitoring IC.
Headers for the CRC8 calculation for Maxim Integrated Monitoring devices.
MXM_5X_STATE_REQUEST_STATUS_e
Request status of Battery Management Protocol states.
Header for the configuration for the Maxim monitoring chip.
@ MXM_5X_INIT_WAKE_UP_SATELLITE_DEVICES_WAIT_FOR_RX_STATUS_BUSY
uint8_t commandBufferCurrentLength
Length of Command Buffer.
@ MXM_5X_WRITEALL_UART_VERIFY_BUFFER
@ MXM_5X_INIT_ENABLE_RX_INTERRUPT_FLAGS
@ MXM_5X_INIT_WAKE_UP_SATELLITE_DEVICES_HELLOALL
@ MXM_5X_STATE_UNPROCESSED
enum MXM_41B_STATE_REQUEST_STATUS MXM_41B_STATE_REQUEST_STATUS_e
Request status of MAX17841B states.
@ MXM_STATEMACH_5X_WRITEALL
uint8_t BATTERY_MANAGEMENT_COMMAND_t
Type for Battery Management Protocol commands.
@ MXM_STATEMACH_5X_WRITE_DEVICE
@ MXM_5X_INIT_WAKE_UP_SATELLITE_DEVICES_CLEAR_TRANSMIT_BUFFER
MXM_REG_NAME_e regAddress
@ MXM_5X_41B_FMEA_REQUEST
uint8_t numberOfSatellites
Number of satellites.
@ MXM_STATEMACH_5X_MAXSTATE
#define must_check_return
Allows functions to generate warnings in GCC for unused returns.
@ MXM_5X_READALL_CHECK_CRC
struct MXM_5X_INSTANCE MXM_5X_INSTANCE_s
5x statemachine structure
@ MXM_5X_INIT_WAKE_UP_SATELLITE_DEVICES_DIS_PREAMBLES
MXM_STATEMACHINE_5X_e state
Struct for the state-variable of state-machine.
uint8_t MXM_5XGetNumberOfSatellites(MXM_5X_INSTANCE_s *pInstance)
Get number of satellites.
enum MXM_REG_NAME MXM_REG_NAME_e
MAX1785x register names.
STD_RETURN_TYPE_e numberOfSatellitesIsGood
Command Buffer.
MXM_DC_BYTE_e MXM_5XGetLastDCByte(MXM_5X_INSTANCE_s *pInstance)
Returns the last received DC byte.
@ MXM_5X_READALL_UART_TRANSACTION
@ MXM_5X_WRITEALL_UART_TRANSACTION
MXM_41B_STATE_REQUEST_STATUS_e status41b
STD_RETURN_TYPE_e MXM_5XSetStateRequest(MXM_5X_INSTANCE_s *pInstance5x, MXM_STATEMACHINE_5X_e state, MXM_5X_COMMAND_PAYLOAD_s commandPayload, MXM_5X_STATE_REQUEST_STATUS_e *processed)
Set state request for the Battery Management Statemachine.
@ MXM_STATEMACH_5X_READALL
STD_RETURN_TYPE_e MXM_5XGetNumberOfSatellitesGood(MXM_5X_INSTANCE_s *pInstance)
Get the value of MXM_5X_INSTANCE::numberOfSatellitesIsGood.
@ MXM_5X_INIT_WAKE_UP_SATELLITE_DEVICES_CLEAR_RECEIVE_BUFFER
Basic defines for the complete Maxim driver.
STD_RETURN_TYPE_e MXM_5XGetRXBuffer(MXM_5X_INSTANCE_s *pInstance, uint8_t *rxBuffer, uint16_t rxBufferLength)
Copy RX buffer into variable.
MXM_5X_SUBSTATES_e
Sub-states of the Battery Management Protocol state-machine.
MXM_5X_COMMAND_PAYLOAD_s commandPayload
@ MXM_5X_INIT_WAKE_UP_SATELLITE_DEVICES_EN_PREAMBLES
uint16_t rxBuffer[MXM_5X_RX_BUFFER_LEN]
@ MXM_5X_WRITE_DEVICE_CHECK_CRC
uint16_t commandBuffer[COMMAND_BUFFER_LENGTH]
uint8_t lastDCByte
Tracks the last received DC byte.
STD_RETURN_TYPE_e must_check_return MXM_5XUserAccessibleAddressSpaceCheckerSelfCheck(void)
runs a selfcheck for the address space check
@ MXM_5X_WRITE_DEVICE_UART_TRANSACTION
void MXM_5XStateMachine(MXM_41B_INSTANCE_s *pInstance41b, MXM_5X_INSTANCE_s *pInstance5x)
Execute state-machine for Battery Management Protocol.
#define MXM_5X_RX_BUFFER_LEN
MXM_STATEMACHINE_5X_e
States of the Battery Management Protocol state-machine.