ParaCAN 0.0.40-master SHA: 4c1cf74739
CAN_Para.h File Reference

Hardware-independent parameterinterface implementation via Controller Area Network (CAN) More...

#include <stdbool.h>
#include <stdint.h>

Go to the source code of this file.

Macros

#define VERSION_CAN_PARALIB   6
 Version der Paralib für CAN. More...
 

Functions

void CAN_Para_Init (void)
 Initialization of CAN Parameterinterface. More...
 
void CAN_Para_Cyclic (void)
 Cyclic procedure to process messages that needs more than one answer message. More...
 
uint8_t CAN_Para_ReceiveIRQ (uint8_t data[8], uint32_t id, uint8_t DLC)
 Reads Message from CAN-Interface and handles Parameter Request. More...
 
void CAN_Para_SendPing (void)
 Send ping to connected PCs. More...
 
void CAN_SendTelegram (uint8_t data_length, uint8_t *data, uint16_t id_value)
 Send CAN Message to transmit Buffer. More...
 

Variables

const uint16_t cui16_CANBaseAddress
 
const uint16_t cui16_CANBroadcastAddress
 

Detailed Description

Hardware-independent parameterinterface implementation via Controller Area Network (CAN)

Author
R. Wegener
Date
17.03.2022


© Copyright 2017-2022 Copyright: Torquetronik GmbH Stütingstraße 30 58285 Gevelsberg

Macro Definition Documentation

◆ VERSION_CAN_PARALIB

#define VERSION_CAN_PARALIB   6

Version der Paralib für CAN.

Function Documentation

◆ CAN_Para_Cyclic()

void CAN_Para_Cyclic ( void  )

Cyclic procedure to process messages that needs more than one answer message.

This function must be called regularly, or from CAN transmit interrupt. If the global variable g_ui32CAN_RemainingDataToSend > 0 the remaining data is sent. If further characters in the string or other subIDs are to be transmitted, these are sent.

Author
R. Wegener

◆ CAN_Para_Init()

void CAN_Para_Init ( void  )

Initialization of CAN Parameterinterface.

Must be called before using all other functions. Local variables are initialized here.

Author
R. Wegener

◆ CAN_Para_ReceiveIRQ()

uint8_t CAN_Para_ReceiveIRQ ( uint8_t  data[8],
uint32_t  id,
uint8_t  DLC 
)

Reads Message from CAN-Interface and handles Parameter Request.

Is normally called from receive-interrupt. After processing the CAN-Message the answer is sent depending on the message type.

Return values
1Data is processed
0Data is not processed.
Parameters
dataData of the received CAN-Telegram.
idIdentifier of the received CAN-Telegram.
DLCNumber of bytes received in this CAN-Telegram.
Author
R. Wegener

◆ CAN_Para_SendPing()

void CAN_Para_SendPing ( void  )

Send ping to connected PCs.

Send one Ping from Device for Autoconnect to PC, to announce presence of Device. The Device starts connecting afterwards. Should mot be send faster than in a 500ms cycle.

Author
R. Wegener

◆ CAN_SendTelegram()

void CAN_SendTelegram ( uint8_t  data_length,
uint8_t *  data,
uint16_t  id_value 
)

Send CAN Message to transmit Buffer.

Parameters
data_lengthLength of CAN-Telegram
dataData-Bytes
id_valueCAN-Identifier
Author
R. Wegener

< Standard Id

< Data frame

< Peripheral base address in the alias region

Variable Documentation

◆ cui16_CANBaseAddress

const uint16_t cui16_CANBaseAddress
extern

◆ cui16_CANBroadcastAddress

const uint16_t cui16_CANBroadcastAddress
extern