Skip to content

Commit

Permalink
Merge pull request #2 from taylorza/master
Browse files Browse the repository at this point in the history
Updated to CSpect 2.16.5.0 Plugin interface
  • Loading branch information
Threetwosevensixseven authored Jan 17, 2023
2 parents fde1601 + cf1e28c commit 26bb2b1
Show file tree
Hide file tree
Showing 7 changed files with 57 additions and 11 deletions.
Binary file modified Common/Plugin.dll
Binary file not shown.
13 changes: 11 additions & 2 deletions RTC/Plugin/RTCPlugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public void Quit()
{
}

public byte Read(eAccess _type, int _address, out bool _isvalid)
public byte Read(eAccess _type, int _address, int _id, out bool _isvalid)
{
// Only handle the two Next I/O ports corresponding to the I2C SCL and Data lines
if (_type == eAccess.Port_Read && _address == PORT_SCL)
Expand All @@ -63,7 +63,7 @@ public byte Read(eAccess _type, int _address, out bool _isvalid)
return 0;
}

public bool Write(eAccess _type, int _port, byte _value)
public bool Write(eAccess _type, int _port, int _id, byte _value)
{
if (_type == eAccess.Port_Write && _port == PORT_SCL)
{
Expand Down Expand Up @@ -93,5 +93,14 @@ private void LogSlave(string Text)
public void Tick()
{
}

public bool KeyPressed(int _id)
{
return false;
}

public void Reset()
{
}
}
}
13 changes: 11 additions & 2 deletions RTCSys/RTCSys_Device.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public List<sIO> Init(iCSpect _CSpect)
return ports;
}

public byte Read(eAccess _type, int _address, out bool _isvalid)
public byte Read(eAccess _type, int _address, int _id, out bool _isvalid)
{
if (_type == eAccess.NextReg_Read && _address == REG_00_MACHINE_ID)
{
Expand Down Expand Up @@ -115,7 +115,7 @@ public byte Read(eAccess _type, int _address, out bool _isvalid)
return 0xff;
}

public bool Write(eAccess _type, int _port, byte _value)
public bool Write(eAccess _type, int _port, int _id, byte _value)
{
if (_type == eAccess.NextReg_Write && _port == REG_00_MACHINE_ID)
{
Expand Down Expand Up @@ -160,5 +160,14 @@ public void Tick()
public void Quit()
{
}

public bool KeyPressed(int _id)
{
return false;
}

public void Reset()
{
}
}
}
13 changes: 11 additions & 2 deletions UARTLogger/UARTLogger_Device.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public void Quit()
}
}

public bool Write(eAccess _type, int _port, byte _value)
public bool Write(eAccess _type, int _port, int _id, byte _value)
{
switch (_port)
{
Expand All @@ -66,7 +66,7 @@ public bool Write(eAccess _type, int _port, byte _value)
return false;
}

public byte Read(eAccess _type, int _port, out bool _isvalid)
public byte Read(eAccess _type, int _port, int _id, out bool _isvalid)
{
switch (_port)
{
Expand Down Expand Up @@ -97,5 +97,14 @@ public byte Read(eAccess _type, int _port, out bool _isvalid)
public void Tick()
{
}

public bool KeyPressed(int _id)
{
return false;
}

public void Reset()
{
}
}
}
3 changes: 2 additions & 1 deletion UARTReplacement/SerialPort.cs
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,7 @@ public int Baud

public void Reset(byte ResetByte)
{
if (port is null) return;
// bit 7 = Indicates the reset signal to the expansion bus and esp is asserted
bool resetESP = (ResetByte & 128) == 128;
if (resetESP)
Expand All @@ -216,7 +217,7 @@ public void EnableEspGpio(byte EnableByte)

public void SetEspGpio(byte GpioByte)
{
if (enableEspGpio)
if (enableEspGpio || port is null)
return;

// bit 0 = Read / Write ESP GPIO0 (hard reset = 1)
Expand Down
13 changes: 11 additions & 2 deletions UARTReplacement/UARTReplacement_Device.cs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public void Quit()
}
}

public bool Write(eAccess _type, int _port, byte _value)
public bool Write(eAccess _type, int _port, int _id, byte _value)
{
switch (_port)
{
Expand Down Expand Up @@ -118,7 +118,7 @@ public bool Write(eAccess _type, int _port, byte _value)
return false;
}

public byte Read(eAccess _type, int _port, out bool _isvalid)
public byte Read(eAccess _type, int _port, int _id, out bool _isvalid)
{
switch (_port)
{
Expand Down Expand Up @@ -215,6 +215,15 @@ public void ESPWork()
public void Tick()
{
}

public bool KeyPressed(int _id)
{
return false;
}

public void Reset()
{
}
}
}

13 changes: 11 additions & 2 deletions i2C_Sample/Class1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public void Quit()
/// <param name="_port">the port being written to</param>
/// <param name="_value">the value to write</param>
// **********************************************************************
public bool Write(eAccess _type, int _port, byte _value)
public bool Write(eAccess _type, int _port, int _id, byte _value)
{
switch (_port)
{
Expand All @@ -79,7 +79,7 @@ public bool Write(eAccess _type, int _port, byte _value)
/// <param name="_isvalid"></param>
/// <returns></returns>
// **********************************************************************
public byte Read(eAccess _type, int _port, out bool _isvalid)
public byte Read(eAccess _type, int _port, int _id, out bool _isvalid)
{
switch (_port)
{
Expand All @@ -93,5 +93,14 @@ public byte Read(eAccess _type, int _port, out bool _isvalid)
public void Tick()
{
}

public bool KeyPressed(int _id)
{
return false;
}

public void Reset()
{
}
}
}

0 comments on commit 26bb2b1

Please sign in to comment.