|
RTEMS
5.1
|
1 #ifndef _SMC91111_CONFIG_H_ 2 #define _SMC91111_CONFIG_H_ 8 #define INTERRUPT_EVENT RTEMS_EVENT_1 14 #define START_TRANSMIT_EVENT RTEMS_EVENT_2 17 #define SMC91111_TX_WAIT_EVENT RTEMS_EVENT_3 24 #define RBUF_SIZE 1536 28 #if (MCLBYTES < RBUF_SIZE) 29 # error "Driver must have MCLBYTES > RBUF_SIZE" 34 #define LAN91CXX_32BIT_RX 35 #define LAN91CXX_IS_LAN91C111 41 typedef uint32_t CYG_WORD;
42 typedef uint8_t CYG_BYTE;
43 typedef uint16_t CYG_WORD16;
44 typedef uint32_t CYG_WORD32;
47 # define CYG_SWAP16(_x_) \ 48 ({ uint16_t _x = (_x_); ((_x << 8) | (_x >> 8)); }) 52 # define CYG_SWAP32(_x_) \ 53 ({ uint32_t _x = (_x_); \ 55 ((0x0000FF00UL & _x) << 8) | \ 56 ((0x00FF0000UL & _x) >> 8) | \ 60 # define CYG_CPU_TO_BE16(_x_) (_x_) 61 # define CYG_CPU_TO_BE32(_x_) (_x_) 62 # define CYG_BE16_TO_CPU(_x_) (_x_) 63 # define CYG_BE32_TO_CPU(_x_) (_x_) 65 # define CYG_CPU_TO_LE16(_x_) CYG_SWAP16((_x_)) 66 # define CYG_CPU_TO_LE32(_x_) CYG_SWAP32((_x_)) 67 # define CYG_LE16_TO_CPU(_x_) CYG_SWAP16((_x_)) 68 # define CYG_LE32_TO_CPU(_x_) CYG_SWAP32((_x_)) 70 #define CYG_MACRO_START do { 71 #define CYG_MACRO_END } while (0) 72 #define HAL_IO_BARRIER() \ 73 __asm__ volatile ( "" : : : "memory" ) 75 #define HAL_READ_UINT8( _register_, _value_ ) \ 77 ((_value_) = *((volatile CYG_BYTE *)(_register_))); \ 81 #define HAL_WRITE_UINT8( _register_, _value_ ) \ 83 (*((volatile CYG_BYTE *)(_register_)) = (_value_)); \ 87 #define HAL_READ_UINT16( _register_, _value_ ) \ 89 ((_value_) = *((volatile CYG_WORD16 *)(_register_))); \ 93 #define HAL_WRITE_UINT16( _register_, _value_ ) \ 95 (*((volatile CYG_WORD16 *)(_register_)) = (_value_)); \ 99 #define HAL_READ_UINT32( _register_, _value_ ) \ 101 ((_value_) = *((volatile CYG_WORD32 *)(_register_))); \ 105 #define HAL_READ_UINT16( _register_, _value_ ) \ 107 ((_value_) = *((volatile CYG_WORD16 *)(_register_))); \ 111 #define CYG_ASSERT(c,p) do { if (!(c)) { while(1) { printf(p);} }; } while(0) 113 #define HAL_DELAY_US(p) rtems_task_wake_after (RTEMS_MICROSECONDS_TO_TICKS (p))