OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [branches/] [stable_0_2_x/] [or1ksim/] [peripheral/] [ps2kbd.c] - Diff between revs 1486 and 1557

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 1486 Rev 1557
Line 129... Line 129...
  /* Break shift? */
  /* Break shift? */
  if (scan_table[c].shift) kbd_put (kbd, 0xaa);
  if (scan_table[c].shift) kbd_put (kbd, 0xaa);
}
}
 
 
/* Write a register */
/* Write a register */
void kbd_write8 (oraddr_t addr, uint32_t value, void *dat)
void kbd_write8 (oraddr_t addr, uint8_t value, void *dat)
{
{
  struct kbd_state *kbd = dat;
  struct kbd_state *kbd = dat;
  switch (addr) {
  switch (addr) {
    case KBD_CTRL:
    case KBD_CTRL:
      kbd->ccmd = value & 0xff;
      kbd->ccmd = value & 0xff;
Line 170... Line 170...
      break;
      break;
  }
  }
}
}
 
 
/* Read a register */
/* Read a register */
uint32_t kbd_read8 (oraddr_t addr, void *dat)
uint8_t kbd_read8 (oraddr_t addr, void *dat)
{
{
  struct kbd_state *kbd = dat;
  struct kbd_state *kbd = dat;
  switch (addr) {
  switch (addr) {
    case KBD_CTRL: {
    case KBD_CTRL: {
      unsigned long c = 0x0;
      unsigned long c = 0x0;
Line 186... Line 186...
        PRINTF("kbd_read8(%"PRIxADDR") %lx\n", addr, c);
        PRINTF("kbd_read8(%"PRIxADDR") %lx\n", addr, c);
      return c;
      return c;
    }
    }
    case KBD_DATA:
    case KBD_DATA:
      if (kbd->ccmd) {
      if (kbd->ccmd) {
        unsigned long rc;
        unsigned long rc = 0;
        if (kbd->ccmd == KBD_CCMD_RCB)
        if (kbd->ccmd == KBD_CCMD_RCB)
          rc = kbd->ccmdbyte;
          rc = kbd->ccmdbyte;
        if (kbd->ccmd == KBD_CCMD_ST1)
        if (kbd->ccmd == KBD_CCMD_ST1)
          rc = 0x55;
          rc = 0x55;
        if (kbd->ccmd == KBD_CCMD_ST2)
        if (kbd->ccmd == KBD_CCMD_ST2)

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.