📄 serialio.cs
字号:
//==========================================================================================
//
// WJ.Serial.SerialIO
// Copyright (c) 2006, WJ Communications, Inc.
//
// When enabled by the SERIAL_MODE "Conditional Compilation Constant", this class
// provides calls to an external "SerialIO.dll" to perform low level serial IO functions.
//
//==========================================================================================
using System;
using System.Runtime.InteropServices;
namespace WJ.Serial
{
/// <summary>
/// Class for calling a DLL that controls external IO lines when in Serial only mode.
/// The Reset, Bootload lines can be set high or low,
/// and power to the MPR can be turned on and off.
///
/// An external "SerialIO.dll" is required to actually perform these actions.
/// This class is only referenced when SERIAL_MODE "Conditional Compilation Constant" is defined
/// in Project->MPR DLL Properties->Configuration Properties->Build.
///
/// </summary>
public class SerialIO
{
/// <summary>
/// Set the Reset line to 5V (true) or 0V (false)
/// </summary>
/// <param name="bOn"></param>
[DllImport("SerialIO.dll", EntryPoint="SetResetLine")]
public static extern void SetResetLine(bool bOn);
/// <summary>
/// Set the BootLoad line to 5V (true) or 0V (false)
/// </summary>
/// <param name="bOn"></param>
[DllImport("SerialIO.dll", EntryPoint="SetBootloadLine")]
public static extern void SetBootloadLine(bool bOn);
/// <summary>
/// Set the Power line to 5V (true) or 0V (false)
/// </summary>
/// <param name="bOn"></param>
[DllImport("SerialIO.dll", EntryPoint="SetPowerState")]
public static extern void SetPowerState(bool bOn);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -