foxBMS
1.2.1
The foxBMS Battery Management System API Documentation
|
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... | |
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.
[in,out] | spiInterface | SPI communication interface config |
[in] | drvData | Driver run-time data. |
Definition at line 184 of file sbc_fs8x.c.
fs8x_status_t FS8x_GetFaultErrorCounterValue | ( | SPI_INTERFACE_CONFIG_s * | spiInterface, |
fs8x_drv_data_t * | drvData, | ||
uint8_t * | faultErrorCounterValue | ||
) |
Reads actual Fault Error Counter value.
[in,out] | spiInterface | SPI communication interface config |
[in] | drvData | Driver run-time data. |
[out] | faultErrorCounterValue | Fault Error counter value storage. |
Definition at line 270 of file sbc_fs8x.c.
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.
[in,out] | pSpiInterface | SPI communication interface config |
[in] | drvData | Driver run-time data. |
[in] | isFailSafe | true if the register is Fail Safe. |
[in] | address | Register address. |
[out] | rxData | Structure holding the response from SBC. |
Definition at line 385 of file sbc_fs8x_communication.c.
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.
[in,out] | spiInterface | SPI communication interface config |
[in] | drvData | Driver run-time data. |
[in] | vreg | Voltage regulator enum (LDO1-2, BUCK1-3, BOOST, VPRE). |
[in] | enable | State (enable = true / disable = false). |
Definition at line 253 of file sbc_fs8x.c.
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.
[in,out] | spiInterface | SPI communication interface config |
[in] | drvData | Driver run-time data. |
[in] | channelSelection | Selected channel to be delivered to AMUX pin. |
Definition at line 235 of file sbc_fs8x.c.
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.
[in,out] | pSpiInterface | SPI communication interface config |
[in] | drvData | Driver run-time data. |
[in] | isFailSafe | true: Reading from FS register, false: Reading from Main register. |
[in] | address | Register address. |
[in] | mask | Register write mask. |
[in] | writeData | Register write value. |
Definition at line 461 of file sbc_fs8x_communication.c.
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!
[in,out] | spiInterface | SPI communication interface config |
[in] | drvData | Driver run-time data. |
[in] | wdSeed | Watchdog LFSR seed. |
Definition at line 137 of file sbc_fs8x.c.
fs8x_status_t FS8x_WD_Refresh | ( | SPI_INTERFACE_CONFIG_s * | spiInterface, |
fs8x_drv_data_t * | drvData | ||
) |
Performs the watchdog refresh.
[in,out] | spiInterface | SPI communication interface config |
[in] | drvData | Driver run-time data. |
Definition at line 160 of file sbc_fs8x.c.
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.
[in,out] | pSpiInterface | SPI communication interface config |
[in] | drvData | Driver run-time data. |
[in] | isFailSafe | true: Reading from FS register, false: Reading from Main register. |
[in] | address | Register address. |
[in] | writeData | Register write value. |
Definition at line 412 of file sbc_fs8x_communication.c.
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).
[in,out] | pSpiInterface | SPI communication interface config |
[in] | drvData | Driver run-time data. |
[in] | address | Register address. |
[in] | writeData | Register write value. |
Definition at line 439 of file sbc_fs8x_communication.c.