54 #ifndef FOXBMS__SPS_CFG_H_
55 #define FOXBMS__SPS_CFG_H_
67 #define SPS_RESET_GIOPORT (hetREG2->DOUT)
68 #define SPS_RESET_GIOPORT_DIR (hetREG2->DIR)
69 #define SPS_RESET_PIN (16u)
73 #define SPS_NR_CONTACTOR_PER_IC (4u)
76 #define SPS_NR_OF_IC (3u)
79 #define SPS_NR_OF_REQUIRED_CONTACTOR_CHANNELS (BS_NR_OF_CONTACTORS)
82 #define SPS_NR_OF_AVAILABLE_SPS_CHANNELS (SPS_NR_CONTACTOR_PER_IC * SPS_NR_OF_IC)
85 #if (SPS_NR_OF_REQUIRED_CONTACTOR_CHANNELS > SPS_NR_OF_AVAILABLE_SPS_CHANNELS)
86 #error "Not enough contactor channels available for the required number of contactors."
98 #define SPS_SPI_BUFFERSIZE SPS_NR_OF_IC
101 #define SPS_GLOBAL_CONTROL_REGISTER_ADDRESS (0x00u)
102 #define SPS_OUTPUT_CONTROL_REGISTER_ADDRESS (0x02u)
103 #define SPS_C_CONTROL_REGISTER_ADDRESS (0x16u)
106 #define SPS_OD_IOUT1_DIAG_REGISTER_ADDRESS (0x08u)
107 #define SPS_OD_IOUT2_DIAG_REGISTER_ADDRESS (0x09u)
108 #define SPS_OD_IOUT3_DIAG_REGISTER_ADDRESS (0x0Au)
109 #define SPS_OD_IOUT4_DIAG_REGISTER_ADDRESS (0x0Bu)
110 #define SPS_EN_IRQ_PIN_DIAG_REGISTER_ADDRESS (0x11u)
111 #define SPS_EN_WARN_PIN_DIAG_REGISTER_ADDRESS (0x13u)
119 #define SPS_RW_BIT_POSITION (15u)
121 #define SPS_RW_READ (0u)
123 #define SPS_RW_WRITE (1u)
125 #define SPS_ADDRESS_BIT_START (8u)
127 #define SPS_DIAG_CTRL_BIT_POSITION (7u)
130 #define SPS_NORMAL_MODE (0x01u)
132 #define SPS_STRONG_DRIVE (0x00u)
134 #define SPS_MEDIUM_DRIVE (0x01u)
139 #define SPS_MODE_BIT_START (6u)
141 #define SPS_DRIVE_STRENGTH_BIT_START (5u)
144 #define SPS_I_MEASUREMENT_LSB_mA (0.98f)
147 #define SPS_CHANNEL_ON_DEFAULT_THRESHOLD_mA (20.0f)
150 #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
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
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