foxBMS  1.6.0
The foxBMS Battery Management System API Documentation
can_cbs_tx.h
Go to the documentation of this file.
1 /**
2  *
3  * @copyright © 2010 - 2023, Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V.
4  * All rights reserved.
5  *
6  * SPDX-License-Identifier: BSD-3-Clause
7  *
8  * Redistribution and use in source and binary forms, with or without
9  * modification, are permitted provided that the following conditions are met:
10  *
11  * 1. Redistributions of source code must retain the above copyright notice, this
12  * list of conditions and the following disclaimer.
13  *
14  * 2. Redistributions in binary form must reproduce the above copyright notice,
15  * this list of conditions and the following disclaimer in the documentation
16  * and/or other materials provided with the distribution.
17  *
18  * 3. Neither the name of the copyright holder nor the names of its
19  * contributors may be used to endorse or promote products derived from
20  * this software without specific prior written permission.
21  *
22  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
23  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
25  * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
26  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
27  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
28  * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
29  * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
30  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
31  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32  *
33  * We kindly request you to use one or more of the following phrases to refer to
34  * foxBMS in your hardware, software, documentation or advertising materials:
35  *
36  * - ″This product uses parts of foxBMS®″
37  * - ″This product includes parts of foxBMS®″
38  * - ″This product is derived from foxBMS®″
39  *
40  */
41 
42 /**
43  * @file can_cbs_tx.h
44  * @author foxBMS Team
45  * @date 2021-04-20 (date of creation)
46  * @updated 2023-10-12 (date of last update)
47  * @version v1.6.0
48  * @ingroup DRIVER
49  * @prefix CANTX
50  *
51  * @brief CAN callbacks header
52  *
53  */
54 
55 #ifndef FOXBMS__CAN_CBS_TX_H_
56 #define FOXBMS__CAN_CBS_TX_H_
57 
58 /*========== Includes =======================================================*/
59 
60 #include "can_cfg.h"
61 
62 #include <stdint.h>
63 
64 /*========== Macros and Definitions =========================================*/
65 
66 /*========== Extern Constant and Variable Declarations ======================*/
67 
68 /*========== Extern Function Prototypes =====================================*/
69 /** TX callback functions @{ */
70 /**
71  * @brief can tx callback function for state
72  * @param[in] message contains the message ID, DLC and endianness
73  * @param[in] pCanData payload of can frame
74  * @param[in] pMuxId multiplexer for multiplexed CAN messages
75  * @param[in] kpkCanShim shim to the database entries
76  */
77 extern uint32_t CANTX_BmsState(
79  uint8_t *pCanData,
80  uint8_t *pMuxId,
81  const CAN_SHIM_s *const kpkCanShim);
82 /**
83  * @brief can tx callback function for detail state
84  * @param[in] message contains the message ID, DLC and endianness
85  * @param[in] pCanData payload of can frame
86  * @param[in] pMuxId multiplexer for multiplexed CAN messages
87  * @param[in] kpkCanShim shim to the database entries
88  */
89 extern uint32_t CANTX_BmsStateDetails(
91  uint8_t *pCanData,
92  uint8_t *pMuxId,
93  const CAN_SHIM_s *const kpkCanShim);
94 /**
95  * @brief can tx callback function for cell voltages
96  * @param[in] message contains the message ID, DLC and endianness
97  * @param[in] pCanData payload of can frame
98  * @param[in] pMuxId multiplexer for multiplexed CAN messages
99  * @param[in] kpkCanShim shim to the database entries
100  */
101 extern uint32_t CANTX_CellVoltages(
102  CAN_MESSAGE_PROPERTIES_s message,
103  uint8_t *pCanData,
104  uint8_t *pMuxId,
105  const CAN_SHIM_s *const kpkCanShim);
106 /**
107  * @brief can tx callback function for cell temperatures
108  * @param[in] message contains the message ID, DLC and endianness
109  * @param[in] pCanData payload of can frame
110  * @param[in] pMuxId multiplexer for multiplexed CAN messages
111  * @param[in] kpkCanShim shim to the database entries
112  */
113 extern uint32_t CANTX_CellTemperatures(
114  CAN_MESSAGE_PROPERTIES_s message,
115  uint8_t *pCanData,
116  uint8_t *pMuxId,
117  const CAN_SHIM_s *const kpkCanShim);
118 /**
119  * @brief can tx callback function for limit values
120  * @param[in] message contains the message ID, DLC and endianness
121  * @param[in] pCanData payload of can frame
122  * @param[in] pMuxId multiplexer for multiplexed CAN messages
123  * @param[in] kpkCanShim shim to the database entries
124  */
125 extern uint32_t CANTX_LimitValues(
126  CAN_MESSAGE_PROPERTIES_s message,
127  uint8_t *pCanData,
128  uint8_t *pMuxId,
129  const CAN_SHIM_s *const kpkCanShim);
130 /**
131  * @brief can tx callback function for min/max values
132  * @param[in] message contains the message ID, DLC and endianness
133  * @param[in] pCanData payload of can frame
134  * @param[in] pMuxId multiplexer for multiplexed CAN messages
135  * @param[in] kpkCanShim shim to the database entries
136  */
137 extern uint32_t CANTX_MinimumMaximumValues(
138  CAN_MESSAGE_PROPERTIES_s message,
139  uint8_t *pCanData,
140  uint8_t *pMuxId,
141  const CAN_SHIM_s *const kpkCanShim);
142 /**
143  * @brief can tx callback function for state estimation values
144  * @param[in] message contains the message ID, DLC and endianness
145  * @param[in] pCanData payload of can frame
146  * @param[in] pMuxId multiplexer for multiplexed CAN messages
147  * @param[in] kpkCanShim shim to the database entries
148  */
149 extern uint32_t CANTX_PackStateEstimation(
150  CAN_MESSAGE_PROPERTIES_s message,
151  uint8_t *pCanData,
152  uint8_t *pMuxId,
153  const CAN_SHIM_s *const kpkCanShim);
154 /**
155  * @brief can tx callback function for pack values values
156  * @param[in] message contains the message ID, DLC and endianness
157  * @param[in] pCanData payload of can frame
158  * @param[in] pMuxId multiplexer for multiplexed CAN messages
159  * @param[in] kpkCanShim shim to the database entries
160  */
161 extern uint32_t CANTX_PackValues(
162  CAN_MESSAGE_PROPERTIES_s message,
163  uint8_t *pCanData,
164  uint8_t *pMuxId,
165  const CAN_SHIM_s *const kpkCanShim);
166 /**
167  * @brief can tx callback function for string state values
168  * @param[in] message contains the message ID, DLC and endianness
169  * @param[in] pCanData payload of can frame
170  * @param[in] pMuxId multiplexer for multiplexed CAN messages
171  * @param[in] kpkCanShim shim to the database entries
172  */
173 extern uint32_t CANTX_StringState(
174  CAN_MESSAGE_PROPERTIES_s message,
175  uint8_t *pCanData,
176  uint8_t *pMuxId,
177  const CAN_SHIM_s *const kpkCanShim);
178 /**
179  * @brief can tx callback function for string values
180  * @param[in] message contains the message ID, DLC and endianness
181  * @param[in] pCanData payload of can frame
182  * @param[in] pMuxId multiplexer for multiplexed CAN messages
183  * @param[in] kpkCanShim shim to the database entries
184  */
185 extern uint32_t CANTX_StringValuesP0(
186  CAN_MESSAGE_PROPERTIES_s message,
187  uint8_t *pCanData,
188  uint8_t *pMuxId,
189  const CAN_SHIM_s *const kpkCanShim);
190 /**
191  * @brief can tx callback function for string minimum and maximum values
192  * @param[in] message contains the message ID, DLC and endianness
193  * @param[in] pCanData payload of can frame
194  * @param[in] pMuxId multiplexer for multiplexed CAN messages
195  * @param[in] kpkCanShim shim to the database entries
196  */
197 extern uint32_t CANTX_StringMinimumMaximumValues(
198  CAN_MESSAGE_PROPERTIES_s message,
199  uint8_t *pCanData,
200  uint8_t *pMuxId,
201  const CAN_SHIM_s *const kpkCanShim);
202 /**
203  * @brief can tx callback function for string state estimation
204  * @param[in] message contains the message ID, DLC and endianness
205  * @param[in] pCanData payload of can frame
206  * @param[in] pMuxId multiplexer for multiplexed CAN messages
207  * @param[in] kpkCanShim shim to the database entries
208  */
209 extern uint32_t CANTX_StringStateEstimation(
210  CAN_MESSAGE_PROPERTIES_s message,
211  uint8_t *pCanData,
212  uint8_t *pMuxId,
213  const CAN_SHIM_s *const kpkCanShim);
214 /**
215  * @brief can tx callback function for string values 2
216  * @param[in] message contains the message ID, DLC and endianness
217  * @param[in] pCanData payload of can frame
218  * @param[in] pMuxId multiplexer for multiplexed CAN messages
219  * @param[in] kpkCanShim shim to the database entries
220  */
221 extern uint32_t CANTX_StringValuesP1(
222  CAN_MESSAGE_PROPERTIES_s message,
223  uint8_t *pCanData,
224  uint8_t *pMuxId,
225  const CAN_SHIM_s *const kpkCanShim);
226 /** @} */
227 
228 /*========== Externalized Static Functions Prototypes (Unit Test) ===========*/
229 #ifdef UNITY_UNIT_TEST
230 #endif
231 
232 #endif /* FOXBMS__CAN_CBS_TX_H_ */
uint32_t CANTX_CellVoltages(CAN_MESSAGE_PROPERTIES_s message, uint8_t *pCanData, uint8_t *pMuxId, const CAN_SHIM_s *const kpkCanShim)
can tx callback function for cell voltages
uint32_t CANTX_PackStateEstimation(CAN_MESSAGE_PROPERTIES_s message, uint8_t *pCanData, uint8_t *pMuxId, const CAN_SHIM_s *const kpkCanShim)
can tx callback function for state estimation values
uint32_t CANTX_BmsState(CAN_MESSAGE_PROPERTIES_s message, uint8_t *pCanData, uint8_t *pMuxId, const CAN_SHIM_s *const kpkCanShim)
can tx callback function for state
uint32_t CANTX_StringValuesP0(CAN_MESSAGE_PROPERTIES_s message, uint8_t *pCanData, uint8_t *pMuxId, const CAN_SHIM_s *const kpkCanShim)
can tx callback function for string values
uint32_t CANTX_StringStateEstimation(CAN_MESSAGE_PROPERTIES_s message, uint8_t *pCanData, uint8_t *pMuxId, const CAN_SHIM_s *const kpkCanShim)
can tx callback function for string state estimation
uint32_t CANTX_LimitValues(CAN_MESSAGE_PROPERTIES_s message, uint8_t *pCanData, uint8_t *pMuxId, const CAN_SHIM_s *const kpkCanShim)
can tx callback function for limit values
uint32_t CANTX_CellTemperatures(CAN_MESSAGE_PROPERTIES_s message, uint8_t *pCanData, uint8_t *pMuxId, const CAN_SHIM_s *const kpkCanShim)
can tx callback function for cell temperatures
uint32_t CANTX_PackValues(CAN_MESSAGE_PROPERTIES_s message, uint8_t *pCanData, uint8_t *pMuxId, const CAN_SHIM_s *const kpkCanShim)
can tx callback function for pack values values
uint32_t CANTX_MinimumMaximumValues(CAN_MESSAGE_PROPERTIES_s message, uint8_t *pCanData, uint8_t *pMuxId, const CAN_SHIM_s *const kpkCanShim)
can tx callback function for min/max values
uint32_t CANTX_StringMinimumMaximumValues(CAN_MESSAGE_PROPERTIES_s message, uint8_t *pCanData, uint8_t *pMuxId, const CAN_SHIM_s *const kpkCanShim)
can tx callback function for string minimum and maximum values
uint32_t CANTX_BmsStateDetails(CAN_MESSAGE_PROPERTIES_s message, uint8_t *pCanData, uint8_t *pMuxId, const CAN_SHIM_s *const kpkCanShim)
can tx callback function for detail state
uint32_t CANTX_StringValuesP1(CAN_MESSAGE_PROPERTIES_s message, uint8_t *pCanData, uint8_t *pMuxId, const CAN_SHIM_s *const kpkCanShim)
can tx callback function for string values 2
uint32_t CANTX_StringState(CAN_MESSAGE_PROPERTIES_s message, uint8_t *pCanData, uint8_t *pMuxId, const CAN_SHIM_s *const kpkCanShim)
can tx callback function for string state values
Headers for the configuration for the CAN module.