foxBMS - Unit Tests
1.3.0
The foxBMS Unit Tests API Documentation
|
Headers for the configuration for the CAN module. More...
Go to the source code of this file.
Data Structures | |
struct | CAN_BUFFERELEMENT_s |
struct | CAN_SHIM_s |
struct | CAN_MSG_TX_TYPE_s |
struct | CAN_MSG_RX_TYPE_s |
Typedefs | |
typedef uint32_t(* | CAN_TxCallbackFunction_f) (uint32_t ID, uint8_t DLC, CAN_ENDIANNESS_e endianness, uint8_t *candata, uint8_t *pMuxId, const CAN_SHIM_s *const kpkCanShim) |
typedef uint32_t(* | CAN_RxCallbackFunction_f) (uint32_t ID, uint8_t DLC, CAN_ENDIANNESS_e endianness, const uint8_t *const kpkCanData, const CAN_SHIM_s *const kpkCanShim) |
Enumerations | |
enum | CAN_ENDIANNESS_e { CAN_LITTLE_ENDIAN , CAN_BIG_ENDIAN } |
Variables | |
const CAN_SHIM_s | can_kShim |
const CAN_MSG_TX_TYPE_s | can_txMessages [] |
const CAN_MSG_RX_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_NODE (canREG1) |
#define CAN1_STANDBY_PIN (PEX_PIN01) |
#define CAN2_ENABLE_PIN (PEX_PIN02) |
#define CAN2_NODE (canREG2) |
#define CAN2_STANDBY_PIN (PEX_PIN03) |
#define CAN_ID_BOOT_MESSAGE (0x199u) |
#define CAN_ID_COMMAND (0x230u) |
#define CAN_ID_DEBUG (0x200u) |
#define CAN_ID_DIE_ID (0x227u) |
#define CAN_ID_IMD_INFO (0x37u) |
----------------------—CAUTION----------------------— The 3 following defines are used by the insulation monitoring device (IMD). If they are changed, the IMD will not work anymore ----------------------—CAUTION----------------------— CAN message ID for info message from iso165c
#define CAN_ID_IMD_REQUEST (0x22u) |
#define CAN_ID_IMD_RESPONSE (0x23u) |
#define CAN_ID_SOFTWARE_RESET (0x95u) |
#define CAN_ID_STRING0_CURRENT (0x521u) |
#define CAN_ID_STRING0_CURRENT_COUNTER (0x527u) |
#define CAN_ID_STRING0_ENERGY_COUNTER (0x528u) |
#define CAN_ID_STRING0_POWER (0x526u) |
#define CAN_ID_STRING0_TEMPERATURE (0x525u) |
#define CAN_ID_STRING0_VOLTAGE1 (0x522u) |
#define CAN_ID_STRING0_VOLTAGE2 (0x523u) |
#define CAN_ID_STRING0_VOLTAGE3 (0x524u) |
#define CAN_ID_SW_VERSION (0x777u) |
#define CAN_ID_TX_DETAIL_STATE (0x226u) |
#define CAN_ID_TX_LIMIT_VALUES (0x224u) |
#define CAN_ID_TX_MINIMUM_MAXIMUM_VALUES (0x223u) |
#define CAN_ID_TX_PACK_STATE_ESTIMATION (0x225u) |
#define CAN_ID_TX_PACK_VALUES (0x222u) |
#define CAN_ID_TX_STATE (0x220u) |
#define CAN_ID_TX_STRING_MINIMUM_MAXIMUM (0x281u) |
#define CAN_ID_TX_STRING_STATE (0x221u) |
#define CAN_ID_TX_STRING_STATE_ESTIMATION (0x282u) |
#define CAN_ID_TX_STRING_VALUES (0x280u) |
#define CAN_ID_TX_STRING_VALUES_2 (0x283u) |
#define CAN_ID_TX_TEMPERATURES (0x250u) |
#define CAN_ID_TX_VOLTAGES (0x240u) |
#define CAN_MAX_11BIT_ID (2048u) |
#define CAN_MAX_DLC (8u) |
#define CAN_TX_DETAIL_STATE_PERIOD_MS (1000u) |
#define CAN_TX_DETAIL_STATE_PHASE_MS (100u) |
#define CAN_TX_LIMIT_VALUES_PERIOD_MS (100u) |
#define CAN_TX_LIMIT_VALUES_PHASE_MS (30u) |
#define CAN_TX_MINIMUM_MAXIMUM_VALUES_PERIOD_MS (100u) |
#define CAN_TX_MINIMUM_MAXIMUM_VALUES_PHASE_MS (40u) |
#define CAN_TX_PACK_STATE_ESTIMATION_PERIOD_MS (1000u) |
#define CAN_TX_PACK_STATE_ESTIMATION_PHASE_MS (50u) |
#define CAN_TX_PACK_VALUES_PERIOD_MS (100u) |
#define CAN_TX_PACK_VALUES_PHASE_MS (60u) |
#define CAN_TX_STATE_PERIOD_MS (100u) |
#define CAN_TX_STATE_PHASE_MS (0u) |
#define CAN_TX_STRING_MINIMUM_MAXIMUM_PERIOD_MS (100u) |
#define CAN_TX_STRING_MINIMUM_MAXIMUM_PHASE_MS (90u) |
#define CAN_TX_STRING_STATE_ESTIMATION_PERIOD_MS (1000u) |
#define CAN_TX_STRING_STATE_ESTIMATION_PHASE_MS (0u) |
#define CAN_TX_STRING_STATE_PERIOD_MS (100u) |
#define CAN_TX_STRING_STATE_PHASE_MS (70u) |
#define CAN_TX_STRING_VALUES_2_PERIOD_MS (100u) |
#define CAN_TX_STRING_VALUES_2_PHASE_MS (10u) |
#define CAN_TX_STRING_VALUES_PERIOD_MS (100u) |
#define CAN_TX_STRING_VALUES_PHASE_MS (80u) |
#define CAN_TX_TEMPERATURES_PERIOD_MS (200u) |
#define CAN_TX_TEMPERATURES_PHASE_MS (20u) |
#define CAN_TX_VOLTAGES_PERIOD_MS (100u) |
#define CAN_TX_VOLTAGES_PHASE_MS (10u) |
typedef uint32_t(* CAN_RxCallbackFunction_f) (uint32_t ID, uint8_t DLC, CAN_ENDIANNESS_e endianness, const uint8_t *const kpkCanData, const CAN_SHIM_s *const kpkCanShim) |
typedef uint32_t(* CAN_TxCallbackFunction_f) (uint32_t ID, uint8_t DLC, CAN_ENDIANNESS_e endianness, 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 |
|
extern |