ZuluSCSI_platform_gpio.h 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. /**
  2. * ZuluSCSI™ - Copyright (c) 2022 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. // GPIO definitions for ZuluSCSI RP2040-based hardware
  22. #pragma once
  23. #include <hardware/gpio.h>
  24. // SCSI data input/output port.
  25. // The data bus uses external bidirectional buffer, with
  26. // direction controlled by DATA_DIR pin.
  27. #define SCSI_IO_DB0 0
  28. #define SCSI_IO_DB1 1
  29. #define SCSI_IO_DB2 2
  30. #define SCSI_IO_DB3 3
  31. #define SCSI_IO_DB4 4
  32. #define SCSI_IO_DB5 5
  33. #define SCSI_IO_DB6 6
  34. #define SCSI_IO_DB7 7
  35. #define SCSI_IO_DBP 8
  36. #define SCSI_IO_DATA_MASK 0x1FF
  37. #define SCSI_IO_SHIFT 0
  38. // Data direction control
  39. #define SCSI_DATA_DIR 9
  40. // SCSI output status lines
  41. #define SCSI_OUT_IO 22
  42. #define SCSI_OUT_CD 18
  43. #define SCSI_OUT_MSG 20
  44. #define SCSI_OUT_RST 22
  45. #define SCSI_OUT_BSY 27
  46. #define SCSI_OUT_REQ 17
  47. #define SCSI_OUT_SEL 19
  48. // SCSI input status signals
  49. #define SCSI_IN_SEL 18
  50. #define SCSI_IN_ACK 26
  51. #define SCSI_IN_ATN 28
  52. #define SCSI_IN_BSY 20
  53. #define SCSI_IN_RST 21
  54. // Status LED pins
  55. #define LED_PIN 25
  56. #define LED_ON() sio_hw->gpio_set = 1 << LED_PIN
  57. #define LED_OFF() sio_hw->gpio_clr = 1 << LED_PIN
  58. // SD card pins in SDIO mode
  59. #define SDIO_CLK 10
  60. #define SDIO_CMD 11
  61. #define SDIO_D0 12
  62. #define SDIO_D1 13
  63. #define SDIO_D2 14
  64. #define SDIO_D3 15
  65. // SD card pins in SPI mode
  66. #define SD_SPI spi0
  67. #define SD_SPI_SCK 10
  68. #define SD_SPI_MOSI 11
  69. #define SD_SPI_MISO 12
  70. #define SD_SPI_CS 15
  71. // Other pins
  72. #define SWO_PIN 16