xtboard.h 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. #ifndef _xtboard_h_included_
  2. #define _xtboard_h_included_
  3. /*
  4. * THIS FILE IS GENERATED -- DO NOT MODIFY BY HAND
  5. *
  6. * xtboard.h -- Routines for getting useful information from the board.
  7. *
  8. * This file is subject to the terms and conditions of the GNU General Public
  9. * License. See the file "COPYING" in the main directory of this archive
  10. * for more details.
  11. *
  12. * Copyright (C) 2002 Tensilica Inc.
  13. */
  14. #include <xtensa/xt2000.h>
  15. #define XTBOARD_RTC_ERROR -1
  16. #define XTBOARD_RTC_STOPPED -2
  17. /* xt2000-i2cdev.c: */
  18. typedef void XtboardDelayFunc( unsigned );
  19. extern XtboardDelayFunc* xtboard_set_nsdelay_func( XtboardDelayFunc *delay_fn );
  20. extern int xtboard_i2c_read (unsigned id, unsigned char *buf, unsigned addr, unsigned size);
  21. extern int xtboard_i2c_write(unsigned id, unsigned char *buf, unsigned addr, unsigned size);
  22. extern int xtboard_i2c_wait_nvram_ack(unsigned id, unsigned swtimer);
  23. /* xtboard.c: */
  24. extern int xtboard_nvram_read (unsigned addr, unsigned len, unsigned char *buf);
  25. extern int xtboard_nvram_write(unsigned addr, unsigned len, unsigned char *buf);
  26. extern int xtboard_nvram_binfo_read (xt2000_nvram_binfo *buf);
  27. extern int xtboard_nvram_binfo_write(xt2000_nvram_binfo *buf);
  28. extern int xtboard_nvram_binfo_valid(xt2000_nvram_binfo *buf);
  29. extern int xtboard_ethermac_get(unsigned char *buf);
  30. extern int xtboard_ethermac_set(unsigned char *buf);
  31. /*+*----------------------------------------------------------------------------
  32. / Function: xtboard_get_rtc_time
  33. /
  34. / Description: Get time stored in real-time clock.
  35. /
  36. / Returns: time in seconds stored in real-time clock.
  37. /-**----------------------------------------------------------------------------*/
  38. extern unsigned xtboard_get_rtc_time(void);
  39. /*+*----------------------------------------------------------------------------
  40. / Function: xtboard_set_rtc_time
  41. /
  42. / Description: Set time stored in real-time clock.
  43. /
  44. / Parameters: time -- time in seconds to store to real-time clock
  45. /
  46. / Returns: 0 on success, xtboard_i2c_write() error code otherwise.
  47. /-**----------------------------------------------------------------------------*/
  48. extern int xtboard_set_rtc_time(unsigned time);
  49. /* xtfreq.c: */
  50. /*+*----------------------------------------------------------------------------
  51. / Function: xtboard_measure_sys_clk
  52. /
  53. / Description: Get frequency of system clock.
  54. /
  55. / Parameters: none
  56. /
  57. / Returns: frequency of system clock.
  58. /-**----------------------------------------------------------------------------*/
  59. extern unsigned xtboard_measure_sys_clk(void);
  60. #if 0 /* old stuff from xtboard.c: */
  61. /*+*----------------------------------------------------------------------------
  62. / Function: xtboard_nvram valid
  63. /
  64. / Description: Determines if data in NVRAM is valid.
  65. /
  66. / Parameters: delay -- 10us delay function
  67. /
  68. / Returns: 1 if NVRAM is valid, 0 otherwise
  69. /-**----------------------------------------------------------------------------*/
  70. extern unsigned xtboard_nvram_valid(void (*delay)( void ));
  71. /*+*----------------------------------------------------------------------------
  72. / Function: xtboard_get_nvram_contents
  73. /
  74. / Description: Returns contents of NVRAM.
  75. /
  76. / Parameters: buf -- buffer to NVRAM contents.
  77. / delay -- 10us delay function
  78. /
  79. / Returns: 1 if NVRAM is valid, 0 otherwise
  80. /-**----------------------------------------------------------------------------*/
  81. extern unsigned xtboard_get_nvram_contents(unsigned char *buf, void (*delay)( void ));
  82. /*+*----------------------------------------------------------------------------
  83. / Function: xtboard_get_ether_addr
  84. /
  85. / Description: Returns ethernet address of board.
  86. /
  87. / Parameters: buf -- buffer to store ethernet address
  88. / delay -- 10us delay function
  89. /
  90. / Returns: nothing.
  91. /-**----------------------------------------------------------------------------*/
  92. extern void xtboard_get_ether_addr(unsigned char *buf, void (*delay)( void ));
  93. #endif /*0*/
  94. #endif /*_xtboard_h_included_*/