avrpio.h 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187
  1. #ifndef _CFG_ARCH_AVRPIO_H_
  2. #define _CFG_ARCH_AVRPIO_H_
  3. /*
  4. * Copyright (C) 2004 by egnite Software GmbH. All rights reserved.
  5. *
  6. * Redistribution and use in source and binary forms, with or without
  7. * modification, are permitted provided that the following conditions
  8. * are met:
  9. *
  10. * 1. Redistributions of source code must retain the above copyright
  11. * notice, this list of conditions and the following disclaimer.
  12. * 2. Redistributions in binary form must reproduce the above copyright
  13. * notice, this list of conditions and the following disclaimer in the
  14. * documentation and/or other materials provided with the distribution.
  15. * 3. Neither the name of the copyright holders nor the names of
  16. * contributors may be used to endorse or promote products derived
  17. * from this software without specific prior written permission.
  18. *
  19. * THIS SOFTWARE IS PROVIDED BY EGNITE SOFTWARE GMBH AND CONTRIBUTORS
  20. * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  21. * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
  22. * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL EGNITE
  23. * SOFTWARE GMBH OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
  24. * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
  25. * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
  26. * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
  27. * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  28. * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
  29. * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  30. * SUCH DAMAGE.
  31. *
  32. * For additional information see http://www.ethernut.de/
  33. *
  34. */
  35. /*
  36. * $Log: avrpio.h,v $
  37. * Revision 1.3 2005/07/26 16:06:20 haraldkipp
  38. * Added missing SPIDIGIO registers.
  39. *
  40. * Revision 1.2 2005/02/02 20:06:37 haraldkipp
  41. * This file will now contain the AVR port definitions, which were
  42. * previously specified in avr.h. This file will be included by avr.h,
  43. * so existing code should continue to run without change.
  44. *
  45. * Revision 1.1 2004/08/25 10:58:02 haraldkipp
  46. * New include directory cfg/arch added, which is used for target specific items,
  47. * mainly port usage or MCU specific register settings.
  48. *
  49. */
  50. /*!
  51. * \file cfg/arch/avrpio.h
  52. * \brief AVR port configuration.
  53. *
  54. * This file collects all port specifications for the AVR platform and
  55. * provides an overview of hardware resources in use.
  56. *
  57. * Values are geared to the Ethernut reference design and can be changed
  58. * by the Configurator. This program creates a file with the same name
  59. * in the build tree, which replaces this placeholder.
  60. */
  61. /*!
  62. * \brief USART settings.
  63. */
  64. //#define UART0_RTS_BIT 2
  65. //#define UART0_CTS_IRQ INT7
  66. #ifdef UART0_RTS_BIT
  67. #ifndef UART0_RTS_AVRPORT
  68. #define UART0_RTS_AVRPORT AVRPORTE
  69. #endif
  70. #endif /* UART0_RTS_BIT */
  71. //#define UART1_RTS_BIT 2
  72. //#define UART1_CTS_IRQ INT7
  73. #ifdef UART1_RTS_BIT
  74. #ifndef UART1_RTS_AVRPORT
  75. #define UART1_RTS_AVRPORT AVRPORTE
  76. #endif
  77. #endif /* UART1_RTS_BIT */
  78. /*!
  79. * \brief Settings for the Realtek RTL8019AS.
  80. */
  81. #ifndef RTL_BASE_ADDR
  82. /*!
  83. * \brief Memory mapped base address.
  84. */
  85. #define RTL_BASE_ADDR 0x8300
  86. #endif
  87. #ifndef RTL_SIGNAL_IRQ
  88. /*!
  89. * \brief Interrupt used by the controller.
  90. */
  91. #define RTL_SIGNAL_IRQ INT5
  92. #endif
  93. #ifndef RTL_EESK_BIT
  94. /*!
  95. * \brief Clock input for EEPROM emulation.
  96. *
  97. * This is enabled by default, but the driver will run a check before
  98. * jumping into the emulation.
  99. */
  100. #define RTL_EESK_BIT 5
  101. #endif
  102. #ifndef RTL_EESK_AVRPORT
  103. #define RTL_EESK_AVRPORT AVRPORTC
  104. #endif
  105. #ifndef RTL_EEDO_BIT
  106. #define RTL_EEDO_BIT 6
  107. #endif
  108. #ifndef RTL_EEDO_AVRPORT
  109. #define RTL_EEDO_AVRPORT AVRPORTC
  110. #endif
  111. #ifndef RTL_EEMU_BIT
  112. #define RTL_EEMU_BIT 7
  113. #endif
  114. #ifndef RTL_EEMU_AVRPORT
  115. #define RTL_EEMU_AVRPORT AVRPORTC
  116. #endif
  117. /*!
  118. * \brief Port usage of digital I/O shift register.
  119. */
  120. #ifndef SPIDIGIO_SOUT_BIT
  121. #define SPIDIGIO_SOUT_BIT 5
  122. #endif
  123. #ifndef SPIDIGIO_SOUT_AVRPORT
  124. #define SPIDIGIO_SOUT_AVRPORT AVRPORTD
  125. #endif
  126. #ifndef SPIDIGIO_SIN_BIT
  127. #define SPIDIGIO_SIN_BIT 6
  128. #endif
  129. #ifndef SPIDIGIO_SIN_PIN
  130. #define SPIDIGIO_SIN_PIN PIND
  131. #endif
  132. #ifndef SPIDIGIO_SIN_PORT
  133. #define SPIDIGIO_SIN_PORT PORTD
  134. #endif
  135. #ifndef SPIDIGIO_SIN_DDR
  136. #define SPIDIGIO_SIN_DDR DDRD
  137. #endif
  138. #ifndef SPIDIGIO_SCLK_BIT
  139. #define SPIDIGIO_SCLK_BIT 7
  140. #endif
  141. #ifndef SPIDIGIO_SCLK_AVRPORT
  142. #define SPIDIGIO_SCLK_AVRPORT AVRPORTD
  143. #endif
  144. #ifndef SPIDIGIO_LDI_BIT
  145. #define SPIDIGIO_LDI_BIT 7
  146. #endif
  147. #ifndef SPIDIGIO_LDI_AVRPORT
  148. #define SPIDIGIO_LDI_AVRPORT AVRPORTB
  149. #endif
  150. #ifndef SPIDIGIO_LDO_BIT
  151. #define SPIDIGIO_LDO_BIT 5
  152. #endif
  153. #ifndef SPIDIGIO_LDO_AVRPORT
  154. #define SPIDIGIO_LDO_AVRPORT AVRPORTB
  155. #endif
  156. #endif