Skip to content

Commit 2462ada

Browse files
committed
tester improvements
1 parent 0cf9b84 commit 2462ada

File tree

4 files changed

+192
-1
lines changed

4 files changed

+192
-1
lines changed

LBCards/ODAS/ODASTESTER/ODASBounceLEDs.ino

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,10 @@ uint8_t bounceLedsCard(void)
6464
bounceLedsI2CRPT01();
6565
return 1;
6666
break;
67+
case I2CRPT08_CARD:
68+
bounceLedsI2CRPT08();
69+
return 1;
70+
break;
6771
default:
6872
Serial.println(F("Not supported at present - default case"));
6973
break;
@@ -322,3 +326,78 @@ void bounceLedsI2CRPT01(void)
322326
}
323327
}
324328
}
329+
330+
331+
//////////////////////////////////////////////////////////////////////////////////////
332+
// void bounceLedsI2CRPT08(void)
333+
//////////////////////////////////////////////////////////////////////////////////////
334+
335+
void bounceLedsI2CRPT08(void)
336+
{
337+
uint8_t port;
338+
Serial.println(F("Bouncing LEDs I2C-RPT-01 and I2CIO8 - any key to stop"));
339+
while (1)
340+
{
341+
UUTI2CMux8.setI2CChannel(0,1);
342+
for (port = 0; port < 4; port++)
343+
{
344+
i2cio8Card1.writeLED(port, HIGH);
345+
delay(250);
346+
i2cio8Card1.writeLED(port, LOW);
347+
}
348+
UUTI2CMux8.setI2CChannel(1,1);
349+
for (port = 0; port < 4; port++)
350+
{
351+
i2cio8Card2.writeLED(port, HIGH);
352+
delay(250);
353+
i2cio8Card2.writeLED(port, LOW);
354+
}
355+
UUTI2CMux8.setI2CChannel(2,1);
356+
for (port = 0; port < 4; port++)
357+
{
358+
i2cio8Card3.writeLED(port, HIGH);
359+
delay(250);
360+
i2cio8Card3.writeLED(port, LOW);
361+
}
362+
UUTI2CMux8.setI2CChannel(3,1);
363+
for (port = 0; port < 4; port++)
364+
{
365+
i2cio8Card4.writeLED(port, HIGH);
366+
delay(250);
367+
i2cio8Card4.writeLED(port, LOW);
368+
}
369+
UUTI2CMux8.setI2CChannel(4,1);
370+
for (port = 0; port < 4; port++)
371+
{
372+
i2cio8Card4.writeLED(port, HIGH);
373+
delay(250);
374+
i2cio8Card5.writeLED(port, LOW);
375+
}
376+
UUTI2CMux8.setI2CChannel(5,1);
377+
for (port = 0; port < 4; port++)
378+
{
379+
i2cio8Card4.writeLED(port, HIGH);
380+
delay(250);
381+
i2cio8Card6.writeLED(port, LOW);
382+
}
383+
UUTI2CMux8.setI2CChannel(6,1);
384+
for (port = 0; port < 4; port++)
385+
{
386+
i2cio8Card4.writeLED(port, HIGH);
387+
delay(250);
388+
i2cio8Card7.writeLED(port, LOW);
389+
}
390+
UUTI2CMux8.setI2CChannel(7,1);
391+
for (port = 0; port < 4; port++)
392+
{
393+
i2cio8Card4.writeLED(port, HIGH);
394+
delay(250);
395+
i2cio8Card8.writeLED(port, LOW);
396+
}
397+
if (Serial.available() > 0)
398+
{
399+
Serial.read();
400+
return;
401+
}
402+
}
403+
}

LBCards/ODAS/ODASTESTER/ODASCardTest.ino

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,9 @@ uint8_t extLBTestCard(void)
5050
case I2CRPT01_CARD:
5151
return (testLedsI2CRPT01());
5252
break;
53+
case I2CRPT08_CARD:
54+
return (testLedsI2CRPT08());
55+
break;
5356
case OPTOFST_SML_NON_INVERTING_CARD:
5457
return (testOptoFastSmallNonInverting());
5558
break;
@@ -723,3 +726,80 @@ uint8_t testProto16(void)
723726
}
724727
}
725728
}
729+
730+
//////////////////////////////////////////////////////////////////////////////////////
731+
// void testLedsI2CRPT01(void)
732+
//////////////////////////////////////////////////////////////////////////////////////
733+
734+
uint8_t testLedsI2CRPT08(void)
735+
{
736+
uint8_t port;
737+
uint8_t intStatus;
738+
Serial.println(F("Testing I2C-RPT-08 using 8x I2CIO8 and jumpers - any key to stop"));
739+
while (1)
740+
{
741+
// writes
742+
UUTI2CMux.setI2CChannel(0);
743+
for (port = 0; port < 4; port++)
744+
{
745+
i2cio8Card1.writeLED(port, HIGH);
746+
delay(250);
747+
i2cio8Card1.writeLED(port, LOW);
748+
}
749+
UUTI2CMux.setI2CChannel(1);
750+
for (port = 0; port < 4; port++)
751+
{
752+
i2cio8Card2.writeLED(port, HIGH);
753+
delay(250);
754+
i2cio8Card2.writeLED(port, LOW);
755+
}
756+
UUTI2CMux.setI2CChannel(2);
757+
for (port = 0; port < 4; port++)
758+
{
759+
i2cio8Card3.writeLED(port, HIGH);
760+
delay(250);
761+
i2cio8Card3.writeLED(port, LOW);
762+
}
763+
UUTI2CMux.setI2CChannel(3);
764+
for (port = 0; port < 4; port++)
765+
{
766+
i2cio8Card4.writeLED(port, HIGH);
767+
delay(250);
768+
i2cio8Card4.writeLED(port, LOW);
769+
}
770+
UUTI2CMux.setI2CChannel(4);
771+
for (port = 0; port < 4; port++)
772+
{
773+
i2cio8Card4.writeLED(port, HIGH);
774+
delay(250);
775+
i2cio8Card5.writeLED(port, LOW);
776+
}
777+
UUTI2CMux.setI2CChannel(5);
778+
for (port = 0; port < 4; port++)
779+
{
780+
i2cio8Card4.writeLED(port, HIGH);
781+
delay(250);
782+
i2cio8Card6.writeLED(port, LOW);
783+
}
784+
UUTI2CMux.setI2CChannel(6);
785+
for (port = 0; port < 4; port++)
786+
{
787+
i2cio8Card4.writeLED(port, HIGH);
788+
delay(250);
789+
i2cio8Card7.writeLED(port, LOW);
790+
}
791+
UUTI2CMux.setI2CChannel(7);
792+
for (port = 0; port < 4; port++)
793+
{
794+
i2cio8Card8.writeLED(port, HIGH);
795+
delay(250);
796+
i2cio8Card4.writeLED(port, LOW);
797+
}
798+
if (Serial.available() > 0)
799+
{
800+
Serial.read();
801+
return (TEST_PASSED);
802+
}
803+
}
804+
}
805+

LBCards/ODAS/ODASTESTER/ODASEEPROM.ino

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

@@ -425,6 +426,11 @@ void otherBoardType(void)
425426
break;
426427
}
427428
case '7':
429+
{
430+
boardType = I2CRPT08_CARD;
431+
break;
432+
}
433+
case '8':
428434
{
429435
boardType = OPTOFSTBI_CARD;
430436
break;

LBCards/ODAS/ODASTESTER/ODASTESTER.ino

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
#include <LandBoards_I2CIO8X.h>
2020
#include <LandBoards_I2CTEMP01.h>
2121
#include <LandBoards_I2CRPT01.h>
22+
#include <LandBoards_I2CRPT08.h>
2223
#include <LandBoards_MCP23017.h>
2324
#include <LandBoards_MCP23008.h>
2425

@@ -46,6 +47,7 @@ typedef enum {
4647
OPTOFST_SML_INVERTING_CARD,
4748
OPTOFSTBI_CARD,
4849
I2CRPT01_CARD,
50+
I2CRPT08_CARD,
4951
SWLEDX8_I2C_CARD,
5052
UNKNOWN_BOARD,
5153
} boardType_t;
@@ -75,10 +77,15 @@ LandBoards_I2CIO8 i2cio8Card1;
7577
LandBoards_I2CIO8 i2cio8Card2;
7678
LandBoards_I2CIO8 i2cio8Card3;
7779
LandBoards_I2CIO8 i2cio8Card4;
80+
LandBoards_I2CIO8 i2cio8Card5;
81+
LandBoards_I2CIO8 i2cio8Card6;
82+
LandBoards_I2CIO8 i2cio8Card7;
83+
LandBoards_I2CIO8 i2cio8Card8;
7884
LandBoards_I2CIO8X i2cio8xCard;
7985
LandBoards_MCP23008 singleMCP23008;
8086
LandBoards_MCP23017 singleMCP23017;
8187
LandBoards_I2CRPT01 UUTI2CMux;
88+
LandBoards_I2CRPT08 UUTI2CMux8;
8289

8390
//////////////////////////////////////////////////////////
8491
// setup()
@@ -144,6 +151,25 @@ void setup()
144151
UUTI2CMux.setI2CChannel(3);
145152
i2cio8Card4.begin(0);
146153
break;
154+
case I2CRPT08_CARD:
155+
UUTI2CMux8.begin(0); // testing external I2C-RPT-01 card
156+
UUTI2CMux8.setI2CChannel(0,1);
157+
i2cio8Card1.begin(0); // Requires I2CIO8 cards connected to external I2C-RPT-01 card
158+
UUTI2CMux8.setI2CChannel(1,1);
159+
i2cio8Card2.begin(0);
160+
UUTI2CMux8.setI2CChannel(2,1);
161+
i2cio8Card3.begin(0);
162+
UUTI2CMux8.setI2CChannel(3,1);
163+
i2cio8Card4.begin(0);
164+
UUTI2CMux8.setI2CChannel(4,1);
165+
i2cio8Card5.begin(0);
166+
UUTI2CMux8.setI2CChannel(5,1);
167+
i2cio8Card4.begin(0);
168+
UUTI2CMux8.setI2CChannel(5,1);
169+
i2cio8Card7.begin(0);
170+
UUTI2CMux8.setI2CChannel(7,1);
171+
i2cio8Card8.begin(0);
172+
break;
147173
}
148174
Serial.println(F("C=Card Tests, D=Direct, E=EEPROM, I=access Internal DIGIO32"));
149175
}

0 commit comments

Comments
 (0)