foxBMS
1.2.1
The foxBMS Battery Management System API Documentation
|
Headers for the driver for the smart power switches. More...
Go to the source code of this file.
Functions | |
void | SPS_Initialize (void) |
Initialize IOs for the SPS driver. More... | |
void | SPS_Ctrl (void) |
Control function for the CONT driver state machine. More... | |
void | SPS_RequestContactorState (SPS_CHANNEL_INDEX channelIndex, SPS_CHANNEL_FUNCTION_e channelFunction) |
Request state of a contactor. More... | |
void | SPS_RequestGeneralIOState (SPS_CHANNEL_INDEX channelIndex, SPS_CHANNEL_FUNCTION_e channelFunction) |
Request state of a general IO. More... | |
CONT_ELECTRICAL_STATE_TYPE_e | SPS_GetChannelCurrentFeedback (const SPS_CHANNEL_INDEX channelIndex) |
Get feedback value. More... | |
CONT_ELECTRICAL_STATE_TYPE_e | SPS_GetChannelPexFeedback (const SPS_CHANNEL_INDEX channelIndex, bool normallyOpen) |
Get the feedback state of a channel. More... | |
SPS_CHANNEL_AFFILIATION_e | SPS_GetChannelAffiliation (SPS_CHANNEL_INDEX channelIndex) |
Returns the channel affiliation. More... | |
Headers for the driver for the smart power switches.
SPDX-License-Identifier: BSD-3-Clause
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
We kindly request you to use one or more of the following phrases to refer to foxBMS in your hardware, software, documentation or advertising materials:
Definition in file sps.h.
void SPS_Ctrl | ( | void | ) |
Control function for the CONT driver state machine.
This function contains the sequence of events in the SPS state machine. It must be called time-triggered, every 10ms. It exits without effect, if the function call is a reentrance.
Definition at line 475 of file sps.c.
SPS_CHANNEL_AFFILIATION_e SPS_GetChannelAffiliation | ( | SPS_CHANNEL_INDEX | channelIndex | ) |
CONT_ELECTRICAL_STATE_TYPE_e SPS_GetChannelCurrentFeedback | ( | const SPS_CHANNEL_INDEX | channelIndex | ) |
Get feedback value.
This function compares the measured current in the contactor channel with a fixed threshold and assumes the contactor feedback to be closed when this threshold is passed on the channel.
[in] | channelIndex | index of the channel (contactor) that should be accessed |
Definition at line 606 of file sps.c.
CONT_ELECTRICAL_STATE_TYPE_e SPS_GetChannelPexFeedback | ( | const SPS_CHANNEL_INDEX | channelIndex, |
bool | normallyOpen | ||
) |
Get the feedback state of a channel.
Retrieves the feedback state of a sps channel by looking up the appropriate channel in sps_kChannelFeedbackMapping and retrieving the value through the PEX API.
[in] | channelIndex | number of the SPS channel that shall be checked |
[in] | normallyOpen | true if the feedback is normally open, false if not |
Definition at line 622 of file sps.c.
void SPS_Initialize | ( | void | ) |
void SPS_RequestContactorState | ( | SPS_CHANNEL_INDEX | channelIndex, |
SPS_CHANNEL_FUNCTION_e | channelFunction | ||
) |
Request state of a contactor.
This function checks if the requested channel is affiliated to contactors and then passes the arguments on to SPS_RequestChannelState().
[in] | channelIndex | number of the channel that should be accessed; This has to be a SPS channel and it has to be affiliated with SPS_AFF_CONTACTOR |
[in] | channelFunction | requested functional state of the channel |
Definition at line 596 of file sps.c.
void SPS_RequestGeneralIOState | ( | SPS_CHANNEL_INDEX | channelIndex, |
SPS_CHANNEL_FUNCTION_e | channelFunction | ||
) |
Request state of a general IO.
This function checks if the requested channel is affiliated to general IO and then passes the arguments on to SPS_RequestChannelState().
[in] | channelIndex | number of the channel that should be accessed; This has to be a SPS channel and it has to be affiliated with SPS_AFF_GENERAL_IO |
[in] | channelFunction | requested functional state of the channel |
Definition at line 601 of file sps.c.