Files
CapMachine/CapMachine.Wpf/CanDrive/ZlgCan/ZlgCanChannelOptions.cs

83 lines
2.3 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
using System;
namespace CapMachine.Wpf.CanDrive.ZlgCan
{
/// <summary>
/// ZLG CANFD 通道初始化参数。
/// </summary>
public sealed class ZlgCanFdChannelOptions
{
/// <summary>
/// 仲裁域波特率单位bps。例如 500000。
/// </summary>
public uint ArbitrationBaudRate { get; set; } = 500000;
/// <summary>
/// 数据域波特率单位bps。例如 2000000。
/// </summary>
public uint DataBaudRate { get; set; } = 2000000;
/// <summary>
/// 终端电阻。
/// </summary>
public bool EnableInternalResistance { get; set; } = true;
/// <summary>
/// 仅监听模式。
/// </summary>
public bool ListenOnly { get; set; } = false;
/// <summary>
/// 是否启用总线利用率上报。
/// </summary>
public bool EnableBusUsage { get; set; } = false;
/// <summary>
/// 总线利用率上报周期单位ms
/// </summary>
public int BusUsagePeriodMs { get; set; } = 500;
/// <summary>
/// 是否启用设备层“合并接收”ZCAN_ReceiveData
/// </summary>
public bool EnableMergeReceive { get; set; } = false;
/// <summary>
/// 合并接收缓冲区最大帧数量。
/// </summary>
public int MergeReceiveBufferFrames { get; set; } = 100;
}
/// <summary>
/// ZLG LIN 通道初始化参数。
/// </summary>
public sealed class ZlgLinChannelOptions
{
/// <summary>
/// LIN 模式true=主节点false=从节点。
/// </summary>
public bool IsMaster { get; set; } = true;
/// <summary>
/// 校验模式。
/// 1-经典校验2-增强校验3-自动。
/// </summary>
public byte ChecksumMode { get; set; } = 3;
/// <summary>
/// 最大数据长度8~64
/// </summary>
public byte MaxLength { get; set; } = 8;
/// <summary>
/// 波特率1000~20000
/// </summary>
public uint BaudRate { get; set; } = 19200;
/// <summary>
/// LIN 接收轮询等待时间ms
/// </summary>
public int ReceiveWaitMs { get; set; } = 10;
}
}