mirror of
https://github.com/erichelgeson/BlueSCSI.git
synced 2024-06-02 00:41:30 +00:00
Compare commits
28 Commits
prerelease
...
main
Author | SHA1 | Date | |
---|---|---|---|
|
bf5823468a | ||
|
2baa0155e1 | ||
|
3a9db99723 | ||
|
70eda86484 | ||
|
9d4207ea14 | ||
|
1d49003fe1 | ||
|
0a30396c3b | ||
|
ba06827814 | ||
|
a45af3edec | ||
|
0be37ccde0 | ||
|
e236b5b054 | ||
|
47179c5fd0 | ||
|
59c858332a | ||
|
dddb7bfc1c | ||
|
8b79df00ba | ||
|
7c9428131b | ||
|
e35bae560c | ||
|
13d7b985b7 | ||
|
27b7427301 | ||
|
98162fcd84 | ||
|
2be810e2ca | ||
|
4f7c0fe2c2 | ||
|
458617a827 | ||
|
810eae9be3 | ||
|
d67fa80cf0 | ||
|
9e746ba145 | ||
|
e0d115f33c | ||
|
27d13192b0 |
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -3,3 +3,4 @@
|
||||||
.vscode/
|
.vscode/
|
||||||
workspace.code-workspace
|
workspace.code-workspace
|
||||||
dist/
|
dist/
|
||||||
|
hw/*/*-backups/
|
||||||
|
|
BIN
3D-Files/1.1/internal-50pin/bluescsi11a_kerosmacmodsv2.stl.zip
Normal file
BIN
3D-Files/1.1/internal-50pin/bluescsi11a_kerosmacmodsv2.stl.zip
Normal file
Binary file not shown.
|
@ -11,9 +11,7 @@ upload_protocol = stlink
|
||||||
; Different gcc versions produce much different binaries in terms of speed.
|
; Different gcc versions produce much different binaries in terms of speed.
|
||||||
platform_packages = platformio/toolchain-gccarmnoneeabi@1.90301.200702
|
platform_packages = platformio/toolchain-gccarmnoneeabi@1.90301.200702
|
||||||
build_flags =
|
build_flags =
|
||||||
-DARDUINO_GENERIC_STM32F103C
|
|
||||||
-DARDUINO_LIB_DISCOVERY_PHASE
|
-DARDUINO_LIB_DISCOVERY_PHASE
|
||||||
-DARDUINO=10813
|
|
||||||
-DARDUINO_ARCH_STM32
|
-DARDUINO_ARCH_STM32
|
||||||
-DDEBUG_LEVEL=DEBUG_NONE
|
-DDEBUG_LEVEL=DEBUG_NONE
|
||||||
-O2
|
-O2
|
||||||
|
@ -78,9 +76,7 @@ build_flags =
|
||||||
-D USB_MANUFACTURER="Unknown"
|
-D USB_MANUFACTURER="Unknown"
|
||||||
-D USB_PRODUCT="\"BLUEPILL_F103C8\""
|
-D USB_PRODUCT="\"BLUEPILL_F103C8\""
|
||||||
-D HAL_PCD_MODULE_ENABLED
|
-D HAL_PCD_MODULE_ENABLED
|
||||||
-DARDUINO_GENERIC_STM32F103C
|
|
||||||
-DARDUINO_LIB_DISCOVERY_PHASE
|
-DARDUINO_LIB_DISCOVERY_PHASE
|
||||||
-DARDUINO=10813
|
|
||||||
-DARDUINO_ARCH_STM32
|
-DARDUINO_ARCH_STM32
|
||||||
-DDEBUG_LEVEL=DEBUG_NONE
|
-DDEBUG_LEVEL=DEBUG_NONE
|
||||||
-O2
|
-O2
|
||||||
|
|
768
src/BlueSCSI.cpp
768
src/BlueSCSI.cpp
File diff suppressed because it is too large
Load Diff
|
@ -99,8 +99,6 @@ enum SCSI_DEVICE_TYPE
|
||||||
#define IO PB7 // SCSI:I/O
|
#define IO PB7 // SCSI:I/O
|
||||||
|
|
||||||
#define SD_CS PA4 // SDCARD:CS
|
#define SD_CS PA4 // SDCARD:CS
|
||||||
#define LED PC13 // LED
|
|
||||||
#define LED2 PA0 // External LED
|
|
||||||
|
|
||||||
// Image Set Selector
|
// Image Set Selector
|
||||||
#ifdef XCVR
|
#ifdef XCVR
|
||||||
|
@ -116,17 +114,29 @@ enum SCSI_DEVICE_TYPE
|
||||||
#define PBREG GPIOB->regs
|
#define PBREG GPIOB->regs
|
||||||
#define PCREG GPIOC->regs
|
#define PCREG GPIOC->regs
|
||||||
|
|
||||||
// LED control
|
|
||||||
#define LED_ON() PCREG->BSRR = 0b00100000000000000000000000000000; PAREG->BSRR = 0b00000000000000000000000000000001;
|
|
||||||
#define LED_OFF() PCREG->BSRR = 0b00000000000000000010000000000000; PAREG->BSRR = 0b00000000000000010000000000000000;
|
|
||||||
|
|
||||||
// Virtual pin (Arduio compatibility is slow, so make it MCU-dependent)
|
// Virtual pin (Arduio compatibility is slow, so make it MCU-dependent)
|
||||||
#define PA(BIT) (BIT)
|
#define PA(BIT) (BIT)
|
||||||
#define PB(BIT) (BIT+16)
|
#define PB(BIT) (BIT+16)
|
||||||
|
#define PC(BIT) (BIT+32)
|
||||||
|
|
||||||
// Virtual pin decoding
|
// Virtual pin decoding
|
||||||
#define GPIOREG(VPIN) ((VPIN)>=16?PBREG:PAREG)
|
#define GPIOREG(VPIN) ((VPIN)>=16?((VPIN)>=32?PCREG:PBREG):PAREG)
|
||||||
#define BITMASK(VPIN) (1<<((VPIN)&15))
|
#define BITMASK(VPIN) (1<<((VPIN)&15))
|
||||||
|
|
||||||
|
// Built-in LED
|
||||||
|
#define LED PC13
|
||||||
|
#define vLED PC(13)
|
||||||
|
#define LED_MODE GPIO_OUTPUT_OD
|
||||||
|
|
||||||
|
// External LED
|
||||||
|
#define LED2 PA0
|
||||||
|
#define vLED2 PA(0)
|
||||||
|
#define LED2_MODE GPIO_OUTPUT_PP
|
||||||
|
|
||||||
|
// LED control
|
||||||
|
#define LED_ON() GPIOREG(vLED)->BSRR = BITMASK(vLED) << (LED_MODE == GPIO_OUTPUT_PP ? 0 : 16); GPIOREG(vLED2)->BSRR = BITMASK(vLED2) << (LED2_MODE == GPIO_OUTPUT_PP ? 0 : 16);
|
||||||
|
#define LED_OFF() GPIOREG(vLED)->BSRR = BITMASK(vLED) << (LED_MODE == GPIO_OUTPUT_PP ? 16 : 0); GPIOREG(vLED2)->BSRR = BITMASK(vLED2) << (LED2_MODE == GPIO_OUTPUT_PP ? 16 : 0);
|
||||||
|
|
||||||
#define vATN PA(8) // SCSI:ATN
|
#define vATN PA(8) // SCSI:ATN
|
||||||
#define vBSY PA(9) // SCSI:BSY
|
#define vBSY PA(9) // SCSI:BSY
|
||||||
#define vACK PA(10) // SCSI:ACK
|
#define vACK PA(10) // SCSI:ACK
|
||||||
|
@ -172,7 +182,7 @@ enum SCSI_DEVICE_TYPE
|
||||||
| 1 | 1 | 1 | MESSAGE IN | Initiator from target / | phase |
|
| 1 | 1 | 1 | MESSAGE IN | Initiator from target / | phase |
|
||||||
|-----------------------------------------------------------------------------|
|
|-----------------------------------------------------------------------------|
|
||||||
| Key: 0 = False, 1 = True, * = Reserved for future standardization |
|
| Key: 0 = False, 1 = True, * = Reserved for future standardization |
|
||||||
+=============================================================================+
|
+=============================================================================+
|
||||||
*/
|
*/
|
||||||
// SCSI phase change as single write to port B
|
// SCSI phase change as single write to port B
|
||||||
#define SCSIPHASEMASK(MSGACTIVE, CDACTIVE, IOACTIVE) ((BITMASK(vMSG)<<((MSGACTIVE)?16:0)) | (BITMASK(vCD)<<((CDACTIVE)?16:0)) | (BITMASK(vIO)<<((IOACTIVE)?16:0)))
|
#define SCSIPHASEMASK(MSGACTIVE, CDACTIVE, IOACTIVE) ((BITMASK(vMSG)<<((MSGACTIVE)?16:0)) | (BITMASK(vCD)<<((CDACTIVE)?16:0)) | (BITMASK(vIO)<<((IOACTIVE)?16:0)))
|
||||||
|
@ -235,14 +245,15 @@ enum SCSI_DEVICE_TYPE
|
||||||
// Put DB and DP in output mode
|
// Put DB and DP in output mode
|
||||||
#define SCSI_DB_OUTPUT() { PBREG->CRL=(PBREG->CRL &0xfffffff0)|DB_MODE_OUT; PBREG->CRH = 0x11111111*DB_MODE_OUT; }
|
#define SCSI_DB_OUTPUT() { PBREG->CRL=(PBREG->CRL &0xfffffff0)|DB_MODE_OUT; PBREG->CRH = 0x11111111*DB_MODE_OUT; }
|
||||||
// Put DB and DP in input mode
|
// Put DB and DP in input mode
|
||||||
#define SCSI_DB_INPUT() { PBREG->CRL=(PBREG->CRL &0xfffffff0)|DB_MODE_IN ; PBREG->CRH = (uint32_t)(0x11111111*DB_MODE_IN); }
|
#define SCSI_DB_INPUT() { PBREG->CRL=(PBREG->CRL &0xfffffff0)|DB_MODE_IN ; PBREG->CRH = (uint32_t)0x11111111*DB_MODE_IN; }
|
||||||
|
|
||||||
// HDDiamge file
|
// HDDiamge file
|
||||||
#define HDIMG_ID_POS 2 // Position to embed ID number
|
#define HDIMG_ID_POS 2 // Position to embed ID number
|
||||||
#define HDIMG_LUN_POS 3 // Position to embed LUN numbers
|
#define HDIMG_LUN_POS 3 // Position to embed LUN numbers
|
||||||
#define HDIMG_BLK_POS 5 // Position to embed block size numbers
|
#define HDIMG_BLK_POS 5 // Position to embed block size numbers
|
||||||
#define MAX_FILE_PATH 64 // Maximum file name length
|
#define MAX_FILE_PATH 64 // Maximum file name length
|
||||||
|
#define MAX_MAC_PATH 32 // Maximum file name length on vintage macs
|
||||||
|
#define MAC_BLK_SIZE 4096
|
||||||
/*
|
/*
|
||||||
* Data byte to BSRR register setting value and parity table
|
* Data byte to BSRR register setting value and parity table
|
||||||
*/
|
*/
|
||||||
|
@ -329,15 +340,15 @@ typedef struct _SCSI_INQUIRY_DATA
|
||||||
// HDD image
|
// HDD image
|
||||||
typedef __attribute__((aligned(4))) struct _SCSI_DEVICE
|
typedef __attribute__((aligned(4))) struct _SCSI_DEVICE
|
||||||
{
|
{
|
||||||
FsFile m_file; // File object
|
FsFile m_file; // File object
|
||||||
uint64_t m_fileSize; // File size
|
uint64_t m_fileSize; // File size
|
||||||
uint16_t m_blocksize; // SCSI BLOCK size
|
uint16_t m_blocksize; // SCSI BLOCK size
|
||||||
uint16_t m_rawblocksize; // OPTICAL raw sector size
|
uint16_t m_rawblocksize; // OPTICAL raw sector size
|
||||||
uint8_t m_type; // SCSI device type
|
uint8_t m_type; // SCSI device type
|
||||||
uint32_t m_blockcount; // blockcount
|
uint32_t m_blockcount; // blockcount
|
||||||
SCSI_INQUIRY_DATA inquiry_block; // SCSI information
|
SCSI_INQUIRY_DATA inquiry_block; // SCSI information
|
||||||
uint8_t m_senseKey; // Sense key
|
uint8_t m_senseKey; // Sense key
|
||||||
uint16_t m_additional_sense_code; // ASC/ASCQ
|
uint16_t m_additional_sense_code; // ASC/ASCQ
|
||||||
uint8_t m_sector_offset; // optical sector offset for missing sync header
|
uint8_t m_sector_offset; // optical sector offset for missing sync header
|
||||||
uint8_t flags; // various device flags
|
uint8_t flags; // various device flags
|
||||||
} SCSI_DEVICE;
|
} SCSI_DEVICE;
|
||||||
|
|
|
@ -51,6 +51,14 @@
|
||||||
#define SCSI_READ12 0xA8
|
#define SCSI_READ12 0xA8
|
||||||
#define SCSI_VERIFY12 0xAF
|
#define SCSI_VERIFY12 0xAF
|
||||||
|
|
||||||
|
#define BLUESCSI_LIST_FILES 0xD0
|
||||||
|
#define BLUESCSI_GET_FILE 0xD1
|
||||||
|
#define BLUESCSI_COUNT_FILES 0xD2
|
||||||
|
#define BLUESCSI_SEND_PREP 0xD3
|
||||||
|
#define BLUESCSI_SEND 0xD4
|
||||||
|
#define BLUESCSI_SEND_END 0xD5
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#define SCSI_TOC_LENGTH 20 // length for default CDROM TOC
|
#define SCSI_TOC_LENGTH 20 // length for default CDROM TOC
|
||||||
|
|
||||||
|
|
|
@ -31,6 +31,9 @@
|
||||||
#define SCSI_ASC_MEDIUM_NOT_PRESENT 0x3A00
|
#define SCSI_ASC_MEDIUM_NOT_PRESENT 0x3A00
|
||||||
#define SCSI_ASC_LUN_NOT_READY_MANUAL_INTERVENTION_REQUIRED 0x0403
|
#define SCSI_ASC_LUN_NOT_READY_MANUAL_INTERVENTION_REQUIRED 0x0403
|
||||||
|
|
||||||
|
// OpenRetroSCSI Vendor Sense
|
||||||
|
#define OPEN_RETRO_SCSI_TOO_MANY_FILES 0x0001
|
||||||
|
|
||||||
|
|
||||||
// SCSI mode page codes
|
// SCSI mode page codes
|
||||||
#define SCSI_SENSE_MODE_VENDOR 0x00
|
#define SCSI_SENSE_MODE_VENDOR 0x00
|
||||||
|
@ -44,6 +47,8 @@
|
||||||
#define SCSI_SENSE_MODE_CDROM_AUDIO_CONTROL 0x0E
|
#define SCSI_SENSE_MODE_CDROM_AUDIO_CONTROL 0x0E
|
||||||
#define SCSI_SENSE_MODE_VENDOR_APPLE 0x30
|
#define SCSI_SENSE_MODE_VENDOR_APPLE 0x30
|
||||||
|
|
||||||
|
#define SCSI_SENSE_MODE_VENDOR_BLUESCSI 0x31 // Lookup range for vndr
|
||||||
|
|
||||||
#define SCSI_SENSE_MODE_ALL 0x3F
|
#define SCSI_SENSE_MODE_ALL 0x3F
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user