31#ifndef GRCAN_DEFAULT_BAUD
33 #define GRCAN_DEFAULT_BAUD 500000
36#ifndef GRCAN_SAMPLING_POINT
37 #define GRCAN_SAMPLING_POINT 80
40#define WRAP_AROUND_TX_MSGS 1
41#define WRAP_AROUND_RX_MSGS 2
42#define GRCAN_MSG_SIZE sizeof(struct grcan_msg)
46 unsigned char data[8];
60 unsigned int baseaddr, ram_base;
68 unsigned int corefreq_hz;
78 unsigned int rxbuf_size;
79 unsigned int txbuf_size;
82 int txcomplete, rxcomplete;
90 rtems_id rx_sem, tx_sem, txempty_sem, dev_sem;
91 SPIN_DECLARE(devlock);
94#ifdef GRCAN_REG_BYPASS_CACHE
95#define READ_REG(address) grlib_read_uncached32((unsigned int)(address))
97#define READ_REG(address) (*(volatile unsigned int *)(address))
100#ifdef GRCAN_DMA_BYPASS_CACHE
101#define READ_DMA_DOUBLE(address) grlib_read_uncached64((uint64_t *)(address))
102#define READ_DMA_WORD(address) grlib_read_uncached32((unsigned int)(address))
103#define READ_DMA_BYTE(address) grlib_read_uncached8((unsigned int)(address))
105#define READ_DMA_DOUBLE(address) (*(volatile uint64_t *)(address))
106#define READ_DMA_WORD(address) (*(volatile unsigned int *)(address))
107#define READ_DMA_BYTE(address) (*(volatile unsigned char *)(address))
110extern int state2err[4];
115int grcan_wait_rxdata(
struct grcan_priv *pDev,
int min);
116int grcan_wait_txspace(
struct grcan_priv *pDev,
int min);
118static inline unsigned int grcan_hw_rxavail(
131 return (wp - rp) / GRCAN_MSG_SIZE;
133 return (size - (rp - wp)) / GRCAN_MSG_SIZE;
137static inline unsigned int grcan_hw_txspace(
148 return size / GRCAN_MSG_SIZE - WRAP_AROUND_TX_MSGS;
153 left = size - (wp - rp);
158 return left / GRCAN_MSG_SIZE - WRAP_AROUND_TX_MSGS;
Objects_Id rtems_id
This type represents RTEMS object identifiers.
Definition: types.h:94
int open(const char *path, int oflag,...)
Definition: open.c:181
Definition: deflate.c:114
Definition: grcan_internal.h:49
Definition: grcan_internal.h:44
Definition: grcan_internal.h:57