amd7930_fn.h
上传用户:jlfgdled
上传日期:2013-04-10
资源大小:33168k
文件大小:2k
源码类别:

Linux/Unix编程

开发平台:

Unix_Linux

  1. /* 2001/10/02
  2.  *
  3.  * gerdes_amd7930.h     Header-file included by
  4.  *                      gerdes_amd7930.c
  5.  *
  6.  * Author               Christoph Ersfeld <info@formula-n.de>
  7.  *                      Formula-n Europe AG (www.formula-n.com)
  8.  *                      previously Gerdes AG
  9.  *
  10.  *
  11.  *                      This file is (c) under GNU PUBLIC LICENSE
  12.  */
  13. #define BYTE unsigned char
  14. #define WORD unsigned int
  15. #define rByteAMD(cs, reg) cs->readisac(cs, reg)
  16. #define wByteAMD(cs, reg, val) cs->writeisac(cs, reg, val)
  17. #define rWordAMD(cs, reg) ReadWordAmd7930(cs, reg)
  18. #define wWordAMD(cs, reg, val) WriteWordAmd7930(cs, reg, val)
  19. #define HIBYTE(w) ((unsigned char)((w & 0xff00) / 256))
  20. #define LOBYTE(w) ((unsigned char)(w & 0x00ff))
  21. #define AmdIrqOff(cs) cs->dc.amd7930.setIrqMask(cs, 0)
  22. #define AmdIrqOn(cs) cs->dc.amd7930.setIrqMask(cs, 1)
  23. #define AMD_CR 0x00
  24. #define AMD_DR 0x01
  25. #define DBUSY_TIMER_VALUE 80
  26. static WORD initAMD[] = {
  27. 0x0100,
  28. 0x00A5, 3, 0x01, 0x40, 0x58, // LPR, LMR1, LMR2
  29. 0x0086, 1, 0x0B, // DMR1 (D-Buffer TH-Interrupts on)
  30. 0x0087, 1, 0xFF, // DMR2
  31. 0x0092, 1, 0x03, // EFCR (extended mode d-channel-fifo on)
  32. 0x0090, 4, 0xFE, 0xFF, 0x02, 0x0F, // FRAR4, SRAR4, DMR3, DMR4 (address recognition )
  33. 0x0084, 2, 0x80, 0x00, // DRLR
  34. 0x00C0, 1, 0x47, // PPCR1
  35. 0x00C8, 1, 0x01, // PPCR2
  36. 0x0102,
  37. 0x0107,
  38. 0x01A1, 1,
  39. 0x0121, 1,
  40. 0x0189, 2,
  41. 0x0045, 4, 0x61, 0x72, 0x00, 0x00, // MCR1, MCR2, MCR3, MCR4
  42. 0x0063, 2, 0x08, 0x08, // GX
  43. 0x0064, 2, 0x08, 0x08, // GR
  44. 0x0065, 2, 0x99, 0x00, // GER
  45. 0x0066, 2, 0x7C, 0x8B, // STG
  46. 0x0067, 2, 0x00, 0x00, // FTGR1, FTGR2
  47. 0x0068, 2, 0x20, 0x20, // ATGR1, ATGR2
  48. 0x0069, 1, 0x4F, // MMR1
  49. 0x006A, 1, 0x00, // MMR2
  50. 0x006C, 1, 0x40, // MMR3
  51. 0x0021, 1, 0x02, // INIT
  52. 0x00A3, 1, 0x40, // LMR1
  53. 0xFFFF};
  54. extern void Amd7930_interrupt(struct IsdnCardState *cs, unsigned char irflags);
  55. extern void Amd7930_init(struct IsdnCardState *cs);