CH340

我想用CH340做一個(gè)簡(jiǎn)單的工具,單片機(jī)和上位機(jī)通信,單片機(jī)除了和CH340通信,還可以傳遞出兩個(gè)低電平信號(hào),我想用CH340得到這兩個(gè)低電平信號(hào),但不知道上位機(jī)如何檢測(cè)到傳遞過(guò)來(lái)的信號(hào),應(yīng)該用到的是CTS#和DSR#,請(qǐng)指導(dǎo)下在上位機(jī)程序中如何檢測(cè)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.



只有登錄才能回復(fù),可以選擇微信賬號(hào)登錄

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