stepRocker Open Source TMCL
1.00
|
CAN functions. More...
#include <stdlib.h>
#include "derivative.h"
#include "bits.h"
#include "stepRocker.h"
#include "Can.h"
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) |
CAN functions.
This file provides functions for intializing and using the CAN interface.
CanGetMessage | ( | TCanFrame * | Msg | ) |
*Msg | Pointer to TCanFrame structure to take the message |
Try to read a message from the receive buffer if it is not empty.
CanSendMessage | ( | TCanFrame * | Msg | ) |
*Msg | Pointer to CAN message (type TCanFrame) to be sent |
Try to send a CAN message by writing it to mailbox 15.
Initialization of the CAN interface.
Baudrate | CAN-Bitrate 1 2 3 4 5 6 7 8 10 20 50 100 125 250 500 1000kBit/s |
ReceiveID | Only CAN messages with this ID (standard or extended frames) will be accepted. |
SecondaryID | If this is !=0 then also messgaes with this ID (standard or extended frames) will be accepted. |