Skip to content

Commit 8d559fd

Browse files
committedMar 28, 2024·
Remove previous method of controlling all 3 DIOs at once.
1 parent fac6a9a commit 8d559fd

File tree

5 files changed

+0
-59
lines changed

5 files changed

+0
-59
lines changed
 

‎examples/LAN8651-iperf/LAN8651-iperf.ino

-7
Original file line numberDiff line numberDiff line change
@@ -106,13 +106,6 @@ void setup()
106106
Serial.println(t1s_plca_settings);
107107
Serial.println(t1s_mac_settings);
108108

109-
// If Power Provider, turn on LOCAL_ENABLE and turn on T1S_DISABLE
110-
//tc6_inst->digitalWrite(1,1,0);
111-
// If Power Receiver, turn off LOCAL_ENABLE and turn off T1S_DISABLE
112-
tc6_inst->digitalWrite(0,0,0);
113-
// If we want to disable PoDL, turn off LOCAL_ENABLE and turn on T1S_DISABLE
114-
//tc6_inst->digitalWrite(0,0,0);
115-
116109
iperf_init(tc6_inst);
117110
iperf_print_app_header();
118111
iperf_start_application();

‎src/microchip/TC6_Arduino_10BASE_T1S.cpp

-5
Original file line numberDiff line numberDiff line change
@@ -193,11 +193,6 @@ bool TC6_Arduino_10BASE_T1S::begin(IPAddress const ip_addr,
193193
return true;
194194
}
195195

196-
void TC6_Arduino_10BASE_T1S::digitalWrite(bool dioa0, bool dioa1, bool dioa2)
197-
{
198-
TC6Regs_SetDio(_lw.tc.tc6, dioa0, dioa1, dioa2);
199-
}
200-
201196
void TC6_Arduino_10BASE_T1S::digitalWrite(DIO const dio, bool const value)
202197
{
203198
if (dio == DIO::A0)

‎src/microchip/TC6_Arduino_10BASE_T1S.h

-2
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,6 @@ class TC6_Arduino_10BASE_T1S : public Arduino_10BASE_T1S_PHY_Interface
8989

9090
virtual void service() override;
9191

92-
void digitalWrite(bool dioa0, bool dioa1, bool dioa2);
93-
9492
void digitalWrite(DIO const dio, bool const value);
9593

9694
bool getPlcaStatus(TC6LwIP_On_PlcaStatus on_plca_status);

‎src/microchip/lib/libtc6/inc/tc6-regs.h

-7
Original file line numberDiff line numberDiff line change
@@ -148,13 +148,6 @@ void TC6Regs_Reinit(TC6_t *pInst);
148148
*/
149149
bool TC6Regs_SetPlca(TC6_t *pInst, bool plcaEnable, uint8_t nodeId, uint8_t nodeCount);
150150

151-
/** \brief Sets DIOAx GPIOs to the desired status.
152-
* \param idx - The instance number as returned from the TC6LwIP_Init() function.
153-
* \param dioax - true, if the pin should be SET; false is the pin should be reset.
154-
* \return true, if request could be enqueued, the PLCA parameters will be changed soon. false, request failed, no change.
155-
*/
156-
bool TC6Regs_SetDio(TC6_t *pTC6, bool dioa0, bool dioa1, bool dioa2);
157-
158151
/** \brief Configure DIOAx GPIOs as output.
159152
*/
160153
void TC6Regs_EnableDio_A0(TC6_t *pTC6);

‎src/microchip/lib/libtc6/src/tc6-regs.cpp

-38
Original file line numberDiff line numberDiff line change
@@ -173,44 +173,6 @@ bool TC6Regs_SetPlca(TC6_t *pTC6, bool plcaEnable, uint8_t nodeId, uint8_t nodeC
173173
return success;
174174
}
175175

176-
bool TC6Regs_SetDio(TC6_t *pTC6, bool dioa0, bool dioa1, bool dioa2)
177-
{
178-
static bool _dioa0 = false;
179-
static bool _dioa1= false;
180-
static bool _dioa2 = false;
181-
182-
TC6Reg_t *pReg = GetContext(pTC6);
183-
// EG0CTL 0x0226
184-
// EG1CTL 0x022C
185-
// EG2CTL 0x0232
186-
// PADCTRL 0x0088
187-
uint32_t regVal = (1 << 0) | (1 << 2) | (1 << 4); // set all pins as output
188-
while (pReg->initDone && !TC6_WriteRegister(pReg->pTC6, 0x000A0088, regVal, CONTROL_PROTECTION, NULL, NULL)) {
189-
TC6_Service(pReg->pTC6, true);
190-
}
191-
192-
regVal = 1; // means toggle
193-
if (dioa0 != _dioa0) {
194-
while (pReg->initDone && !TC6_WriteRegister(pReg->pTC6, 0x000A0226, regVal, CONTROL_PROTECTION, NULL, NULL)) {
195-
TC6_Service(pReg->pTC6, true);
196-
}
197-
_dioa0 = dioa0;
198-
}
199-
if (dioa1 != _dioa1) {
200-
while (pReg->initDone && !TC6_WriteRegister(pReg->pTC6, 0x000A022C, regVal, CONTROL_PROTECTION, NULL, NULL)) {
201-
TC6_Service(pReg->pTC6, true);
202-
}
203-
_dioa1 = dioa1;
204-
}
205-
if (dioa2 != _dioa2) {
206-
while (pReg->initDone && !TC6_WriteRegister(pReg->pTC6, 0x000A0232, regVal, CONTROL_PROTECTION, NULL, NULL)) {
207-
TC6_Service(pReg->pTC6, true);
208-
}
209-
_dioa2 = dioa2;
210-
}
211-
return true;
212-
}
213-
214176
static bool is_dio_a0_op_done = false;
215177
void TC6_Dio_A0_Callback(TC6_t *pInst, bool success, uint32_t addr, uint32_t value, void *pTag, void *pGlobalTag)
216178
{

0 commit comments

Comments
 (0)
Please sign in to comment.