srom.h 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. /*
  2. * Copyright (c) 1996, 2003 VIA Networking Technologies, Inc.
  3. * All rights reserved.
  4. *
  5. * This program is free software; you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License as published by
  7. * the Free Software Foundation; either version 2 of the License, or
  8. * (at your option) any later version.
  9. *
  10. * This program is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU General Public License along
  16. * with this program; if not, write to the Free Software Foundation, Inc.,
  17. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  18. *
  19. *
  20. * File: srom.h
  21. *
  22. * Purpose: Implement functions to access eeprom
  23. *
  24. * Author: Jerry Chen
  25. *
  26. * Date: Jan 29, 2003
  27. *
  28. */
  29. #ifndef __SROM_H__
  30. #define __SROM_H__
  31. #include "ttype.h"
  32. /*--------------------- Export Definitions -------------------------*/
  33. #define EEP_MAX_CONTEXT_SIZE 256
  34. #define CB_EEPROM_READBYTE_WAIT 900 //us
  35. #define W_MAX_I2CRETRY 0x0fff
  36. //
  37. // Contents in the EEPROM
  38. //
  39. #define EEP_OFS_PAR 0x00 // physical address
  40. #define EEP_OFS_ANTENNA 0x17
  41. #define EEP_OFS_RADIOCTL 0x18
  42. #define EEP_OFS_RFTYPE 0x1B // for select RF
  43. #define EEP_OFS_MINCHANNEL 0x1C // Min Channel #
  44. #define EEP_OFS_MAXCHANNEL 0x1D // Max Channel #
  45. #define EEP_OFS_SIGNATURE 0x1E //
  46. #define EEP_OFS_ZONETYPE 0x1F //
  47. #define EEP_OFS_RFTABLE 0x20 // RF POWER TABLE
  48. #define EEP_OFS_PWR_CCK 0x20
  49. #define EEP_OFS_SETPT_CCK 0x21
  50. #define EEP_OFS_PWR_OFDMG 0x23
  51. #define EEP_OFS_CALIB_TX_IQ 0x24
  52. #define EEP_OFS_CALIB_TX_DC 0x25
  53. #define EEP_OFS_CALIB_RX_IQ 0x26
  54. #define EEP_OFS_MAJOR_VER 0x2E
  55. #define EEP_OFS_MINOR_VER 0x2F
  56. #define EEP_OFS_CCK_PWR_TBL 0x30
  57. #define EEP_OFS_OFDM_PWR_TBL 0x40
  58. #define EEP_OFS_OFDMA_PWR_TBL 0x50
  59. //
  60. // Bits in EEP_OFS_ANTENNA
  61. //
  62. #define EEP_ANTENNA_MAIN 0x01
  63. #define EEP_ANTENNA_AUX 0x02
  64. #define EEP_ANTINV 0x04
  65. //
  66. // Bits in EEP_OFS_RADIOCTL
  67. //
  68. #define EEP_RADIOCTL_ENABLE 0x80
  69. /*--------------------- Export Types ------------------------------*/
  70. // AT24C02 eeprom contents
  71. // 2048 bits = 256 bytes = 128 words
  72. //
  73. typedef struct tagSSromReg {
  74. BYTE abyPAR[6]; // 0x00 (WORD)
  75. WORD wSUB_VID; // 0x03 (WORD)
  76. WORD wSUB_SID;
  77. BYTE byBCFG0; // 0x05 (WORD)
  78. BYTE byBCFG1;
  79. BYTE byFCR0; // 0x06 (WORD)
  80. BYTE byFCR1;
  81. BYTE byPMC0; // 0x07 (WORD)
  82. BYTE byPMC1;
  83. BYTE byMAXLAT; // 0x08 (WORD)
  84. BYTE byMINGNT;
  85. BYTE byCFG0; // 0x09 (WORD)
  86. BYTE byCFG1;
  87. WORD wCISPTR; // 0x0A (WORD)
  88. WORD wRsv0; // 0x0B (WORD)
  89. WORD wRsv1; // 0x0C (WORD)
  90. BYTE byBBPAIR; // 0x0D (WORD)
  91. BYTE byRFTYPE;
  92. BYTE byMinChannel; // 0x0E (WORD)
  93. BYTE byMaxChannel;
  94. BYTE bySignature; // 0x0F (WORD)
  95. BYTE byCheckSum;
  96. BYTE abyReserved0[96]; // 0x10 (WORD)
  97. BYTE abyCIS[128]; // 0x80 (WORD)
  98. } SSromReg, *PSSromReg;
  99. /*--------------------- Export Macros ------------------------------*/
  100. /*--------------------- Export Classes ----------------------------*/
  101. /*--------------------- Export Variables --------------------------*/
  102. /*--------------------- Export Functions --------------------------*/
  103. #endif /* __EEPROM_H__ */