![]() |
foxBMS
1.5.1
The foxBMS Battery Management System API Documentation
|
Headers for the configuration for the CAN module. More...
Go to the source code of this file.
Data Structures | |
struct | CAN_NODE_s |
struct | CAN_BUFFER_ELEMENT_s |
struct | CAN_SHIM_s |
struct | CAN_MESSAGE_PROPERTIES_s |
struct | CAN_TX_MESSAGE_TIMING_s |
struct | CAN_RX_MESSAGE_TIMING_s |
struct | CAN_TX_MESSAGE_TYPE_s |
struct | CAN_RX_MESSAGE_TYPE_s |
Macros | |
#define | CAN_MAX_11BIT_ID (2048u) |
#define | CAN_MAX_DLC (8u) |
#define | CAN_DEFAULT_DLC (8u) |
#define | CAN_FOXBMS_MESSAGES_DEFAULT_DLC (8u) |
#define | CAN_NODE_1 ((CAN_NODE_s *)&can_node1) |
#define | CAN_NODE_2 ((CAN_NODE_s *)&can_node2Isolated) |
#define | CAN_NODE_DEBUG_MESSAGE (CAN_NODE_1) |
#define | CAN_NODE_IMD (CAN_NODE_1) |
#define | CAN_NODE_CURRENT_SENSOR (CAN_NODE_1) |
#define | CAN1_ENABLE_PIN (PEX_PIN00) |
#define | CAN1_STANDBY_PIN (PEX_PIN01) |
#define | CAN2_ENABLE_PIN (PEX_PIN02) |
#define | CAN2_STANDBY_PIN (PEX_PIN03) |
Typedefs | |
typedef uint32_t(* | CAN_TxCallbackFunction_f) (CAN_MESSAGE_PROPERTIES_s message, uint8_t *canData, uint8_t *pMuxId, const CAN_SHIM_s *const kpkCanShim) |
typedef uint32_t(* | CAN_RxCallbackFunction_f) (CAN_MESSAGE_PROPERTIES_s message, const uint8_t *const kpkCanData, const CAN_SHIM_s *const kpkCanShim) |
Enumerations | |
enum | CAN_ENDIANNESS_e { CAN_LITTLE_ENDIAN , CAN_BIG_ENDIAN } |
enum | CAN_IDENTIFIER_TYPE_e { CAN_STANDARD_IDENTIFIER_11_BIT , CAN_EXTENDED_IDENTIFIER_29_BIT , CAN_INVALID_TYPE } |
Variables | |
const CAN_SHIM_s | can_kShim |
const CAN_NODE_s | can_node1 |
const CAN_NODE_s | can_node2Isolated |
const CAN_TX_MESSAGE_TYPE_s | can_txMessages [] |
const CAN_RX_MESSAGE_TYPE_s | can_rxMessages [] |
const uint8_t | can_txLength |
const uint8_t | can_rxLength |
Headers for the configuration for the CAN module.
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:
The activation and the length of the message buffers as well as the number of the messages that are received are to be configured here.
Definition in file can_cfg.h.
#define CAN1_ENABLE_PIN (PEX_PIN00) |
#define CAN1_STANDBY_PIN (PEX_PIN01) |
#define CAN2_ENABLE_PIN (PEX_PIN02) |
#define CAN2_STANDBY_PIN (PEX_PIN03) |
#define CAN_FOXBMS_MESSAGES_DEFAULT_DLC (8u) |
#define CAN_MAX_11BIT_ID (2048u) |
#define CAN_MAX_DLC (8u) |
#define CAN_NODE_1 ((CAN_NODE_s *)&can_node1) |
#define CAN_NODE_2 ((CAN_NODE_s *)&can_node2Isolated) |
#define CAN_NODE_CURRENT_SENSOR (CAN_NODE_1) |
#define CAN_NODE_DEBUG_MESSAGE (CAN_NODE_1) |
#define CAN_NODE_IMD (CAN_NODE_1) |
typedef uint32_t(* CAN_RxCallbackFunction_f) (CAN_MESSAGE_PROPERTIES_s message, const uint8_t *const kpkCanData, const CAN_SHIM_s *const kpkCanShim) |
typedef uint32_t(* CAN_TxCallbackFunction_f) (CAN_MESSAGE_PROPERTIES_s message, uint8_t *canData, uint8_t *pMuxId, const CAN_SHIM_s *const kpkCanShim) |
enum CAN_ENDIANNESS_e |
Enum for byte order (endianness)
* CAN data example: * * LittleEndian * bitStart = 27; bitLength = 19 * DataLE: 45-44-43-42-41-40-39-38-37-36-35-34-33-32-31-30-29-28-27 * MSB LSB * * BigEndian * bitStart = 21; bitLength = 19 * DataBE: 21-20-19-18-17-16-31-30-29-28-27-26-25-24-39-38-37-36-35 * MSB LSB * ||| * Receive data on CAN bus * ||| * ||| * \_/ * LE | BE * CAN Data Byte 0 07 06 05 04 03 02 01 00 | CAN Data Byte 0 07 06 05 04 03 02 01 00 * CAN Data Byte 1 15 14 13 12 11 10 09 08 | CAN Data Byte 1 15 14 13 12 11 10 09 08 * CAN Data Byte 2 23 22 21 20 19 18 17 16 | CAN Data Byte 2 23 22 21-20-19-18-17-16 MSB * CAN Data Byte 3 31-30-29-28-27 26 25 24 LSB | CAN Data Byte 3 31-30-29-28-27-26-25-24 * CAN Data Byte 4 39-38-37-36-35-34-33-32 | CAN Data Byte 4 39-38-37-36-35 34 33 32 LSB * CAN Data Byte 5 47 46 45-44-43-42-41-40 MSB | CAN Data Byte 5 47 46 45 44 43 42 41 40 * CAN Data Byte 6 55 54 53 52 51 50 49 48 | CAN Data Byte 6 55 54 53 52 51 50 49 48 * CAN Data Byte 7 63 62 61 60 59 58 57 56 | CAN Data Byte 7 63 62 61 60 59 58 57 56 * ||| * Store received data in RAM * ||| * ||| * \_/ * LE | BE * CAN Data Byte 7 63 62 61 60 59 58 57 56 | CAN Data Byte 0 07 06 05 04 03 02 01 00 | RAM data[7] * CAN Data Byte 6 55 54 53 52 51 50 49 48 | CAN Data Byte 1 15 14 13 12 11 10 09 08 | RAM data[6] * CAN Data Byte 5 47 46 45-44-43-42-41-40 MSB | CAN Data Byte 2 23 22 21-20-19-18-17-16 MSB | RAM data[5] * CAN Data Byte 4 39-38-37-36-35-34-33-32 | CAN Data Byte 3 31-30-29-28-27-26-25-24 | RAM data[4] * CAN Data Byte 3 31-30-29-28-27 26 25 24 LSB | CAN Data Byte 4 39-38-37-36-35 34 33 32 LSB | RAM data[3] * CAN Data Byte 2 23 22 21 20 19 18 17 16 | CAN Data Byte 5 47 46 45 44 43 42 41 40 | RAM data[2] * CAN Data Byte 1 15 14 13 12 11 10 09 08 | CAN Data Byte 6 55 54 53 52 51 50 49 48 | RAM data[1] * CAN Data Byte 0 07 06 05 04 03 02 01 00 | CAN Data Byte 7 63 62 61 60 59 58 57 56 | RAM data[0] * DataLE = DataBE *
Enumerator | |
---|---|
CAN_LITTLE_ENDIAN | |
CAN_BIG_ENDIAN |
|
extern |
|
extern |
|
extern |
|
extern |
length of CAN message arrays
Definition at line 92 of file can_cfg_rx.c.
|
extern |
registry of CAN RX messages
Definition at line 76 of file can_cfg_rx.c.
|
extern |
array length for transmission CAN0 message definition
length of CAN message arrays
Definition at line 103 of file can_cfg_tx.c.
|
extern |
CAN RX and TX message configuration structs
registry of CAN TX messages
Definition at line 86 of file can_cfg_tx.c.