Skip to content

Commit ad38cbc

Browse files
committed
added optofastbi
1 parent b6bcd48 commit ad38cbc

File tree

2 files changed

+46
-1
lines changed

2 files changed

+46
-1
lines changed

LBCards/ODAS/ODASTESTER/ODASCardTest.ino

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,9 @@ uint8_t extLBTestCard(void)
5656
case OPTOFST_SML_INVERTING_CARD:
5757
return (testOptoFastSmallInverting());
5858
break;
59+
case OPTOFSTBI_CARD:
60+
return (testOptoFastBi());
61+
break;
5962
case NEW_CARD:
6063
Serial.println(F("Not supported at present"));
6164
break;
@@ -143,6 +146,43 @@ uint8_t testOptoFastSmallNonInverting(void)
143146
return testResults;
144147
}
145148

149+
150+
//////////////////////////////////////////////////////////////////////////////////////
151+
// uint8_t testOptoFastBi(void)
152+
//////////////////////////////////////////////////////////////////////////////////////
153+
154+
uint8_t testOptoFastBi
155+
(void)
156+
{
157+
uint8_t port;
158+
uint8_t testResults = TEST_PASSED;
159+
BluePillI2CMux.setI2CChannel(TEST_STN_INT_MUX_CH);
160+
for (port = 0; port < 4; port++) // Set ports 0-3 to outputs
161+
Dio32.pinMode(port, OUTPUT);
162+
for (port = 8; port < 12; port++) // Set all inputs to Pullup
163+
Dio32.pinMode(port, INPUT_PULLUP);
164+
for (port = 0; port < 4; port++) // Set all inputs to Pullup
165+
{
166+
Dio32.digitalWrite(port, LOW);
167+
if (Dio32.digitalRead(port + 8) != HIGH)
168+
{
169+
Serial.print(F("Error on port "));
170+
Serial.print(port);
171+
Serial.println(F(" Expected High"));
172+
testResults = TEST_FAILED;
173+
}
174+
Dio32.digitalWrite(port, HIGH);
175+
if (Dio32.digitalRead(port + 8) != LOW)
176+
{
177+
Serial.print(F("Error on port "));
178+
Serial.print(port);
179+
Serial.println(F(" Expected Low"));
180+
testResults = TEST_FAILED;
181+
}
182+
}
183+
return testResults;
184+
}
185+
146186
//////////////////////////////////////////////////////////////////////////////////////
147187
// uint8_t testSwLedX8(void)
148188
//////////////////////////////////////////////////////////////////////////////////////

LBCards/ODAS/ODASTESTER/ODASEEPROM.ino

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -378,6 +378,7 @@ void otherBoardType(void)
378378
Serial.println(F("4 - OPTOFast/Small Non-Inverting board"));
379379
Serial.println(F("5 - OPTOFast/Small Inverting board"));
380380
Serial.println(F("6 - I2C-RPT-01 board"));
381+
Serial.println(F("7 - OptoFastBi board"));
381382
Serial.print(F("Select board > "));
382383
int incomingByte = 0; // for incoming serial data
383384

@@ -422,11 +423,15 @@ void otherBoardType(void)
422423
boardType = I2CRPT01_CARD;
423424
break;
424425
}
426+
case '7':
427+
{
428+
boardType = OPTOFSTBI_CARD;
429+
break;
430+
}
425431
default:
426432
{
427433
Serial.println(F("Failed to select board type"));
428434
}
429435
}
430436
}
431-
432437
}

0 commit comments

Comments
 (0)