Browse Source

fix for pins

Per Mårtensson 2 years ago
parent
commit
dda6a588a3
1 changed files with 13 additions and 7 deletions
  1. 13 7
      sw/include/blacksasi.h

+ 13 - 7
sw/include/blacksasi.h

@@ -297,18 +297,24 @@ static const uint32_t scsiDbInputOutputAnd = 0x00C0FFCC;
 // Transceiver control definitions
 #define TRANSCEIVER_IO_SET(VPIN,TR_INPUT) { GPIOREG(VPIN)->BSRR = BITMASK(VPIN) << ((TR_INPUT) ? 16 : 0); }
 
-static const uint32_t SCSI_TARGET_PORTA_AND = 0xFFF3FFFF;  // Sets input mode when AND-ed against MODER
-static const uint32_t SCSI_TARGET_PORTA_OR = 0x00040000;  // Sets output mode when AND+OR against MODER
-static const uint32_t SCSI_TARGET_PORTB_AND = 0xFFFF033F;  // Sets input mode when AND-ed against MODER
-static const uint32_t SCSI_TARGET_PORTB_OR = 0x00005440;  // Sets output mode when AND+OR against MODER
+
+//                                                      5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 
+static const uint32_t SCSI_TARGET_PORTD_AND        = 0b11111111111111111100111111111111;
+//                                                      5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 
+static const uint32_t SCSI_TARGET_PORTD_OR         = 0b00000000000000000001000000000000;
+
+//                                                      5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 
+static const uint32_t SCSI_TARGET_PORTE_AND        = 0b11111111111111111100000110000011;
+//                                                      5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 
+static const uint32_t SCSI_TARGET_PORTE_OR         = 0b00000000000000000001010100010000;
 
 // Turn on the output only for BSY
-#define SCSI_BSY_ACTIVE()      { PAREG->MODER = (PAREG->MODER & SCSI_TARGET_PORTA_AND) | SCSI_TARGET_PORTA_OR; PBREG->MODER = (PBREG->MODER & SCSI_TARGET_PORTB_AND) | SCSI_TARGET_PORTB_OR; SCSI_OUT(vBSY, active) }
+#define SCSI_BSY_ACTIVE()      { PEREG->MODER = (PEREG->MODER & SCSI_TARGET_PORTE_AND) | SCSI_TARGET_PORTE_OR; PDREG->MODER = (PDREG->MODER & SCSI_TARGET_PORTD_AND) | SCSI_TARGET_PORTD_OR; SCSI_OUT(vBSY, active) }
 
 // BSY,REQ,MSG,CD,IO Turn off output, BSY is the last input
-#define SCSI_TARGET_INACTIVE() { PAREG->MODER = (PAREG->MODER & SCSI_TARGET_PORTA_AND); PBREG->MODER = (PBREG->MODER & SCSI_TARGET_PORTB_AND); TRANSCEIVER_IO_SET(vTR_TARGET,TR_INPUT); }
+#define SCSI_TARGET_INACTIVE() { PEREG->MODER = (PEREG->MODER & SCSI_TARGET_PORTE_AND); PDREG->MODER = (PDREG->MODER & SCSI_TARGET_PORTD_AND); TRANSCEIVER_IO_SET(vTR_TARGET,TR_INPUT); }
 
-#define SCSI_TARGET_ACTIVE()   { PAREG->MODER = (PAREG->MODER & SCSI_TARGET_PORTA_AND) | SCSI_TARGET_PORTA_OR; PBREG->MODER = (PBREG->MODER & SCSI_TARGET_PORTB_AND) | SCSI_TARGET_PORTB_OR; }
+#define SCSI_TARGET_ACTIVE()   { PEREG->MODER = (PEREG->MODER & SCSI_TARGET_PORTE_AND) | SCSI_TARGET_PORTE_OR; PDREG->MODER = (PDREG->MODER & SCSI_TARGET_PORTD_AND) | SCSI_TARGET_PORTD_OR; }
 
 #else