54 #ifndef FOXBMS__SPS_CFG_H_
55 #define FOXBMS__SPS_CFG_H_
67 #define SPS_RESET_GIO_PORT (hetREG2->DOUT)
68 #define SPS_RESET_GIO_PORT_DIR (hetREG2->DIR)
69 #define SPS_RESET_PIN (16u)
73 #define SPS_FEEDBACK_GIO_PORT (hetREG2->DOUT)
74 #define SPS_FEEDBACK_GIO_PORT_DIR (hetREG2->DIR)
75 #define SPS_FEEDBACK_PIN (9u)
79 #define SPS_NR_CONTACTOR_PER_IC (4u)
82 #define SPS_NR_OF_IC (2u)
85 #define SPS_NR_OF_REQUIRED_CONTACTOR_CHANNELS (BS_NR_OF_CONTACTORS)
88 #define SPS_NR_OF_AVAILABLE_SPS_CHANNELS (SPS_NR_CONTACTOR_PER_IC * SPS_NR_OF_IC)
91 #if (SPS_NR_OF_REQUIRED_CONTACTOR_CHANNELS > SPS_NR_OF_AVAILABLE_SPS_CHANNELS)
92 #error "Not enough contactor channels available for the required number of contactors."
104 #define SPS_SPI_BUFFERSIZE SPS_NR_OF_IC
107 #define SPS_GLOBAL_CONTROL_REGISTER_ADDRESS (0x00u)
108 #define SPS_OUTPUT_CONTROL_REGISTER_ADDRESS (0x02u)
109 #define SPS_C_CONTROL_REGISTER_ADDRESS (0x16u)
112 #define SPS_OD_IOUT1_DIAG_REGISTER_ADDRESS (0x08u)
113 #define SPS_OD_IOUT2_DIAG_REGISTER_ADDRESS (0x09u)
114 #define SPS_OD_IOUT3_DIAG_REGISTER_ADDRESS (0x0Au)
115 #define SPS_OD_IOUT4_DIAG_REGISTER_ADDRESS (0x0Bu)
116 #define SPS_EN_IRQ_PIN_DIAG_REGISTER_ADDRESS (0x11u)
117 #define SPS_EN_WARN_PIN_DIAG_REGISTER_ADDRESS (0x13u)
125 #define SPS_RW_BIT_POSITION (15u)
127 #define SPS_RW_READ (0u)
129 #define SPS_RW_WRITE (1u)
131 #define SPS_ADDRESS_BIT_START (8u)
133 #define SPS_DIAG_CTRL_BIT_POSITION (7u)
136 #define SPS_NORMAL_MODE (0x01u)
138 #define SPS_STRONG_DRIVE (0x00u)
140 #define SPS_MEDIUM_DRIVE (0x01u)
145 #define SPS_MODE_BIT_START (6u)
147 #define SPS_DRIVE_STRENGTH_BIT_START (5u)
150 #define SPS_I_MEASUREMENT_LSB_mA (0.98f)
153 #define SPS_CHANNEL_ON_DEFAULT_THRESHOLD_mA (20.0f)
156 #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.
struct SPS_CHANNEL_STATE SPS_CHANNEL_STATE_s
#define SPS_NR_OF_AVAILABLE_SPS_CHANNELS
@ SPS_TRIGGER_CURRENT_MEASUREMENT
@ SPS_CONFIGURE_CONTROL_REGISTER
@ SPS_READ_MEASURED_CURRENT2
@ SPS_READ_MEASURED_CURRENT1
@ SPS_READ_MEASURED_CURRENT3
@ SPS_READ_MEASURED_CURRENT4
enum SPS_WRITE_TYPE SPS_WRITE_TYPE_e
enum SPS_ACTION SPS_ACTION_e
SPS_CHANNEL_STATE_s sps_channelStatus[SPS_NR_OF_AVAILABLE_SPS_CHANNELS]
enum SPS_STATE SPS_STATE_e
@ SPS_andWithCurrentValue
@ SPS_replaceCurrentValue
@ SPS_READ_DIAGNOSTIC_REGISTER
@ SPS_READ_CONTROL_REGISTER
enum SPS_CHANNEL_FUNCTION SPS_CHANNEL_FUNCTION_e
const SPS_CHANNEL_FEEDBACK_MAPPING_s sps_kChannelFeedbackMapping[SPS_NR_OF_AVAILABLE_SPS_CHANNELS]
enum SPS_READ_TYPE SPS_READ_TYPE_e
@ 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
struct SPS_CHANNEL_FEEDBACK_MAPPING SPS_CHANNEL_FEEDBACK_MAPPING_s
Types for the SPS driver.
enum SPS_CHANNEL_AFFILIATION SPS_CHANNEL_AFFILIATION_e
affiliation type of a sps channel
const float thresholdFeedbackOn_mA
SPS_CHANNEL_FUNCTION_e channelRequested
const SPS_CHANNEL_AFFILIATION_e affiliation
SPS_CHANNEL_FUNCTION_e channel