foxBMS
1.1.0
The foxBMS Battery Management System API Documentation
|
Headers for the driver for the contactors. More...
#include "contactor_cfg.h"
Go to the source code of this file.
Typedefs | |
typedef enum CONT_POWER_LINE_e | CONT_POWER_LINE_e |
Names for connected powerlines. More... | |
Enumerations | |
enum | CONT_STATEMACH_SUB_e { CONT_ENTRY , CONT_SET_EDGE_LOW_INIT , CONT_SET_EDGE_HIGH , CONT_SET_EDGE_LOW , CONT_CHECK_REQUESTS } |
Substates of the CONT state machine. More... | |
enum | CONT_POWER_LINE_e { CONT_POWER_LINE_NONE , CONT_POWER_LINE_0 } |
Names for connected powerlines. More... | |
Functions | |
CONT_ELECTRICAL_STATE_TYPE_e | CONT_GetContactorSetValue (const CONT_NAMES_e name) |
Gets the latest value the contactors were set to. More... | |
void | CONT_GetContactorFeedback (void) |
Reads the feedback pin of every contactor and returns its current value (CONT_SWITCH_OFF/CONT_SWITCH_ON). More... | |
STD_RETURN_TYPE_e | CONT_SetContactorState (const CONT_NAMES_e name, CONT_ELECTRICAL_STATE_TYPE_e requestedContactorState) |
Sets the contactor state to its requested state, if the contactor is at that time not in the requested state. More... | |
CONT_ELECTRICAL_STATE_TYPE_e | CONT_GetState (uint8_t contactorNumber) |
Gets the current state. More... | |
STD_RETURN_TYPE_e | CONT_CloseString (uint8_t stringNumber) |
Closes the contactor of a string. More... | |
STD_RETURN_TYPE_e | CONT_OpenString (uint8_t stringNumber) |
Opens the contactor of a string. More... | |
STD_RETURN_TYPE_e | CONT_ClosePrecharge (uint8_t stringNumber) |
Closes precharge. More... | |
STD_RETURN_TYPE_e | CONT_OpenPrecharge (uint8_t stringNumber) |
Opens precharge. More... | |
void | CONT_CheckFeedback (void) |
checks the feedback of the contactors More... | |
void | CONT_Initialize (void) |
initializes the contactor module More... | |
Headers for the driver for the contactors.
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 contactor.h.
typedef enum CONT_POWER_LINE_e CONT_POWER_LINE_e |
Names for connected powerlines.
enum CONT_POWER_LINE_e |
Names for connected powerlines.
Enumerator | |
---|---|
CONT_POWER_LINE_NONE | no power line is connected, contactors are open |
CONT_POWER_LINE_0 | power line 0, e.g. used for the power train |
Definition at line 113 of file contactor.h.
enum CONT_STATEMACH_SUB_e |
Substates of the CONT state machine.
Enumerator | |
---|---|
CONT_ENTRY | |
CONT_SET_EDGE_LOW_INIT | |
CONT_SET_EDGE_HIGH | |
CONT_SET_EDGE_LOW | |
CONT_CHECK_REQUESTS |
Definition at line 104 of file contactor.h.
void CONT_CheckFeedback | ( | void | ) |
checks the feedback of the contactors
makes a DIAG entry for each contactor when the feedback does not match the set value
Definition at line 212 of file contactor.c.
STD_RETURN_TYPE_e CONT_ClosePrecharge | ( | uint8_t | stringNumber | ) |
Closes precharge.
This function makes a close state request to the precharge contactor.
stringNumber | String addressed |
Definition at line 234 of file contactor.c.
STD_RETURN_TYPE_e CONT_CloseString | ( | uint8_t | stringNumber | ) |
Closes the contactor of a string.
This function makes a close state request to the contactor of a specific string.
stringNumber | String addressed |
Definition at line 217 of file contactor.c.
void CONT_GetContactorFeedback | ( | void | ) |
Reads the feedback pin of every contactor and returns its current value (CONT_SWITCH_OFF/CONT_SWITCH_ON).
If the contactor has a feedback pin the measured feedback is returned. If the contactor has no feedback pin, it is assumed that after a certain time the contactor has reached the requested state.
Definition at line 168 of file contactor.c.
CONT_ELECTRICAL_STATE_TYPE_e CONT_GetContactorSetValue | ( | const CONT_NAMES_e | name | ) |
Gets the latest value the contactors were set to.
[in] | name | name of the contactor |
Definition at line 162 of file contactor.c.
CONT_ELECTRICAL_STATE_TYPE_e CONT_GetState | ( | uint8_t | contactorNumber | ) |
Gets the current state.
This function is used in the functioning of the CONT state machine.
contactorNumber | contactor to be addressed |
Definition at line 286 of file contactor.c.
void CONT_Initialize | ( | void | ) |
initializes the contactor module
Definition at line 291 of file contactor.c.
STD_RETURN_TYPE_e CONT_OpenPrecharge | ( | uint8_t | stringNumber | ) |
Opens precharge.
This function makes an open state request to the precharge contactor.
stringNumber | String addressed |
Definition at line 260 of file contactor.c.
STD_RETURN_TYPE_e CONT_OpenString | ( | uint8_t | stringNumber | ) |
Opens the contactor of a string.
This function makes an open state request to the contactor of a specific string.
stringNumber | String addressed |
Definition at line 225 of file contactor.c.
STD_RETURN_TYPE_e CONT_SetContactorState | ( | const CONT_NAMES_e | name, |
CONT_ELECTRICAL_STATE_TYPE_e | requestedContactorState | ||
) |
Sets the contactor state to its requested state, if the contactor is at that time not in the requested state.
If the new state was already requested, but not reached (meaning the measured feedback does not return the requested state), there are two states: it can be still ok (STD_OK), because the contactor has some time left to get physically in the requested state (passed time since the request is lower than the limit) or it can be not ok (STD_NOT_OK), because there is timing violation, i.e. the contactor has surpassed the maximum time for getting in the requested state. It returns STD_OK if the requested state was successfully set or if the contactor was at the requested state before.
name | |
requestedContactorState |
Definition at line 183 of file contactor.c.