stepRocker Open Source TMCL  1.00
 All Data Structures Files Functions Variables Typedefs Enumerations Macros
Macros | Functions
Can.c File Reference

CAN functions. More...

#include <stdlib.h>
#include "derivative.h"
#include "bits.h"
#include "stepRocker.h"
#include "Can.h"
Include dependency graph for Can.c:

Macros

#define CAN_MB_RX_INACTIVE   0x00
 
#define CAN_MB_FULL   0x02
 
#define CAN_MB_EMPTY   0x04
 
#define CAN_MB_TX_INACTIVE   0x08
 
#define CAN_MB_DATA   0x0C
 

Functions

void InitCan (UCHAR Bitrate, USHORT ReceiveID1, USHORT ReceiveID2)
 Initialization of the CAN interface. More...
 
int CanSendMessage (TCanFrame *Msg)
 
int CanGetMessage (TCanFrame *Msg)
 

Detailed Description

CAN functions.

Author
Trinamic Motion Control GmbH & Co KG
Version
2.20

This file provides functions for intializing and using the CAN interface.

Function Documentation

CanGetMessage ( TCanFrame Msg)
Parameters
*MsgPointer to TCanFrame structure to take the message
Returns
TRUE: Message successfully read
FALSE: No message read (buffer empty).

Try to read a message from the receive buffer if it is not empty.

Here is the caller graph for this function:

CanSendMessage ( TCanFrame Msg)
Parameters
*MsgPointer to CAN message (type TCanFrame) to be sent
Returns
TRUE if message could be written
FALSE if buffer full.

Try to send a CAN message by writing it to mailbox 15.

Here is the caller graph for this function:

InitCan ( UCHAR  Bitrate,
USHORT  ReceiveID1,
USHORT  ReceiveID2 
)

Initialization of the CAN interface.

Parameters
BaudrateCAN-Bitrate 1 2 3 4 5 6 7 8 10 20 50 100 125 250 500 1000kBit/s
ReceiveIDOnly CAN messages with this ID (standard or extended frames) will be accepted.
SecondaryIDIf this is !=0 then also messgaes with this ID (standard or extended frames) will be accepted.

Here is the caller graph for this function: