foxBMS - Unit Tests  1.5.0
The foxBMS Unit Tests API Documentation
Driver API

Functions

fs8x_status_t FS8x_WD_ChangeSeed (SPI_INTERFACE_CONFIG_s *spiInterface, fs8x_drv_data_t *drvData, uint16_t wdSeed)
 Changes seed of LFSR used for watchdog. More...
 
fs8x_status_t FS8x_WD_Refresh (SPI_INTERFACE_CONFIG_s *spiInterface, fs8x_drv_data_t *drvData)
 Performs the watchdog refresh. More...
 
fs8x_status_t FS8x_FS0B_Release (SPI_INTERFACE_CONFIG_s *spiInterface, fs8x_drv_data_t *drvData)
 FS0B release routine. More...
 
fs8x_status_t FS8x_SwitchAMUXchannel (SPI_INTERFACE_CONFIG_s *spiInterface, fs8x_drv_data_t *drvData, fs8x_amux_selection_t channelSelection)
 Switches a desired channel to the AMUX pin. More...
 
fs8x_status_t FS8x_SetRegulatorState (SPI_INTERFACE_CONFIG_s *spiInterface, fs8x_drv_data_t *drvData, fs8x_reg_output_t vreg, bool enable)
 Sets state (enable/disable) of the selected voltage regulator. More...
 
fs8x_status_t FS8x_GetFaultErrorCounterValue (SPI_INTERFACE_CONFIG_s *spiInterface, fs8x_drv_data_t *drvData, uint8_t *faultErrorCounterValue)
 Reads actual Fault Error Counter value. More...
 
fs8x_status_t FS8x_ReadRegister (SPI_INTERFACE_CONFIG_s *pSpiInterface, fs8x_drv_data_t *drvData, bool isFailSafe, uint8_t address, fs8x_rx_frame_t *rxData)
 Performs a read from a single FS8x register. More...
 
fs8x_status_t FS8x_WriteRegister (SPI_INTERFACE_CONFIG_s *pSpiInterface, fs8x_drv_data_t *drvData, bool isFailSafe, uint8_t address, uint16_t writeData)
 Sends write command to the FS8x. More...
 
fs8x_status_t FS8x_WriteRegisterInit (SPI_INTERFACE_CONFIG_s *pSpiInterface, fs8x_drv_data_t *drvData, uint8_t address, uint16_t writeData)
 Performs a write to a single FS8x FS init register (during the INIT_FS phase only). More...
 
fs8x_status_t FS8x_UpdateRegister (SPI_INTERFACE_CONFIG_s *pSpiInterface, fs8x_drv_data_t *drvData, bool isFailSafe, uint8_t address, int16_t mask, uint16_t writeData)
 Performs update of a single register. It affects bits specified by a bit mask. More...
 

Detailed Description

Function Documentation

◆ FS8x_FS0B_Release()

fs8x_status_t FS8x_FS0B_Release ( SPI_INTERFACE_CONFIG_s spiInterface,
fs8x_drv_data_t drvData 
)

FS0B release routine.

This function also checks all preconditions before it sends the register write command (LBIST_OK = ABIST1_OK = ABIST2_OK = 1, Fault Error Counter = 0). If any precondition is not met, the function returns fs8xStatusError.

Parameters
[in,out]spiInterfaceSPI communication interface config
[in]drvDataDriver run-time data.
Returns
Status return code.

Definition at line 184 of file sbc_fs8x.c.

Here is the call graph for this function:

◆ FS8x_GetFaultErrorCounterValue()

fs8x_status_t FS8x_GetFaultErrorCounterValue ( SPI_INTERFACE_CONFIG_s spiInterface,
fs8x_drv_data_t drvData,
uint8_t *  faultErrorCounterValue 
)

Reads actual Fault Error Counter value.

Parameters
[in,out]spiInterfaceSPI communication interface config
[in]drvDataDriver run-time data.
[out]faultErrorCounterValueFault Error counter value storage.
Returns
Status return code.

Definition at line 270 of file sbc_fs8x.c.

Here is the call graph for this function:

◆ FS8x_ReadRegister()

fs8x_status_t FS8x_ReadRegister ( SPI_INTERFACE_CONFIG_s pSpiInterface,
fs8x_drv_data_t drvData,
bool  isFailSafe,
uint8_t  address,
fs8x_rx_frame_t rxData 
)

Performs a read from a single FS8x register.

Performs a single read register based on provided address. The response is returned in fs8x_rx_frame_t structure.

Parameters
[in,out]pSpiInterfaceSPI communication interface config
[in]drvDataDriver run-time data.
[in]isFailSafetrue if the register is Fail Safe.
[in]addressRegister address.
[out]rxDataStructure holding the response from SBC.
Returns
Status return code.

Definition at line 385 of file sbc_fs8x_communication.c.

Here is the call graph for this function:

◆ FS8x_SetRegulatorState()

fs8x_status_t FS8x_SetRegulatorState ( SPI_INTERFACE_CONFIG_s spiInterface,
fs8x_drv_data_t drvData,
fs8x_reg_output_t  vreg,
bool  enable 
)

Sets state (enable/disable) of the selected voltage regulator.

Parameters
[in,out]spiInterfaceSPI communication interface config
[in]drvDataDriver run-time data.
[in]vregVoltage regulator enum (LDO1-2, BUCK1-3, BOOST, VPRE).
[in]enableState (enable = true / disable = false).
Returns
Status return code.

Definition at line 253 of file sbc_fs8x.c.

Here is the call graph for this function:

◆ FS8x_SwitchAMUXchannel()

fs8x_status_t FS8x_SwitchAMUXchannel ( SPI_INTERFACE_CONFIG_s spiInterface,
fs8x_drv_data_t drvData,
fs8x_amux_selection_t  channelSelection 
)

Switches a desired channel to the AMUX pin.

Parameters
[in,out]spiInterfaceSPI communication interface config
[in]drvDataDriver run-time data.
[in]channelSelectionSelected channel to be delivered to AMUX pin.
Returns
Status return code.

Definition at line 235 of file sbc_fs8x.c.

Here is the call graph for this function:

◆ FS8x_UpdateRegister()

fs8x_status_t FS8x_UpdateRegister ( SPI_INTERFACE_CONFIG_s pSpiInterface,
fs8x_drv_data_t drvData,
bool  isFailSafe,
uint8_t  address,
int16_t  mask,
uint16_t  writeData 
)

Performs update of a single register. It affects bits specified by a bit mask.

Parameters
[in,out]pSpiInterfaceSPI communication interface config
[in]drvDataDriver run-time data.
[in]isFailSafetrue: Reading from FS register, false: Reading from Main register.
[in]addressRegister address.
[in]maskRegister write mask.
[in]writeDataRegister write value.
Returns
Status return code.

Definition at line 461 of file sbc_fs8x_communication.c.

Here is the call graph for this function:

◆ FS8x_WD_ChangeSeed()

fs8x_status_t FS8x_WD_ChangeSeed ( SPI_INTERFACE_CONFIG_s spiInterface,
fs8x_drv_data_t drvData,
uint16_t  wdSeed 
)

Changes seed of LFSR used for watchdog.

The watchdog seed can be changed just during the INIT_FS phase (for challenger WD) or during the OPEN watchdog window (for simple WD). Timing is up to the application!

Parameters
[in,out]spiInterfaceSPI communication interface config
[in]drvDataDriver run-time data.
[in]wdSeedWatchdog LFSR seed.
Returns
Status return code.

Definition at line 137 of file sbc_fs8x.c.

Here is the call graph for this function:

◆ FS8x_WD_Refresh()

fs8x_status_t FS8x_WD_Refresh ( SPI_INTERFACE_CONFIG_s spiInterface,
fs8x_drv_data_t drvData 
)

Performs the watchdog refresh.

Parameters
[in,out]spiInterfaceSPI communication interface config
[in]drvDataDriver run-time data.
Returns
Status return code.

Definition at line 160 of file sbc_fs8x.c.

Here is the call graph for this function:

◆ FS8x_WriteRegister()

fs8x_status_t FS8x_WriteRegister ( SPI_INTERFACE_CONFIG_s pSpiInterface,
fs8x_drv_data_t drvData,
bool  isFailSafe,
uint8_t  address,
uint16_t  writeData 
)

Sends write command to the FS8x.

Parameters
[in,out]pSpiInterfaceSPI communication interface config
[in]drvDataDriver run-time data.
[in]isFailSafetrue: Reading from FS register, false: Reading from Main register.
[in]addressRegister address.
[in]writeDataRegister write value.
Returns
Status return code.

Definition at line 412 of file sbc_fs8x_communication.c.

Here is the call graph for this function:

◆ FS8x_WriteRegisterInit()

fs8x_status_t FS8x_WriteRegisterInit ( SPI_INTERFACE_CONFIG_s pSpiInterface,
fs8x_drv_data_t drvData,
uint8_t  address,
uint16_t  writeData 
)

Performs a write to a single FS8x FS init register (during the INIT_FS phase only).

Parameters
[in,out]pSpiInterfaceSPI communication interface config
[in]drvDataDriver run-time data.
[in]addressRegister address.
[in]writeDataRegister write value.
Returns
Status return code.

Definition at line 439 of file sbc_fs8x_communication.c.

Here is the call graph for this function: