| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
#ifndef DOSBOX_DIRECTSERIAL_WIN32_H |
| 23 |
#define DOSBOX_DIRECTSERIAL_WIN32_H |
| 24 |
|
| 25 |
#include "dosbox.h" |
| 26 |
|
| 27 |
#if C_DIRECTSERIAL |
| 28 |
|
| 29 |
#define DIRECTSERIAL_AVAILIBLE |
| 30 |
#include "serialport.h" |
| 31 |
|
| 32 |
#include "libserial.h" |
| 33 |
|
| 34 |
class CDirectSerial : public CSerial { |
| 35 |
public: |
| 36 |
CDirectSerial(Bitu id, CommandLine* cmd); |
| 37 |
~CDirectSerial(); |
| 38 |
|
| 39 |
void updatePortConfig(Bit16u divider, Bit8u lcr); |
| 40 |
void updateMSR(); |
| 41 |
void transmitByte(Bit8u val, bool first); |
| 42 |
void setBreak(bool value); |
| 43 |
|
| 44 |
void setRTSDTR(bool rts, bool dtr); |
| 45 |
void setRTS(bool val); |
| 46 |
void setDTR(bool val); |
| 47 |
void handleUpperEvent(Bit16u type); |
| 48 |
|
| 49 |
private: |
| 50 |
COMPORT comport; |
| 51 |
|
| 52 |
Bitu rx_state; |
| 53 |
#define D_RX_IDLE 0 |
| 54 |
#define D_RX_WAIT 1 |
| 55 |
#define D_RX_BLOCKED 2 |
| 56 |
#define D_RX_FASTWAIT 3 |
| 57 |
|
| 58 |
Bitu rx_retry; |
| 59 |
Bitu rx_retry_max; |
| 60 |
|
| 61 |
bool doReceive(); |
| 62 |
|
| 63 |
#if SERIAL_DEBUG |
| 64 |
bool dbgmsg_poll_block; |
| 65 |
bool dbgmsg_rx_block; |
| 66 |
#endif |
| 67 |
|
| 68 |
}; |
| 69 |
|
| 70 |
#endif |
| 71 |
#endif |