56 #ifndef FOXBMS__SPI_CFG_H_
57 #define FOXBMS__SPI_CFG_H_
71 #define SPI_SPI1_INDEX (0u)
72 #define SPI_SPI2_INDEX (1u)
73 #define SPI_SPI3_INDEX (2u)
74 #define SPI_SPI4_INDEX (3u)
75 #define SPI_SPI5_INDEX (4u)
79 #define SPI_NR_SPI_INTERFACES (5u)
82 #define SPI_CSHOLD_BIT (0x10000000u)
85 #define SPI_WDEL_BIT (0x04000000u)
88 #define SPI_HARDWARE_CHIP_SELECT_FIELD_POSITION (16u)
91 #define SPI_DATA_FORMAT_FIELD_POSITION (24u)
94 #define SPI_TX_BUFFER_EMPTY_FLAG_POSITION (9u)
97 #define SPI_PC0_CLEAR_HW_CS_MASK (0xFFFFFF00u)
100 #define SPI_TX_EMPTY_TIMEOUT_ITERATIONS (6000u)
103 #define SPI_MAX_NUMBER_HW_CS (6u)
106 #define SPI_SBC_MCU_CHIP_SELECT_PIN (0u)
136 #define SPI_ADI_CHIP_SELECT_PIN (1u)
139 #define SPI_LTC_CHIP_SELECT_PIN (1u)
142 #define SPI_MAXIM_CHIP_SELECT_PIN (0u)
145 #define SPI_NXP_TX_CHIP_SELECT_PIN (1u)
146 #define SPI_NXP_RX_CHIP_SELECT_PIN (0u)
150 #define SPI_FRAM_CHIP_SELECT_PIN (1u)
153 #define SPI_SPS_CS_GIOPORT (hetREG2->DOUT)
154 #define SPI_SPS_CS_GIOPORT_DIR (hetREG2->DIR)
155 #define SPI_SPS_CS_PIN (1u)
186 #ifdef UNITY_UNIT_TEST
Configuration of the battery system (e.g., number of battery modules, battery cells,...
#define BS_NR_OF_STRINGS
Number of parallel strings in the battery pack.
void SPI_SpsInterfaceSwitchToLowSpeed(SPI_INTERFACE_CONFIG_s *pSpiSpsInterface)
Switch the SPS spi handle to low speed.
SPI_INTERFACE_CONFIG_s spi_mxmInterface
SPI_INTERFACE_CONFIG_s spi_adiInterface[BS_NR_OF_STRINGS]
SPI_INTERFACE_CONFIG_s spi_sbcMcuInterface
SPI_INTERFACE_CONFIG_s spi_nxp775InterfaceTx[BS_NR_OF_STRINGS]
SPI_BUSY_STATE_e spi_busyFlags[]
SPI_INTERFACE_CONFIG_s spi_framInterface
void SPI_SpsInterfaceSwitchToHighSpeed(SPI_INTERFACE_CONFIG_s *pSpiSpsInterface)
Switch the SPS spi handle to high speed.
SPI_INTERFACE_CONFIG_s spi_nxp775InterfaceRx[BS_NR_OF_STRINGS]
SPI_INTERFACE_CONFIG_s spi_ltcInterface[BS_NR_OF_STRINGS]
const uint8_t spi_nrBusyFlags
@ SPI_CHIP_SELECT_SOFTWARE
@ SPI_CHIP_SELECT_HARDWARE
SPI_INTERFACE_CONFIG_s spi_spsInterface
SPI_CHIP_SELECT_TYPE_e csType
volatile uint32_t * pGioPort