ZuluSCSI_platform_gpio.h 3.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. /**
  2. * ZuluSCSI™ - Copyright (c) 2022-2025 Rabbit Hole Computing™
  3. *
  4. * ZuluSCSI™ firmware is licensed under the GPL version 3 or any later version. 
  5. *
  6. * https://www.gnu.org/licenses/gpl-3.0.html
  7. * ----
  8. * This program is free software: you can redistribute it and/or modify
  9. * it under the terms of the GNU General Public License as published by
  10. * the Free Software Foundation, either version 3 of the License, or
  11. * (at your option) any later version. 
  12. *
  13. * This program is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  16. * GNU General Public License for more details. 
  17. *
  18. * You should have received a copy of the GNU General Public License
  19. * along with this program.  If not, see <https://www.gnu.org/licenses/>.
  20. **/
  21. // Example GPIO definitions for ZuluSCSI platform
  22. #pragma once
  23. // SCSI data output port.
  24. // The output data is written using BSRR mechanism, so all data pins must be on same GPIO port.
  25. // The output pins are open-drain in hardware, using separate buffer chips for driving.
  26. #define SCSI_OUT_PORT GPIOD
  27. #define SCSI_OUT_DB0 GPIO_PIN_0
  28. #define SCSI_OUT_DB1 GPIO_PIN_1
  29. #define SCSI_OUT_DB2 GPIO_PIN_2
  30. #define SCSI_OUT_DB3 GPIO_PIN_3
  31. #define SCSI_OUT_DB4 GPIO_PIN_4
  32. #define SCSI_OUT_DB5 GPIO_PIN_5
  33. #define SCSI_OUT_DB6 GPIO_PIN_6
  34. #define SCSI_OUT_DB7 GPIO_PIN_7
  35. #define SCSI_OUT_DBP GPIO_PIN_8
  36. #define SCSI_OUT_REQ GPIO_PIN_9
  37. #define SCSI_OUT_DATA_MASK (SCSI_OUT_DB0 | SCSI_OUT_DB1 | SCSI_OUT_DB2 | SCSI_OUT_DB3 | SCSI_OUT_DB4 | SCSI_OUT_DB5 | SCSI_OUT_DB6 | SCSI_OUT_DB7 | SCSI_OUT_DBP)
  38. // SCSI input data port (can be same as output port)
  39. #define SCSI_IN_PORT GPIOE
  40. #define SCSI_IN_DB0 GPIO_PIN_0
  41. #define SCSI_IN_DB1 GPIO_PIN_1
  42. #define SCSI_IN_DB2 GPIO_PIN_2
  43. #define SCSI_IN_DB3 GPIO_PIN_3
  44. #define SCSI_IN_DB4 GPIO_PIN_4
  45. #define SCSI_IN_DB5 GPIO_PIN_5
  46. #define SCSI_IN_DB6 GPIO_PIN_6
  47. #define SCSI_IN_DB7 GPIO_PIN_7
  48. #define SCSI_IN_DBP GPIO_PIN_8
  49. #define SCSI_IN_MASK (SCSI_IN_DB7|SCSI_IN_DB6|SCSI_IN_DB5|SCSI_IN_DB4|SCSI_IN_DB3|SCSI_IN_DB2|SCSI_IN_DB1|SCSI_IN_DB0|SCSI_IN_DBP)
  50. #define SCSI_IN_SHIFT 8
  51. // SCSI output status lines
  52. #define SCSI_OUT_IO_PORT GPIOD
  53. #define SCSI_OUT_IO_PIN GPIO_PIN_10
  54. #define SCSI_OUT_CD_PORT GPIOD
  55. #define SCSI_OUT_CD_PIN GPIO_PIN_11
  56. #define SCSI_OUT_SEL_PORT GPIOD
  57. #define SCSI_OUT_SEL_PIN GPIO_PIN_12
  58. #define SCSI_OUT_MSG_PORT GPIOD
  59. #define SCSI_OUT_MSG_PIN GPIO_PIN_13
  60. #define SCSI_OUT_RST_PORT GPIOD
  61. #define SCSI_OUT_RST_PIN GPIO_PIN_14
  62. #define SCSI_OUT_BSY_PORT GPIOD
  63. #define SCSI_OUT_BSY_PIN GPIO_PIN_15
  64. #define SCSI_OUT_REQ_PORT SCSI_OUT_PORT
  65. #define SCSI_OUT_REQ_PIN SCSI_OUT_REQ
  66. // SCSI input status signals (can be same as output port)
  67. #define SCSI_SEL_PORT GPIOD
  68. #define SCSI_SEL_PIN GPIO_PIN_12
  69. #define SCSI_ACK_PORT GPIOE
  70. #define SCSI_ACK_PIN GPIO_PIN_0
  71. #define SCSI_ATN_PORT GPIOE
  72. #define SCSI_ATN_PIN GPIO_PIN_1
  73. #define SCSI_BSY_PORT GPIOE
  74. #define SCSI_BSY_PIN GPIO_PIN_2
  75. #define SCSI_RST_PORT GPIOE
  76. #define SCSI_RST_PIN GPIO_PIN_3
  77. // Status LED pins
  78. #define LED_PORT GPIOE
  79. #define LED_PIN GPIO_PIN_4
  80. #define LED_ON() LED_PORT->BSRR = LED_PIN
  81. #define LED_OFF() LED_PORT->BRR = LED_PIN