Main Page   Alphabetical List   Data Structures   File List   Data Fields   Globals  

canop.h File Reference

Contains platform dependent functions. More...

#include <def.h>
#include <general.h>
#include <init.h>

Go to the source code of this file.

Data Structures

struct  s_rx_buffer_message

Functions

BYTE canSend (BYTE notused, Message *m)
BYTE canReceive (BYTE notused, Message *m)
void setupCanInterface (sInitParameter *pParameter)
void closeCanInterface (void)

Variables

s_rx_buffer_message RAM canMessageRxBuffer [RX_CAN_BUFFER_SIZE]


Detailed Description

Contains platform dependent functions.

This file contains functions for low-level can-interface operations. The function-declaration is platform independent, but the function itself (located in the canop.c-file) are platform dependent. Create a canop.c file for every platform you want to port this library.


Function Documentation

BYTE canReceive BYTE    notused,
Message   m
 

This message receives CAN-Messages. This function is platform dependent. If a message has been read, it returns 0. If no new message could be read, the return value is unequal to 0.

Parameters:
m  Here the incoming message data/cobid/rtr-flag/... are copied. The memory for this struct has to be allocated by the caller.
Returns :
0 on success, -1 on failure (this includes, thata no new messages has arrived)

BYTE canSend BYTE    notused,
Message   m
 

Sends a CAN-Message. This function is platform dependent and has to be implemented for every platform. Return 0 for success.

Parameters:
m  The pointer to the message struct. The memory has to be allocated by the caller, of course.
Returns :
0 on success, -1 on failure

void closeCanInterface void   
 

This function does make only sense on PC based systems, because there we have to close the connection to the CAN card. On microcontroller system this makes normally no sens.

void setupCanInterface sInitParameter   pParameter
 

This function sets up the CAN-Interface (baudrate and other neccessary settings) this function is platform dependent. Note: The memory for the message pointer has to be already allocated.

Parameters:
pParameter  The struct sInitParameter contains values needed for initialising the CAN-interface.


Variable Documentation

s_rx_buffer_message RAM canMessageRxBuffer[RX_CAN_BUFFER_SIZE]
 

this is the buffer, where all incoming can/canopen messages are stored a valid flag indicates wheter an entry is valid or not. if someone/thing reads/processes a message it must! set the valid flag to false!


Generated on Wed Dec 25 01:04:57 2002 for CANopen SlaveLib by doxygen1.2.17