|
|
2 år sedan | |
|---|---|---|
| .. | ||
| BlueSCSI_platform.cpp | 2 år sedan | |
| BlueSCSI_platform.h | 2 år sedan | |
| BlueSCSI_platform_gpio.h | 3 år sedan | |
| README.md | 2 år sedan | |
| bsp.h | 3 år sedan | |
| scsi2sd_time.h | 3 år sedan | |
| scsiPhy.cpp | 2 år sedan | |
| scsiPhy.h | 3 år sedan | |
The BlueSCSI firmware is designed to be portable to a wide variety of platforms. This directory contains an example platform definition that can serve as a base for porting efforts.
The bare minimum to support a new platform is to:
BlueSCSI_platform_template folder to a new name, e.g. BlueSCSI_platform_MyCustomHardware[env:template] section to a new name, e.g. [env:MyCustomHardware]BlueSCSI_platform_gpio.h to match the pinout of your platform.BlueSCSI_platform.h for the hardware access functions implemented in your platform.scsiPhy.cpp to enable the RST and BSY interrupts.The minimum IO capabilities for BlueSCSI firmware are:
DB0-DB7, DBPBSY, with rising edge interrupt.RST, with falling edge interrupt.REQ, IO, CD, MSGSEL, ACK, ATNBy default the BlueSCSI firmware uses large buffers for best performance. The total RAM usage in default configuration is about 100 kB. Minimum possible RAM usage is about 10 kB.
To reduce the RAM usage, following settings can be given in platformio.ini for the platform:
LOGBUFSIZE: Default 16384, minimum 512 bytesPREFETCH_BUFFER_SIZE: Default 8192, minimum 0 bytesMAX_SECTOR_SIZE: Default 8192, minimum 512 bytesSCSI2SD_BUFFER_SIZE: Default MAX_SECTOR_SIZE * 8, minimum MAX_SECTOR_SIZE * 2Access performance is improved a lot if SCSI access can occur in parallel with SD card access. To implement this, one or both of them must be able to execute transfers in background using hardware DMA. On most platforms this is possible for SD card access. The SCSI handshake mechanism is harder to implement using DMA.
To implement parallelism with SD card DMA, implement platform_set_sd_callback(func, buffer).
It sets a callback function which should be called by the SD card driver to report how many bytes have
been transferred to/from buffer so far. The SD card driver should call this function in a loop while
it is waiting for SD card transfer to finish. The code in BlueSCSI_disk.cpp will implement the callback
that will transfer the data to SCSI bus during the wait.