q40_master.h
上传用户:lgb322
上传日期:2013-02-24
资源大小:30529k
文件大小:2k
源码类别:

嵌入式Linux

开发平台:

Unix_Linux

  1. /* 
  2.  * Q40 master Chip Control 
  3.  * RTC stuff merged for compactnes..
  4. */
  5. #ifndef _Q40_MASTER_H
  6. #define _Q40_MASTER_H
  7. #include <asm/raw_io.h>
  8. #define q40_master_addr 0xff000000
  9. #define q40_rtc_addr    0xff021ffc
  10. #define IIRQ_REG            0x0       /* internal IRQ reg */
  11. #define EIRQ_REG            0x4       /* external ... */
  12. #define KEYCODE_REG         0x1c      /* value of received scancode  */
  13. #define DISPLAY_CONTROL_REG 0x18
  14. #define FRAME_CLEAR_REG     0x24
  15. #define LED_REG             0x30
  16. #define Q40_LED_ON()        master_outb(1,LED_REG)
  17. #define Q40_LED_OFF()       master_outb(0,LED_REG)
  18. #define INTERRUPT_REG       IIRQ_REG  /* "native" ints */
  19. #define KEY_IRQ_ENABLE_REG  0x08      /**/
  20. #define KEYBOARD_UNLOCK_REG 0x20      /* clear kb int */
  21. #define SAMPLE_ENABLE_REG   0x14      /* generate SAMPLE ints */
  22. #define SAMPLE_RATE_REG     0x2c
  23. #define SAMPLE_CLEAR_REG    0x28
  24. #define SAMPLE_LOW          0x00
  25. #define SAMPLE_HIGH         0x01
  26. #define FRAME_RATE_REG       0x38      /* generate FRAME ints at 200 HZ rate */
  27. #if 0
  28. #define SER_ENABLE_REG      0x0c      /* allow serial ints to be generated */
  29. #endif
  30. #define EXT_ENABLE_REG      0x10      /* ... rest of the ISA ints ... */
  31. #define master_inb(_reg_)      in_8((unsigned char *)q40_master_addr+_reg_)
  32. #define master_outb(_b_,_reg_)  out_8((unsigned char *)q40_master_addr+_reg_,_b_)
  33. /* define some Q40 specific ints */
  34. #include "q40ints.h"
  35. /* RTC defines */
  36. #define Q40_RTC_BASE (q40_rtc_addr)
  37. #define RTC_YEAR        (*(unsigned char *)(Q40_RTC_BASE+0))
  38. #define RTC_MNTH        (*(unsigned char *)(Q40_RTC_BASE-4))
  39. #define RTC_DATE        (*(unsigned char *)(Q40_RTC_BASE-8))
  40. #define RTC_DOW         (*(unsigned char *)(Q40_RTC_BASE-12))
  41. #define RTC_HOUR        (*(unsigned char *)(Q40_RTC_BASE-16))
  42. #define RTC_MINS        (*(unsigned char *)(Q40_RTC_BASE-20))
  43. #define RTC_SECS        (*(unsigned char *)(Q40_RTC_BASE-24))
  44. #define RTC_CTRL        (*(unsigned char *)(Q40_RTC_BASE-28))
  45. /* some control bits */
  46. #define RTC_READ   64  /* prepare for reading */
  47. #define RTC_WRITE  128
  48. /* misc defs */
  49. #define DAC_LEFT  ((unsigned char *)0xff008000)
  50. #define DAC_RIGHT ((unsigned char *)0xff008004)
  51. #endif /* _Q40_MASTER_H */