55 #ifndef FOXBMS__SPS_CFG_H_
56 #define FOXBMS__SPS_CFG_H_
68 #define SPS_RESET_GIO_PORT (hetREG2->DOUT)
69 #define SPS_RESET_GIO_PORT_DIR (hetREG2->DIR)
70 #define SPS_RESET_PIN (16u)
74 #define SPS_FEEDBACK_GIO_PORT (hetREG2->DOUT)
75 #define SPS_FEEDBACK_GIO_PORT_DIR (hetREG2->DIR)
76 #define SPS_FEEDBACK_PIN (9u)
80 #define SPS_NR_CONTACTOR_PER_IC (4u)
83 #define SPS_NR_OF_IC (2u)
86 #define SPS_NR_OF_REQUIRED_CONTACTOR_CHANNELS (BS_NR_OF_CONTACTORS)
89 #define SPS_NR_OF_AVAILABLE_SPS_CHANNELS (SPS_NR_CONTACTOR_PER_IC * SPS_NR_OF_IC)
92 #if (SPS_NR_OF_REQUIRED_CONTACTOR_CHANNELS > SPS_NR_OF_AVAILABLE_SPS_CHANNELS)
93 #error "Not enough contactor channels available for the required number of contactors."
105 #define SPS_SPI_BUFFERSIZE SPS_NR_OF_IC
108 #define SPS_GLOBAL_CONTROL_REGISTER_ADDRESS (0x00u)
109 #define SPS_OUTPUT_CONTROL_REGISTER_ADDRESS (0x02u)
110 #define SPS_C_CONTROL_REGISTER_ADDRESS (0x16u)
113 #define SPS_OD_IOUT1_DIAG_REGISTER_ADDRESS (0x08u)
114 #define SPS_OD_IOUT2_DIAG_REGISTER_ADDRESS (0x09u)
115 #define SPS_OD_IOUT3_DIAG_REGISTER_ADDRESS (0x0Au)
116 #define SPS_OD_IOUT4_DIAG_REGISTER_ADDRESS (0x0Bu)
117 #define SPS_EN_IRQ_PIN_DIAG_REGISTER_ADDRESS (0x11u)
118 #define SPS_EN_WARN_PIN_DIAG_REGISTER_ADDRESS (0x13u)
126 #define SPS_RW_BIT_POSITION (15u)
128 #define SPS_RW_READ (0u)
130 #define SPS_RW_WRITE (1u)
132 #define SPS_ADDRESS_BIT_START (8u)
134 #define SPS_DIAG_CTRL_BIT_POSITION (7u)
137 #define SPS_NORMAL_MODE (0x01u)
139 #define SPS_STRONG_DRIVE (0x00u)
141 #define SPS_MEDIUM_DRIVE (0x01u)
146 #define SPS_MODE_BIT_START (6u)
148 #define SPS_DRIVE_STRENGTH_BIT_START (5u)
151 #define SPS_I_MEASUREMENT_LSB_mA (0.98f)
154 #define SPS_CHANNEL_ON_DEFAULT_THRESHOLD_mA (20.0f)
157 #define SPS_BITMASK_DIAGNOSTIC_ONDEMAND_OUTPUT_CURRENT (0x1FFFu)
Configuration of the battery system (e.g., number of battery modules, battery cells,...
General macros and definitions for the whole platform.
#define SPS_NR_OF_AVAILABLE_SPS_CHANNELS
SPS_CHANNEL_STATE_s sps_channelStatus[SPS_NR_OF_AVAILABLE_SPS_CHANNELS]
@ SPS_READ_DIAGNOSTIC_REGISTER
@ SPS_READ_CONTROL_REGISTER
@ SPS_ACTION_READ_CURRENT_MEASUREMENT2
@ SPS_ACTION_READ_CURRENT_MEASUREMENT1
@ SPS_ACTION_TRIGGER_CURRENT_MEASUREMENT
@ SPS_ACTION_READ_EN_IRQ_PIN
@ SPS_ACTION_READ_CURRENT_MEASUREMENT4
@ SPS_ACTION_CONFIGURE_CONTROL_REGISTER
@ SPS_ACTION_READ_CURRENT_MEASUREMENT3
const SPS_CHANNEL_FEEDBACK_MAPPING_s sps_kChannelFeedbackMapping[SPS_NR_OF_AVAILABLE_SPS_CHANNELS]
@ SPS_andWithCurrentValue
@ SPS_replaceCurrentValue
@ SPS_TRIGGER_CURRENT_MEASUREMENT
@ SPS_CONFIGURE_CONTROL_REGISTER
@ SPS_READ_MEASURED_CURRENT2
@ SPS_READ_MEASURED_CURRENT1
@ SPS_READ_MEASURED_CURRENT3
@ SPS_READ_MEASURED_CURRENT4
Types for the SPS driver.
SPS_CHANNEL_AFFILIATION_e
affiliation type of a sps channel
SPS_CHANNEL_FUNCTION_e channelRequested
SPS_CHANNEL_FUNCTION_e channel
const float thresholdFeedbackOn_mA
const SPS_CHANNEL_AFFILIATION_e affiliation