Main Page | Modules | Alphabetical List | Data Structures | Directories | File List | Data Fields | Globals | Related Pages | Examples

sja1000.c File Reference


Detailed Description

Driver for SJA1000 CAN-Bus controller.

The SJA1000 controller is connected to the memory bus. It's base address and interrupt is set by NutRegisterDevice.

Have a look to our m-can board if you have questions.


Data Structures

struct  _CANBuffer

Defines

#define SJA_SIGNAL   sig_INTERRUPT7
#define SJA_EICR   EICRB
#define SJA_SIGNAL_BIT   7
#define CAN_BufSize   64

Typedefs

typedef _CANBuffer CANBuffer

Functions

void CANBufferInit (CANBuffer *buffer, u_short size)
CANFRAME CANBufferGetMutex (CANBuffer *buffer)
void CANBufferPutMutex (CANBuffer *buffer, CANFRAME *data)
CANFRAME CANBufferGet (CANBuffer *buffer)
void CANBufferPut (CANBuffer *buffer, CANFRAME *data)
u_short CANBufferFree (CANBuffer *buffer)
u_char SJARxAvail (NUTDEVICE *dev)
 checks if data is available in input buffer
u_char SJATxFree (NUTDEVICE *dev)
 checks if there's still space in output buffer
void SJAOutput (NUTDEVICE *dev, CANFRAME *frame)
 Write a frame from to output buffer.
void SJAInput (NUTDEVICE *dev, CANFRAME *frame)
 Reads a frame from input buffer.
void SJASetAccCode (NUTDEVICE *dev, u_char *ac)
 Sets the acceptance code.
void SJASetAccMask (NUTDEVICE *dev, u_char *am)
 Sets the acceptance mask.
u_char SJASetBaudrate (NUTDEVICE *dev, u_long baudrate)
 Sets the baudrate.
void SJATxFrame (CANFRAME *CAN_frame)
 Sends a CAN Frane.
void SJARxFrame (CANFRAME *CAN_frame)
 Receives a CAN Frane.
void CAN_Tx (void *arg)
 CAN transmitter thread.
int SJAInit (NUTDEVICE *dev)
 Initialize SJA1000 Canbus interface.

Variables

CANINFO dcb_sja1000
volatile u_short sja_base = 0x0000
CANBuffer CAN_RX_BUF
CANBuffer CAN_TX_BUF
IFCAN ifc_sja1000
 Interface information structure.
NUTDEVICE devSJA1000
 Device information structure.


© 2000-2006 by egnite Software GmbH - visit http://www.ethernut.de/