trm816.h
来自「can4linux-3.5.3.gz can4 linux」· C头文件 代码 · 共 50 行
H
50 行
/************************************************************************//* hardware access functions or macros *//************************************************************************//* Index memory adress * Two meory adresses are defined * first the first address hast to be written with the adress of * the CAN register to be addressed * second on the second adress read or write the value */#if CAN_INDEXED_PORT_IO/* #error Indexed Intel port I/O access *//* using port I/O with indexed inb()/outb() for Intel architectures like SSV TRM/816 DIL-NET-PC */#ifdef IODEBUG#define CANout(bd,adr,v) {\ printk("CANout bd:%x base:%x reg:%x val:%x\n", \ bd, (u32) Base[bd], \ (u32) ®base->adr,v); \ outb((u32) ®base->adr,(u32) Base[bd]);\ outb(v,((u32) Base[bd])+1);\ }#else#define CANout(bd,adr,v) {\ outb((u32) ®base->adr,(u32) Base[bd]);\ outb(v,((u32) Base[bd])+1);\}#endif#define CANin(bd,adr) \ Indexed_Inb((u32) Base[bd],(u32) ®base->adr)#define CANset(bd,adr,m) {\ unsigned val; \ val=Indexed_Inb((u32) Base[bd],(u32) ®base->adr);\ outb((u32) ®base->adr,(u32) Base[bd]);\ outb(val | m,((u32) Base[bd])+1);\}#define CANreset(bd,adr,m) {\ unsigned val; \ val=Indexed_Inb((u32) Base[bd],(u32) ®base->adr);\ outb((u32) ®base->adr,(u32) Base[bd]);\ outb(val & ~m,((u32) Base[bd])+1);\}#define CANtest(bd,adr,m) \ (Indexed_Inb((u32) Base[bd],(u32) ®base->adr) & m)#endif
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?