mirror of
https://github.com/erichelgeson/BlueSCSI.git
synced 2025-01-28 13:30:47 +00:00
GPIO mode tweaks. Mode 1 is actually 10MHz PUSH/PULL, OD is mode 7. For DB PU/PD input, set the resistors to PU. Set REQ to match DB output mode.
This commit is contained in:
parent
ab30ff262e
commit
3ed8ef0154
@ -153,22 +153,22 @@ SdFs SD;
|
||||
// IN , FLOAT : 4
|
||||
// IN , PU/PD : 8
|
||||
// OUT, PUSH/PULL : 3
|
||||
// OUT, OD : 1
|
||||
//#define DB_MODE_OUT 3
|
||||
#define DB_MODE_OUT 1
|
||||
// OUT, OD : 7
|
||||
#define DB_MODE_OUT 3
|
||||
//#define DB_MODE_OUT 7
|
||||
#define DB_MODE_IN 8
|
||||
|
||||
// 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; }
|
||||
// Put DB and DP in input mode
|
||||
#define SCSI_DB_INPUT() { PBREG->CRL=(PBREG->CRL &0xfffffff0)|DB_MODE_IN ; PBREG->CRH = 0x11111111*DB_MODE_IN; }
|
||||
#define SCSI_DB_INPUT() { PBREG->CRL=(PBREG->CRL &0xfffffff0)|DB_MODE_IN ; PBREG->CRH = 0x11111111*DB_MODE_IN; if (DB_MODE_IN == 8) PBREG->BSRR = 0xFF01;}
|
||||
|
||||
// Turn on the output only for BSY
|
||||
#define SCSI_BSY_ACTIVE() { gpio_mode(BSY, GPIO_OUTPUT_OD); SCSI_OUT(vBSY, active) }
|
||||
// BSY,REQ,MSG,CD,IO Turn on the output (no change required for OD)
|
||||
#define SCSI_TARGET_ACTIVE() { }
|
||||
#define SCSI_TARGET_ACTIVE() { if (DB_MODE_OUT != 7) gpio_mode(REQ, GPIO_OUTPUT_PP);}
|
||||
// BSY,REQ,MSG,CD,IO Turn off output, BSY is the last input
|
||||
#define SCSI_TARGET_INACTIVE() { SCSI_OUT(vREQ,inactive); SCSI_OUT(vMSG,inactive); SCSI_OUT(vCD,inactive);SCSI_OUT(vIO,inactive); SCSI_OUT(vBSY,inactive); gpio_mode(BSY, GPIO_INPUT_PU); }
|
||||
#define SCSI_TARGET_INACTIVE() { if (DB_MODE_OUT == 7) SCSI_OUT(vREQ,inactive) else { if (DB_MODE_IN == 8) gpio_mode(REQ, GPIO_INPUT_PU) else gpio_mode(REQ, GPIO_INPUT_FLOATING)} SCSI_OUT(vMSG,inactive); SCSI_OUT(vCD,inactive);SCSI_OUT(vIO,inactive); SCSI_OUT(vBSY,inactive); gpio_mode(BSY, GPIO_INPUT_PU); }
|
||||
|
||||
// HDDiamge file
|
||||
#define HDIMG_ID_POS 2 // Position to embed ID number
|
||||
|
Loading…
x
Reference in New Issue
Block a user