BlueSCSI_platform_gpio.h 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. // Example GPIO definitions for BlueSCSI platform
  2. #pragma once
  3. // SCSI data output port.
  4. // The output data is written using BSRR mechanism, so all data pins must be on same GPIO port.
  5. // The output pins are open-drain in hardware, using separate buffer chips for driving.
  6. #define SCSI_OUT_PORT GPIOD
  7. #define SCSI_OUT_DB0 GPIO_PIN_0
  8. #define SCSI_OUT_DB1 GPIO_PIN_1
  9. #define SCSI_OUT_DB2 GPIO_PIN_2
  10. #define SCSI_OUT_DB3 GPIO_PIN_3
  11. #define SCSI_OUT_DB4 GPIO_PIN_4
  12. #define SCSI_OUT_DB5 GPIO_PIN_5
  13. #define SCSI_OUT_DB6 GPIO_PIN_6
  14. #define SCSI_OUT_DB7 GPIO_PIN_7
  15. #define SCSI_OUT_DBP GPIO_PIN_8
  16. #define SCSI_OUT_REQ GPIO_PIN_9
  17. #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)
  18. // SCSI input data port (can be same as output port)
  19. #define SCSI_IN_PORT GPIOE
  20. #define SCSI_IN_DB0 GPIO_PIN_0
  21. #define SCSI_IN_DB1 GPIO_PIN_1
  22. #define SCSI_IN_DB2 GPIO_PIN_2
  23. #define SCSI_IN_DB3 GPIO_PIN_3
  24. #define SCSI_IN_DB4 GPIO_PIN_4
  25. #define SCSI_IN_DB5 GPIO_PIN_5
  26. #define SCSI_IN_DB6 GPIO_PIN_6
  27. #define SCSI_IN_DB7 GPIO_PIN_7
  28. #define SCSI_IN_DBP GPIO_PIN_8
  29. #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)
  30. #define SCSI_IN_SHIFT 8
  31. // SCSI output status lines
  32. #define SCSI_OUT_IO_PORT GPIOD
  33. #define SCSI_OUT_IO_PIN GPIO_PIN_10
  34. #define SCSI_OUT_CD_PORT GPIOD
  35. #define SCSI_OUT_CD_PIN GPIO_PIN_11
  36. #define SCSI_OUT_SEL_PORT GPIOD
  37. #define SCSI_OUT_SEL_PIN GPIO_PIN_12
  38. #define SCSI_OUT_MSG_PORT GPIOD
  39. #define SCSI_OUT_MSG_PIN GPIO_PIN_13
  40. #define SCSI_OUT_RST_PORT GPIOD
  41. #define SCSI_OUT_RST_PIN GPIO_PIN_14
  42. #define SCSI_OUT_BSY_PORT GPIOD
  43. #define SCSI_OUT_BSY_PIN GPIO_PIN_15
  44. #define SCSI_OUT_REQ_PORT SCSI_OUT_PORT
  45. #define SCSI_OUT_REQ_PIN SCSI_OUT_REQ
  46. // SCSI input status signals (can be same as output port)
  47. #define SCSI_SEL_PORT GPIOD
  48. #define SCSI_SEL_PIN GPIO_PIN_12
  49. #define SCSI_ACK_PORT GPIOE
  50. #define SCSI_ACK_PIN GPIO_PIN_0
  51. #define SCSI_ATN_PORT GPIOE
  52. #define SCSI_ATN_PIN GPIO_PIN_1
  53. #define SCSI_BSY_PORT GPIOE
  54. #define SCSI_BSY_PIN GPIO_PIN_2
  55. #define SCSI_RST_PORT GPIOE
  56. #define SCSI_RST_PIN GPIO_PIN_3
  57. // Status LED pins
  58. #define LED_PORT GPIOE
  59. #define LED_PIN GPIO_PIN_4
  60. #define LED_ON() LED_PORT->BSRR = LED_PIN
  61. #define LED_OFF() LED_PORT->BRR = LED_PIN