board.h 3.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. /**
  2. * \file board.h
  3. *
  4. * \brief This file contains the prototypes of the functions present in
  5. * utils/board.c .It also has structure declaration
  6. * which is used to interpret the data read from EEPROM.
  7. *
  8. */
  9. /*
  10. * Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com/
  11. */
  12. /*
  13. * Redistribution and use in source and binary forms, with or without
  14. * modification, are permitted provided that the following conditions
  15. * are met:
  16. *
  17. * Redistributions of source code must retain the above copyright
  18. * notice, this list of conditions and the following disclaimer.
  19. *
  20. * Redistributions in binary form must reproduce the above copyright
  21. * notice, this list of conditions and the following disclaimer in the
  22. * documentation and/or other materials provided with the
  23. * distribution.
  24. *
  25. * Neither the name of Texas Instruments Incorporated nor the names of
  26. * its contributors may be used to endorse or promote products derived
  27. * from this software without specific prior written permission.
  28. *
  29. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  30. * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  31. * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  32. * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  33. * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  34. * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  35. * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  36. * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  37. * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  38. * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  39. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  40. *
  41. */
  42. #ifndef _BOARD_H_
  43. #define _BOARD_H_
  44. #ifdef __cplusplus
  45. extern "C" {
  46. #endif
  47. /****************************************************************************
  48. ** MACRO DEFINITIONS
  49. ****************************************************************************/
  50. #define EEPROM_SIZE_HEADER (4)
  51. #define EEPROM_SIZE_BOARD_NAME (8)
  52. #define EEPROM_SIZE_VERSION (5)
  53. #define EEPROM_SIZE_SERIAL_NUMBER (12)
  54. #define MAX_DATA (EEPROM_SIZE_HEADER + \
  55. EEPROM_SIZE_BOARD_NAME + \
  56. EEPROM_SIZE_VERSION + \
  57. EEPROM_SIZE_SERIAL_NUMBER)
  58. #define EVM_1_5A_VERSION "1.5A"
  59. /****************************************************************************
  60. ** STRUCTURE DECLARATION
  61. ****************************************************************************/
  62. struct EEPROMData {
  63. unsigned char header[EEPROM_SIZE_HEADER];
  64. unsigned char boardName[EEPROM_SIZE_BOARD_NAME];
  65. unsigned char version[EEPROM_SIZE_VERSION];
  66. unsigned char serialNumber[EEPROM_SIZE_SERIAL_NUMBER];
  67. };
  68. typedef struct EEPROMData BOARDINFO;
  69. extern unsigned char boardVersion[];
  70. extern unsigned char boardId[];
  71. /****************************************************************************
  72. ** FUNCTION PROTOTYPES
  73. ****************************************************************************/
  74. extern unsigned char *BoardIdGet(void);
  75. extern void BoardInfoRead(unsigned char *);
  76. extern unsigned char *BoardVersionGet(void);
  77. #ifdef __cplusplus
  78. }
  79. #endif
  80. #endif