@@ -27,6 +27,10 @@ static IPAddress const gateway {192, 168, 42, 100};
27
27
static T1SPlcaSettings const t1s_plca_settings{T1S_PLCA_NODE_ID};
28
28
static T1SMacSettings const t1s_default_mac_settings;
29
29
30
+ /* Modify this function call parameter if you want to test a different LAN8651 DIO.
31
+ */
32
+ static auto const DIO_PIN = TC6::DIO::A0;
33
+
30
34
/* *************************************************************************************
31
35
* GLOBAL VARIABLES
32
36
**************************************************************************************/
@@ -81,10 +85,6 @@ void setup()
81
85
Serial.println (mac_addr);
82
86
Serial.println (t1s_plca_settings);
83
87
Serial.println (t1s_default_mac_settings);
84
-
85
- // If Power Provider, turn on LOCAL_ENABLE and turn on T1S_DISABLE
86
- // tc6_inst->digitalWrite(1,1,1);
87
- // tc6_inst->digitalWrite(0,0,0);
88
88
}
89
89
90
90
void loop ()
@@ -103,13 +103,22 @@ void loop()
103
103
104
104
static bool dio_val = false ;
105
105
106
- Serial.print (" DIO A0 = " );
106
+ Serial.print (" DIO " );
107
+ Serial.print (toStr (DIO_PIN));
108
+ Serial.print (" = " );
107
109
Serial.println (dio_val);
108
110
109
- /* Modify this function call parameter if you want
110
- * to test a different LAN8651 DIO.
111
- */
112
- tc6_inst->digitalWrite (TC6::DIO::A1, dio_val);
111
+ tc6_inst->digitalWrite (DIO_PIN, dio_val);
113
112
dio_val = !dio_val;
114
113
}
115
114
}
115
+
116
+ String toStr (TC6::DIO const dio)
117
+ {
118
+ if (dio == TC6::DIO::A0)
119
+ return String (" A0" );
120
+ else if (dio == TC6::DIO::A1)
121
+ return String (" A1" );
122
+ else
123
+ return String (" " );
124
+ }
0 commit comments