scsiHostPhy.h 893 B

12345678910111213141516171819202122232425262728293031
  1. // Host side SCSI physical interface.
  2. // Used in initiator to interface to an SCSI drive.
  3. #pragma once
  4. #include <stdint.h>
  5. #include <stdbool.h>
  6. // Request to stop activity and reset the bus
  7. extern volatile bool g_scsiHostPhyReset;
  8. // Release bus and pulse RST signal, initialize PHY to host mode.
  9. void scsiHostPhyReset(void);
  10. // Select a device, id 0-7.
  11. // Returns true if the target answers to selection request.
  12. bool scsiHostPhySelect(int target_id);
  13. // Read the current communication phase as signaled by the target
  14. // Matches SCSI_PHASE enumeration from scsi.h.
  15. int scsiHostPhyGetPhase();
  16. // Returns true if the device has asserted REQ signal, i.e. data waiting
  17. bool scsiHostRequestWaiting();
  18. // Blocking data transfer
  19. bool scsiHostWrite(const uint8_t *data, uint32_t count);
  20. bool scsiHostRead(uint8_t *data, uint32_t count);
  21. // Release all bus signals
  22. void scsiHostPhyRelease();