foxBMS-UnitTests  1.0.0
The foxBMS Unit Tests API Documentation
can_cfg.h File Reference

Headers for the configuration for the CAN module. More...

#include "general.h"
#include "database.h"
Include dependency graph for can_cfg.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  CAN_BUFFERELEMENT
 
struct  CAN_MSG_TX_TYPE
 
struct  CAN_MSG_RX_TYPE
 

Macros

#define CAN_HET1_GIO   (hetREG1)
 
#define CAN_HET1_EN_PIN   (14U)
 
#define CAN_HET1_STB_PIN   (16U)
 
#define CAN_USE_CAN_NODE0   (1U)
 
#define CAN_USE_CAN_NODE1   (0U)
 
#define CAN_ID_SOFTWARE_RESET_MSG   (0x95U)
 
#define CAN_PIN_TOGGLE_DELAY_US   (5u)
 

Typedefs

typedef struct CAN_BUFFERELEMENT CAN_BUFFERELEMENT_s
 
typedef uint32_t(* can_callback_funcPtr) (uint32_t ID, uint8_t DLC, CAN_byteOrder_e byteorder, uint8_t *candata, uint32_t *pMuxId)
 
typedef struct CAN_MSG_TX_TYPE CAN_MSG_TX_TYPE_s
 
typedef struct CAN_MSG_RX_TYPE CAN_MSG_RX_TYPE_s
 

Enumerations

enum  CAN_byteOrder_e { littleEndian, bigEndian }
 

Functions

DATA_BLOCK_CELL_VOLTAGE_sTEST_CAN_GetCellvoltageTab (void)
 
uint32_t TEST_CAN_TxVoltage (uint32_t id, uint8_t dlc, CAN_byteOrder_e byteOrder, uint8_t *pCanData, uint32_t *pMuxId)
 
uint32_t TEST_CAN_TxPcbTemperature (uint32_t id, uint8_t dlc, CAN_byteOrder_e byteOrder, uint8_t *pCanData, uint32_t *pMuxId)
 
uint32_t TEST_CAN_TxExternalTemperature (uint32_t id, uint8_t dlc, CAN_byteOrder_e byteOrder, uint8_t *pCanData, uint32_t *pMuxId)
 
uint32_t TEST_CAN_TxVoltageMinMax (uint32_t id, uint8_t dlc, CAN_byteOrder_e byteOrder, uint8_t *pCanData, uint32_t *pMuxId)
 
uint32_t TEST_CAN_RxRequest (uint32_t id, uint8_t dlc, CAN_byteOrder_e byteOrder, uint8_t *pCanData, uint32_t *pMuxId)
 
uint32_t TEST_CAN_RxSwReset (uint32_t id, uint8_t dlc, CAN_byteOrder_e byteOrder, uint8_t *pCanData, uint32_t *pMuxId)
 
uint32_t TEST_CAN_RxCurrentSensor (uint32_t id, uint8_t dlc, CAN_byteOrder_e byteOrder, uint8_t *pCanData, uint32_t *pMuxId)
 
uint32_t TEST_CAN_RxDebug (uint32_t id, uint8_t dlc, CAN_byteOrder_e byteOrder, uint8_t *pCanData, uint32_t *pMuxId)
 
uint32_t TEST_CAN_RxSwVersion (uint32_t id, uint8_t dlc, CAN_byteOrder_e byteOrder, uint8_t *pCanData, uint32_t *pMuxId)
 

Variables

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
 

Detailed Description

Headers for the configuration for the CAN module.

BSD 3-Clause License Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
  3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

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:

″This product uses parts of foxBMS®″

″This product includes parts of foxBMS®″

″This product is derived from foxBMS®″

Author
foxBMS Team
Date
2019-12-04 (date of creation)
Updated
2019-12-04 (date of last update)
Prefix
CAN

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.

Macro Definition Documentation

◆ CAN_HET1_EN_PIN

#define CAN_HET1_EN_PIN   (14U)

register pin that handles enable

Definition at line 71 of file can_cfg.h.

◆ CAN_HET1_GIO

#define CAN_HET1_GIO   (hetREG1)

macro for the register that handles the CAN-interface

Definition at line 68 of file can_cfg.h.

◆ CAN_HET1_STB_PIN

#define CAN_HET1_STB_PIN   (16U)

register pin that handles standby

Definition at line 73 of file can_cfg.h.

◆ CAN_ID_SOFTWARE_RESET_MSG

#define CAN_ID_SOFTWARE_RESET_MSG   (0x95U)

CAN message ID to perform a software reset

Definition at line 92 of file can_cfg.h.

◆ CAN_PIN_TOGGLE_DELAY_US

#define CAN_PIN_TOGGLE_DELAY_US   (5u)

delay in µs used in CAN_InitializeTransceiver for pin-toggling

Definition at line 95 of file can_cfg.h.

◆ CAN_USE_CAN_NODE0

#define CAN_USE_CAN_NODE0   (1U)

CAN node enabling

Definition at line 86 of file can_cfg.h.

◆ CAN_USE_CAN_NODE1

#define CAN_USE_CAN_NODE1   (0U)

CAN node enabling

Definition at line 89 of file can_cfg.h.

Typedef Documentation

◆ CAN_BUFFERELEMENT_s

Buffer element used to store the ID and data of a CAN RX message

◆ can_callback_funcPtr

typedef uint32_t( * can_callback_funcPtr) (uint32_t ID, uint8_t DLC, CAN_byteOrder_e byteorder, uint8_t *candata, uint32_t *pMuxId)

type definition for callback functions used in CAN messages

Definition at line 104 of file can_cfg.h.

◆ CAN_MSG_RX_TYPE_s

type definition for structure of an RX CAN message

◆ CAN_MSG_TX_TYPE_s

type definition for structure of a TX CAN message

Enumeration Type Documentation

◆ CAN_byteOrder_e

enum for byte order

Enumerator
littleEndian 
bigEndian 

Definition at line 98 of file can_cfg.h.

Function Documentation

◆ TEST_CAN_GetCellvoltageTab()

DATA_BLOCK_CELL_VOLTAGE_s* TEST_CAN_GetCellvoltageTab ( void  )

Definition at line 898 of file can_cfg.c.

◆ TEST_CAN_RxCurrentSensor()

uint32_t TEST_CAN_RxCurrentSensor ( uint32_t  id,
uint8_t  dlc,
CAN_byteOrder_e  byteOrder,
uint8_t *  pCanData,
uint32_t *  pMuxId 
)

Definition at line 953 of file can_cfg.c.

Here is the call graph for this function:

◆ TEST_CAN_RxDebug()

uint32_t TEST_CAN_RxDebug ( uint32_t  id,
uint8_t  dlc,
CAN_byteOrder_e  byteOrder,
uint8_t *  pCanData,
uint32_t *  pMuxId 
)

Definition at line 961 of file can_cfg.c.

Here is the call graph for this function:

◆ TEST_CAN_RxRequest()

uint32_t TEST_CAN_RxRequest ( uint32_t  id,
uint8_t  dlc,
CAN_byteOrder_e  byteOrder,
uint8_t *  pCanData,
uint32_t *  pMuxId 
)

Definition at line 937 of file can_cfg.c.

Here is the call graph for this function:

◆ TEST_CAN_RxSwReset()

uint32_t TEST_CAN_RxSwReset ( uint32_t  id,
uint8_t  dlc,
CAN_byteOrder_e  byteOrder,
uint8_t *  pCanData,
uint32_t *  pMuxId 
)

Definition at line 945 of file can_cfg.c.

Here is the call graph for this function:

◆ TEST_CAN_RxSwVersion()

uint32_t TEST_CAN_RxSwVersion ( uint32_t  id,
uint8_t  dlc,
CAN_byteOrder_e  byteOrder,
uint8_t *  pCanData,
uint32_t *  pMuxId 
)

Definition at line 969 of file can_cfg.c.

Here is the call graph for this function:

◆ TEST_CAN_TxExternalTemperature()

uint32_t TEST_CAN_TxExternalTemperature ( uint32_t  id,
uint8_t  dlc,
CAN_byteOrder_e  byteOrder,
uint8_t *  pCanData,
uint32_t *  pMuxId 
)

Definition at line 919 of file can_cfg.c.

Here is the call graph for this function:

◆ TEST_CAN_TxPcbTemperature()

uint32_t TEST_CAN_TxPcbTemperature ( uint32_t  id,
uint8_t  dlc,
CAN_byteOrder_e  byteOrder,
uint8_t *  pCanData,
uint32_t *  pMuxId 
)

Definition at line 911 of file can_cfg.c.

Here is the call graph for this function:

◆ TEST_CAN_TxVoltage()

uint32_t TEST_CAN_TxVoltage ( uint32_t  id,
uint8_t  dlc,
CAN_byteOrder_e  byteOrder,
uint8_t *  pCanData,
uint32_t *  pMuxId 
)

Definition at line 903 of file can_cfg.c.

Here is the call graph for this function:

◆ TEST_CAN_TxVoltageMinMax()

uint32_t TEST_CAN_TxVoltageMinMax ( uint32_t  id,
uint8_t  dlc,
CAN_byteOrder_e  byteOrder,
uint8_t *  pCanData,
uint32_t *  pMuxId 
)

Definition at line 927 of file can_cfg.c.

Here is the call graph for this function:

Variable Documentation

◆ can_rxLength

const uint8_t can_rxLength
extern

array length for transmission CAN0 message definition

length of CAN message arrays

Definition at line 267 of file can_cfg.c.

◆ can_rxMessages

const CAN_MSG_RX_TYPE_s can_rxMessages[]
extern

registry of CAN RX messages

Definition at line 222 of file can_cfg.c.

◆ can_txLength

const uint8_t can_txLength
extern

array length for transmission CAN0 message definition

length of CAN message arrays

Definition at line 266 of file can_cfg.c.

◆ can_txMessages

const CAN_MSG_TX_TYPE_s can_txMessages[]
extern

registry of CAN TX messages

Definition at line 180 of file can_cfg.c.