55 #ifndef FOXBMS__SPS_CFG_H_
56 #define FOXBMS__SPS_CFG_H_
70 #define SPS_RESET_GIO_PORT (hetREG2->DOUT)
71 #define SPS_RESET_GIO_PORT_DIR (hetREG2->DIR)
72 #define SPS_RESET_PIN (16u)
76 #define SPS_FEEDBACK_GIO_PORT (hetREG2->DOUT)
77 #define SPS_FEEDBACK_GIO_PORT_DIR (hetREG2->DIR)
78 #define SPS_FEEDBACK_PIN (9u)
82 #define SPS_NR_CONTACTOR_PER_IC (4u)
85 #define SPS_NR_OF_IC (2u)
88 #define SPS_CHANNEL_0 ((SPS_CHANNEL_INDEX)0)
89 #define SPS_CHANNEL_1 ((SPS_CHANNEL_INDEX)1)
90 #define SPS_CHANNEL_2 ((SPS_CHANNEL_INDEX)2)
91 #define SPS_CHANNEL_3 ((SPS_CHANNEL_INDEX)3)
92 #define SPS_CHANNEL_4 ((SPS_CHANNEL_INDEX)4)
93 #define SPS_CHANNEL_5 ((SPS_CHANNEL_INDEX)5)
94 #define SPS_CHANNEL_6 ((SPS_CHANNEL_INDEX)6)
95 #define SPS_CHANNEL_7 ((SPS_CHANNEL_INDEX)7)
99 #define SPS_NR_OF_REQUIRED_CONTACTOR_CHANNELS (BS_NR_OF_CONTACTORS)
102 #define SPS_NR_OF_AVAILABLE_SPS_CHANNELS (SPS_NR_CONTACTOR_PER_IC * SPS_NR_OF_IC)
105 #if (SPS_NR_OF_REQUIRED_CONTACTOR_CHANNELS > SPS_NR_OF_AVAILABLE_SPS_CHANNELS)
106 #error "Not enough contactor channels available for the required number of contactors."
118 #define SPS_SPI_BUFFERSIZE SPS_NR_OF_IC
121 #define SPS_GLOBAL_CONTROL_REGISTER_ADDRESS (0x00u)
122 #define SPS_OUTPUT_CONTROL_REGISTER_ADDRESS (0x02u)
123 #define SPS_C_CONTROL_REGISTER_ADDRESS (0x16u)
126 #define SPS_ISR_IRQ_DIAG_REGISTER_ADDRESS (0x06u)
127 #define SPS_ISR_WARN_DIAG_REGISTER_ADDRESS (0x07u)
128 #define SPS_OD_IOUT1_DIAG_REGISTER_ADDRESS (0x08u)
129 #define SPS_OD_IOUT2_DIAG_REGISTER_ADDRESS (0x09u)
130 #define SPS_OD_IOUT3_DIAG_REGISTER_ADDRESS (0x0Au)
131 #define SPS_OD_IOUT4_DIAG_REGISTER_ADDRESS (0x0Bu)
139 #define SPS_RW_BIT_POSITION (15u)
141 #define SPS_RW_READ (0u)
143 #define SPS_RW_WRITE (1u)
145 #define SPS_ADDRESS_BIT_START (8u)
147 #define SPS_DIAG_CTRL_BIT_POSITION (7u)
150 #define SPS_NORMAL_MODE (0x01u)
152 #define SPS_STRONG_DRIVE (0x00u)
154 #define SPS_MEDIUM_DRIVE (0x01u)
159 #define SPS_MODE_BIT_START (6u)
161 #define SPS_DRIVE_STRENGTH_BIT_START (5u)
164 #define SPS_I_MEASUREMENT_LSB_mA (0.98f)
167 #define SPS_CHANNEL_ON_DEFAULT_THRESHOLD_mA (20.0f)
170 #define SPS_BITMASK_DIAGNOSTIC_ONDEMAND_OUTPUT_CURRENT (0x1FFFu)
243 #ifdef UNITY_UNIT_TEST
Configuration of the battery system (e.g., number of battery modules, battery cells,...
#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
const float_t thresholdFeedbackOn_mA
SPS_CHANNEL_FUNCTION_e channelRequested
SPS_CHANNEL_FUNCTION_e channel
const SPS_CHANNEL_AFFILIATION_e affiliation