static u8 INB(unsigned long addr) { volatile io8_t *rp, val; rp = (volatile unsigned short *) ADDR(addr); ENABLE8(); val = *rp; DISABLE8(); DBGIDE("%s(addr=%lx) = 0x%x\n", __FUNCTION__, addr, SWAP8(val)); return(SWAP8(val)); }
uint8_t u8x8_d_ls013b7dh03_128x128(u8x8_t *u8x8, uint8_t msg, U8X8_UNUSED uint8_t arg_int, void *arg_ptr) { uint8_t y, c, i; uint8_t *ptr; switch(msg) { case U8X8_MSG_DISPLAY_SETUP_MEMORY: u8x8_d_helper_display_setup_memory(u8x8, &u8x8_ls013b7dh03_128x128_display_info); break; case U8X8_MSG_DISPLAY_INIT: u8x8_d_helper_display_init(u8x8); /* clear screen */ u8x8_cad_SendCmd(u8x8, SWAP8(LS013B7DH03_CMD_ALL_CLEAR) ); u8x8_cad_SendCmd(u8x8, LS013B7DH03_VAL_TRAILER); break; case U8X8_MSG_DISPLAY_SET_POWER_SAVE: /* not available for the ls013b7dh03 */ break; case U8X8_MSG_DISPLAY_DRAW_TILE: /* each tile is 8 lines, with the data starting at the left edge */ y = ((((u8x8_tile_t *)arg_ptr)->y_pos) * 8) + 1; c = ((u8x8_tile_t *)arg_ptr)->cnt; ptr = ((u8x8_tile_t *)arg_ptr)->tile_ptr; /* send data mode byte */ u8x8_cad_StartTransfer(u8x8); u8x8_cad_SendCmd(u8x8, SWAP8(LS013B7DH03_CMD_UPDATE) ); /* send 8 lines of 16 bytes (=128 pixels) */ for( i = 0; i < 8; i++ ) { u8x8_cad_SendCmd(u8x8, SWAP8(y + i) ); u8x8_cad_SendData(u8x8, c, ptr); u8x8_cad_SendCmd(u8x8, LS013B7DH03_VAL_TRAILER); ptr += c; } /* finish with a trailing byte */ u8x8_cad_SendCmd(u8x8, LS013B7DH03_VAL_TRAILER); u8x8_cad_EndTransfer(u8x8); break; default: return 0; } return 1; }
static void OUTBSYNC(ide_drive_t *drive, u8 val, unsigned long addr) { volatile io8_t *rp; DBGIDE("%s(val=%x,addr=%lx)\n", __FUNCTION__, val, addr); rp = (volatile unsigned short *) ADDR(addr); ENABLE8(); *rp = SWAP8(val); DISABLE8(); }
static int ide_inb(unsigned int addr) { volatile unsigned short *rp, val; rp = (volatile unsigned short *) ADDR8_PTR(addr); val = *rp; #if 0 printk("ide_inb(addr=%x)=%x\n", (int) rp, (int) val); #endif return(SWAP8(addr, val)); }
static void ide_outb(unsigned int val, unsigned int addr) { volatile unsigned short *rp; rp = (volatile unsigned short *) ADDR8_PTR(addr); val = SWAP8(addr, val); #if 0 printk("ide_outb(addr=%x,val=%x)\n", (int) rp, (int)val); #endif *rp = val; }