Subversion Repositories pentevo

Rev

Blame | Last modification | View Log | Download | RSS feed | ?url?

  1. #ifndef PINS_H
  2. #define PINS_H
  3.  
  4. /**
  5.  * @file
  6.  * @brief ATMEGA128 pins definition.
  7.  * @author http://www.nedopc.com
  8.  *
  9.  * ATMEGA128 pins definition:
  10.  * - define PIN number;
  11.  * - define PORT register;
  12.  * - define input PINs register;
  13.  * - define Data Direction Register.
  14.  */
  15.  
  16. /** nCONFIG fpga pin number. */
  17. #define nCONFIG      PF0
  18. /** nCONFIG fpga port register. */
  19. #define nCONFIG_PORT PORTF
  20. /** nCONFIG fpga pins register. */
  21. #define nCONFIG_PIN  PINF
  22. /** nCONFIG fpga direction register. */
  23. #define nCONFIG_DDR  DDRF
  24.  
  25. /** nSTATUS fpga pin number. */
  26. #define nSTATUS      PF1
  27. /** nSTATUS fpga port register. */
  28. #define nSTATUS_PORT PORTF
  29. /** nSTATUS fpga pins register. */
  30. #define nSTATUS_PIN  PINF
  31. /** nSTATUS fpga direction register. */
  32. #define nSTATUS_DDR  DDRF
  33.  
  34. /** CONF_DONE (configuration done) fpga pin number. */
  35. #define CONF_DONE PF2
  36. /** CONF_DONE (configuration done) fpga port register. */
  37. #define CONF_DONE_PORT PORTF
  38. /** CONF_DONE (configuration done) fpga pins register. */
  39. #define CONF_DONE_PIN  PINF
  40. /** CONF_DONE (configuration done) fpga direction register. */
  41. #define CONF_DONE_DDR  DDRF
  42.  
  43. /** LED indicator pin number. */
  44. #define LED      PB7
  45. /** LED indicator port register. */
  46. #define LED_PORT PORTB
  47. /** LED indicator pins register. */
  48. #define LED_PIN  PINB
  49. /** LED indicator direction register. */
  50. #define LED_DDR  DDRB
  51.  
  52. /** PS2 keyboard clock pin number. */
  53. #define PS2KBCLK PE4
  54. /** PS2 keyboard clock port register. */
  55. #define PS2KBCLK_PORT PORTE
  56. /** PS2 keyboard clock pins register. */
  57. #define PS2KBCLK_PIN  PINE
  58. /** PS2 keyboard clock direction register. */
  59. #define PS2KBCLK_DDR  DDRE
  60.  
  61. /** PS2 keyboard data pin number. */
  62. #define PS2KBDAT PD6
  63. /** PS2 keyboard data port register. */
  64. #define PS2KBDAT_PORT PORTD
  65. /** PS2 keyboard data pins register. */
  66. #define PS2KBDAT_PIN  PIND
  67. /** PS2 keyboard data direction register. */
  68. #define PS2KBDAT_DDR  DDRD
  69.  
  70. /** PS2 mouse clock pin number. */
  71. #define PS2MSCLK PE5
  72. /** PS2 mouse clock port register. */
  73. #define PS2MSCLK_PORT PORTE
  74. /** PS2 mouse clock pins register. */
  75. #define PS2MSCLK_PIN  PINE
  76. /** PS2 mouse clock direction register. */
  77. #define PS2MSCLK_DDR  DDRE
  78.  
  79. /** PS2 mouse data pin number. */
  80. #define PS2MSDAT PD7
  81. /** PS2 mouse data port register. */
  82. #define PS2MSDAT_PORT PORTD
  83. /** PS2 mouse data pins register. */
  84. #define PS2MSDAT_PIN  PIND
  85. /** PS2 mouse data direction register. */
  86. #define PS2MSDAT_DDR  DDRD
  87.  
  88. /** RS232 TXD pin number. */
  89. #define RS232TXD PD3
  90. /** RS232 TXD port register. */
  91. #define RS232TXD_PORT PORTD
  92. /** RS232 TXD pins register. */
  93. #define RS232TXD_PIN  PIND
  94. /** RS232 TXD direction register. */
  95. #define RS232TXD_DDR  DDRD
  96.  
  97. /** Tape in pin number. */
  98. #define TAPEIN PD4
  99. /** Tape port register. */
  100. #define TAPEIN_PORT PORTD
  101. /** Tape pins register. */
  102. #define TAPEIN_PIN  PIND
  103. /** Tape direction register. */
  104. #define TAPEIN_DDR  DDRD
  105.  
  106. /** nSPICS fpga pin number. */
  107. #define nSPICS      PB0
  108. /** nSPICS fpga port register. */
  109. #define nSPICS_PORT PORTB
  110. /** nSPICS fpga pins register. */
  111. #define nSPICS_PIN  PINB
  112. /** nSPICS fpga direction register. */
  113. #define nSPICS_DDR  DDRB
  114.  
  115. /** ATX POWER ON pin number. */
  116. #define ATXPWRON      PF3
  117. /** ATX POWER ON port register. */
  118. #define ATXPWRON_PORT PORTF
  119. /** ATX POWER ON pins register. */
  120. #define ATXPWRON_PIN  PINF
  121. /** ATX POWER ON direction register. */
  122. #define ATXPWRON_DDR  DDRF
  123.  
  124. /** SOFT RESET pin number. */
  125. #define SOFTRES      PC7
  126. /** SOFT RESET port register. */
  127. #define SOFTRES_PORT PORTC
  128. /** SOFT RESET pins register. */
  129. #define SOFTRES_PIN  PINC
  130. /** SOFT RESET direction register. */
  131. #define SOFTRES_DDR  DDRC
  132.  
  133. /** NMI pin number*/
  134. #define NMI          PC6
  135. /** NMI port register. */
  136. #define NMI_PORT     PORTC
  137. /** NMI pins register. */
  138. #define NMI_PIN  PINC
  139. /** NMI direction register. */
  140. #define NMI_DDR  DDRC
  141.  
  142. /** JOYSTICK RIGHT pin number. */
  143. #define JOYSTICK_RIGHT PG0
  144. /** JOYSTICK LEFT pin number. */
  145. #define JOYSTICK_LEFT  PG1
  146. /** JOYSTICK DOWN pin number. */
  147. #define JOYSTICK_DOWN  PG2
  148. /** JOYSTICK UP pin number. */
  149. #define JOYSTICK_UP    PG3
  150. /** JOYSTICK FIRE pin number. */
  151. #define JOYSTICK_FIRE  PG4
  152. /** JOYSTICK pins mask. */
  153. #define JOYSTICK_MASK  ((1<<JOYSTICK_RIGHT)|(1<<JOYSTICK_LEFT)|(1<<JOYSTICK_UP)|(1<<JOYSTICK_DOWN)|(1<<JOYSTICK_FIRE))
  154. /** JOYSTICK port register. */
  155. #define JOYSTICK_PORT  PORTG
  156. /** JOYSTICK pins register. */
  157. #define JOYSTICK_PIN   PING
  158. /** JOYSTICK direction register. */
  159. #define JOYSTICK_DDR   DDRC
  160.  
  161. /** RS232 CTS pin number. */
  162. #define RS232CTS PB6
  163. /** RS232 CTS port register. */
  164. #define RS232CTS_PORT PORTB
  165. /** RS232 CTS pins register. */
  166. #define RS232CTS_PIN  PINB
  167. /** RS232 CTS direction register. */
  168. #define RS232CTS_DDR  DDRB
  169.  
  170. /** RS232 RTS pin number. */
  171. #define RS232RTS PD5
  172. /** RS232 RTS port register. */
  173. #define RS232RTS_PORT PORTD
  174. /** RS232 RTS pins register. */
  175. #define RS232RTS_PIN  PIND
  176. /** RS232 RTS direction register. */
  177. #define RS232RTS_DDR  DDRD
  178.  
  179. /** SD write protection detect pin number. */
  180. #define SDWRP       PB4
  181. /** SD card detect pin number. */
  182. #define SDDET       PB5
  183. /** SD port register. */
  184. #define SD_PORT PORTB
  185. /** SD pins register. */
  186. #define SD_PIN  PINB
  187. /** SD detect direction register. */
  188. #define SD_DDR  DDRB
  189.  
  190. #endif
  191.  
  192.