RTEMS  5.0.0
Files | Data Structures | Macros | Enumerations | Functions

Macros used for grcan controller. More...

Files

file  grcan.h
 
file  occan.h
 Gaisler wrapper to OpenCores CAN - driver interface.
 

Data Structures

struct  grcan_regs
 
struct  grcan_stats
 
struct  grcan_timing
 
struct  grcan_selection
 
struct  grcan_filter
 
struct  CANMsg
 

Macros

#define GRCAN_CFG_ABORT   0x00000001
 
#define GRCAN_CFG_ENABLE0   0x00000002
 
#define GRCAN_CFG_ENABLE1   0x00000004
 
#define GRCAN_CFG_SELECTION   0x00000008
 
#define GRCAN_CFG_SILENT   0x00000010
 
#define GRCAN_CFG_BPR   0x00000300
 
#define GRCAN_CFG_RSJ   0x00007000
 
#define GRCAN_CFG_PS1   0x00f00000
 
#define GRCAN_CFG_PS2   0x000f0000
 
#define GRCAN_CFG_SCALER   0xff000000
 
#define GRCAN_CFG_BPR_BIT   8
 
#define GRCAN_CFG_RSJ_BIT   12
 
#define GRCAN_CFG_PS1_BIT   20
 
#define GRCAN_CFG_PS2_BIT   16
 
#define GRCAN_CFG_SCALER_BIT   24
 
#define GRCAN_CTRL_RESET   0x2
 
#define GRCAN_CTRL_ENABLE   0x1
 
#define GRCAN_TXCTRL_ENABLE   1
 
#define GRCAN_TXCTRL_ONGOING   1
 
#define GRCAN_RXCTRL_ENABLE   1
 
#define GRCAN_RXCTRL_ONGOING   1
 
#define GRCAN_IRQ_IRQ   0
 
#define GRCAN_IRQ_TXSYNC   1
 
#define GRCAN_IRQ_RXSYNC   2
 
#define GRCAN_ERR_IRQ   0x1
 
#define GRCAN_OFF_IRQ   0x2
 
#define GRCAN_OR_IRQ   0x4
 
#define GRCAN_RXAHBERR_IRQ   0x8
 
#define GRCAN_TXAHBERR_IRQ   0x10
 
#define GRCAN_RXIRQ_IRQ   0x20
 
#define GRCAN_TXIRQ_IRQ   0x40
 
#define GRCAN_RXFULL_IRQ   0x80
 
#define GRCAN_TXEMPTY_IRQ   0x100
 
#define GRCAN_RX_IRQ   0x200
 
#define GRCAN_TX_IRQ   0x400
 
#define GRCAN_RXSYNC_IRQ   0x800
 
#define GRCAN_TXSYNC_IRQ   0x1000
 
#define GRCAN_RXERR_IRQ   0x2000
 
#define GRCAN_TXERR_IRQ   0x4000
 
#define GRCAN_RXMISS_IRQ   0x8000
 
#define GRCAN_TXLOSS_IRQ   0x10000
 
#define GRCAN_STAT_PASS   0x1
 
#define GRCAN_STAT_OFF   0x2
 
#define GRCAN_STAT_OR   0x4
 
#define GRCAN_STAT_AHBERR   0x8
 
#define GRCAN_STAT_ACTIVE   0x10
 
#define GRCAN_STAT_RXERRCNT   0xff00
 
#define GRCAN_STAT_TXERRCNT   0xff0000
 

Enumerations

enum  {
  GRCAN_RET_OK = 0, GRCAN_RET_INVARG = -1, GRCAN_RET_NOTSTARTED = -2, GRCAN_RET_TIMEOUT = -3,
  GRCAN_RET_BUSOFF = -4, GRCAN_RET_AHBERR = -5
}
 
enum  grcan_state { STATE_STOPPED = 0, STATE_STARTED = 1, STATE_BUSOFF = 2, STATE_AHBERR = 3 }
 

Functions

int grcan_dev_count (void)
 
void * grcan_open (int dev_no)
 
void * grcan_open_by_name (char *name, int *dev_no)
 
int grcan_close (void *d)
 
int grcan_read (void *d, CANMsg *msg, size_t count)
 
int grcan_write (void *d, CANMsg *msg, size_t count)
 
int grcan_get_state (void *d)
 
int grcan_start (void *d)
 
int grcan_stop (void *d)
 
int grcan_flush (void *d)
 
int grcan_set_silent (void *d, int silent)
 
int grcan_set_abort (void *d, int abort)
 
int grcan_set_selection (void *d, const struct grcan_selection *selection)
 
int grcan_set_speed (void *d, unsigned int hz)
 
int grcan_set_btrs (void *d, const struct grcan_timing *timing)
 
int grcan_set_rxblock (void *d, int block)
 
int grcan_set_txblock (void *d, int block)
 
int grcan_set_txcomplete (void *d, int complete)
 
int grcan_set_rxcomplete (void *d, int complete)
 
int grcan_get_stats (void *d, struct grcan_stats *stats)
 
int grcan_clr_stats (void *d)
 
int grcan_set_afilter (void *d, const struct grcan_filter *filter)
 
int grcan_set_sfilter (void *d, const struct grcan_filter *filter)
 
int grcan_get_status (void *d, unsigned int *status)
 
void grcan_register_drv (void)
 

Detailed Description

Macros used for grcan controller.