更新 UART_kx12A6_event.cs
修改TransmitCharacter函数
This commit is contained in:
@@ -11,7 +11,7 @@ using Antmicro.Renode.Peripherals.Bus;
|
|||||||
using Antmicro.Renode.Peripherals.UART;
|
using Antmicro.Renode.Peripherals.UART;
|
||||||
using Antmicro.Renode.Utilities;
|
using Antmicro.Renode.Utilities;
|
||||||
using Antmicro.Renode.Time;
|
using Antmicro.Renode.Time;
|
||||||
// using Antmicro.Migrant;
|
using Antmicro.Migrant;
|
||||||
|
|
||||||
namespace Antmicro.Renode.Peripherals.CustomPeripherals
|
namespace Antmicro.Renode.Peripherals.CustomPeripherals
|
||||||
{
|
{
|
||||||
@@ -111,19 +111,13 @@ namespace Antmicro.Renode.Peripherals.CustomPeripherals
|
|||||||
{
|
{
|
||||||
|
|
||||||
case (long)Registers.FSTA: // FIFO状态寄存器
|
case (long)Registers.FSTA: // FIFO状态寄存器
|
||||||
lock(txFifoLock)
|
value = (byte)(fsta & 0xFF);
|
||||||
{
|
|
||||||
value = (byte)(fsta & 0xFF);
|
|
||||||
}
|
|
||||||
this.Log(LogLevel.Info, "Read FSTA: 0x{0:X2}", value);
|
this.Log(LogLevel.Info, "Read FSTA: 0x{0:X2}", value);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case (long)Registers.FRM_CNT: //帧计数,待定
|
case (long)Registers.FRM_CNT: //帧计数,待定
|
||||||
lock(txFifoLock)
|
value = (uint)frm_cnt;
|
||||||
{
|
this.Log(LogLevel.Info, "Read TBR_FreeBytes: {0}", value);
|
||||||
value = (uint)frm_cnt;
|
|
||||||
}
|
|
||||||
this.Log(LogLevel.Info, "Read FRM_CNT: {0}", value);
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case (long)Registers.TBR_FreeBytes: //发送FIFO剩余字节数
|
case (long)Registers.TBR_FreeBytes: //发送FIFO剩余字节数
|
||||||
@@ -425,7 +419,12 @@ namespace Antmicro.Renode.Peripherals.CustomPeripherals
|
|||||||
public uint GetByteCount() => byte_cnt;
|
public uint GetByteCount() => byte_cnt;
|
||||||
public ushort GetFrameCount() => frm_cnt;
|
public ushort GetFrameCount() => frm_cnt;
|
||||||
|
|
||||||
private void TransmitCharacter(byte data) { }
|
public event Action<byte> CharReceived;
|
||||||
|
|
||||||
|
private void TransmitCharacter(byte data)
|
||||||
|
{
|
||||||
|
CharReceived?.Invoke(data);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public long Size => 0x80; //uart地址长度总空间
|
public long Size => 0x80; //uart地址长度总空间
|
||||||
|
|||||||
Reference in New Issue
Block a user