scsi_accel_dma.h 800 B

1234567891011121314151617181920212223242526
  1. // SCSI subroutines that use hardware DMA for transfer in the background.
  2. // Uses either GD32 timer or external GreenPAK to implement REQ pin toggling.
  3. #pragma once
  4. #include <stdint.h>
  5. #include "ZuluSCSI_platform.h"
  6. #ifdef SCSI_TIMER
  7. #define SCSI_ACCEL_DMA_AVAILABLE 1
  8. #endif
  9. /* Initialization function decides whether to use timer or GreenPAK */
  10. void scsi_accel_timer_dma_init();
  11. /* Common functions */
  12. void scsi_accel_dma_startWrite(const uint8_t* data, uint32_t count, volatile int *resetFlag);
  13. void scsi_accel_dma_stopWrite();
  14. void scsi_accel_dma_finishWrite(volatile int *resetFlag);
  15. // Query whether the data at pointer has already been read, i.e. buffer can be reused.
  16. // If data is NULL, checks if all writes have completed.
  17. bool scsi_accel_dma_isWriteFinished(const uint8_t* data);