The foxBMS secondary mcu API documentation
cansignal.h File Reference

Headers for the messages and signal settings for the CAN driver. More...

#include "cansignal_cfg.h"
#include "can.h"
Include dependency graph for cansignal.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  CANS_STATE_s
 

Functions

void CANS_Init (void)
 
void CANS_MainFunction (void)
 
void CANS_Enable_Periodic (uint8_t command)
 enable/disable the periodic transmit/receive. More...
 
uint8_t CANS_IsCurrentSensorPresent (void)
 set flag for presence of current sensor. More...
 
uint8_t CANS_IsCurrentSensorCCPresent (void)
 set flag for sending of C-C by current sensor. More...
 
STD_RETURN_TYPE_e CANS_AddMessage (CAN_NodeTypeDef_e canNode, uint32_t msgID, uint8_t *ptrMsgData, uint32_t msgLength, uint32_t RTR)
 Add message to transmit buffer, message will be transmitted shortly after. More...
 
STD_RETURN_TYPE_e CANS_TransmitBuffer (CAN_NodeTypeDef_e canNode)
 Transmits canNode transmit buffer. More...
 
STD_RETURN_TYPE_e CANS_TransmitMessage (CAN_NodeTypeDef_e canNode, uint32_t msgID, uint8_t *ptrMsgData, uint32_t msgLength, uint32_t RTR)
 Transmits message directly on the CAN bus. More...
 

Detailed Description

Headers for the messages and signal settings for the CAN driver.

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
01.10.2015 (date of creation)
Module-prefix CANS

generic conversion module header of Can signals from CAN buffered reception to DATA Manager and vice versa

Function Documentation

◆ CANS_AddMessage()

STD_RETURN_TYPE_e CANS_AddMessage ( CAN_NodeTypeDef_e  canNode,
uint32_t  msgID,
uint8_t *  ptrMsgData,
uint32_t  msgLength,
uint32_t  RTR 
)

Add message to transmit buffer, message will be transmitted shortly after.

Parameters
canNodecanNode on which the message shall be transmitted
msgIDID of the message that will be transmitted
ptrMsgDatapointer to a uint8_t array that contains the message that will be transmitted
msgLengthlength of the message that will be transmitted This parameter can be a value of CAN_identifier_type.
RTRSpecifies the type of frame for the message that will be transmitted. This parameter can be a value of CAN_remote_transmission_request
Return values
E_OKif successful, E_NOT_OK if buffer is full or error occurred
Here is the call graph for this function:

◆ CANS_Enable_Periodic()

void CANS_Enable_Periodic ( uint8_t  command)

enable/disable the periodic transmit/receive.

Returns
none

◆ CANS_Init()

void CANS_Init ( void  )

initializes local variables and module internals needed to use conversion of can signals. Until now no initialization is needed and thus the function does nothing.

◆ CANS_IsCurrentSensorCCPresent()

uint8_t CANS_IsCurrentSensorCCPresent ( void  )

set flag for sending of C-C by current sensor.

Returns
retval TRUE if C-C is being sent, FALSE otherwise

◆ CANS_IsCurrentSensorPresent()

uint8_t CANS_IsCurrentSensorPresent ( void  )

set flag for presence of current sensor.

Returns
retval TRUE if a current sensor is present, FALSE otherwise

◆ CANS_MainFunction()

void CANS_MainFunction ( void  )

handles the conversion of can signals from and to datamanager database or other modules defined by the getter and setter configuration.

Here is the call graph for this function:

◆ CANS_TransmitBuffer()

STD_RETURN_TYPE_e CANS_TransmitBuffer ( CAN_NodeTypeDef_e  canNode)

Transmits canNode transmit buffer.

Parameters
canNodecanNode on which the message shall be transmitted
Return values
E_OKif transmission successful, otherwise E_NOT_OK
Here is the call graph for this function:

◆ CANS_TransmitMessage()

STD_RETURN_TYPE_e CANS_TransmitMessage ( CAN_NodeTypeDef_e  canNode,
uint32_t  msgID,
uint8_t *  ptrMsgData,
uint32_t  msgLength,
uint32_t  RTR 
)

Transmits message directly on the CAN bus.

Parameters
canNodecanNode on which the message shall be transmitted
msgIDID of the message that will be transmitted
ptrMsgDatapointer to the data that shall be transmitted
msgLengthSpecifies the data length
RTRSpecifies the type of frame for the message that will be transmitted.
Return values
E_OKif transmission successful, otherwise E_NOT_OK
Here is the call graph for this function: