CH340

我想用CH340做一個簡單的工具,單片機和上位機通信,單片機除了和CH340通信,還可以傳遞出兩個低電平信號,我想用CH340得到這兩個低電平信號,但不知道上位機如何檢測到傳遞過來的信號,應該用到的是CTS#和DSR#,請指導下在上位機程序中如何檢測CTS#和DSR#變?yōu)榈碗娖剑?/p>

到參看一下windows API 函數(shù) GetCommModemStatus 的使用。

Syntax

BOOL?WINAPI?GetCommModemStatus(
??__in???HANDLE?hFile,
??__out??LPDWORD?lpModemStat);

Parameters

  • hFile

  • A handle to the communications device. The CreateFile function returns this handle.

  • lpModemStat

  • A pointer to a variable that receives the current state of the modem control-register values. This parameter can be one or more of the following values.

    ValueMeaning

    MS_CTS_ON
    0x0010

    The CTS (clear-to-send) signal is on.

    MS_DSR_ON
    0x0020

    The DSR (data-set-ready) signal is on.

    MS_RING_ON
    0x0040

    The ring indicator signal is on.

    MS_RLSD_ON
    0x0080

    The RLSD (receive-line-signal-detect) signal is on.



只有登錄才能回復,可以選擇微信賬號登錄

国产91精品新入口,国产成人综合网在线播放,九热这里只有精品,本道在线观看,美女视频a美女视频,韩国美女激情视频,日本美女pvp视频