OpenCores
URL https://opencores.org/ocsvn/miniuart2/miniuart2/trunk

Subversion Repositories miniuart2

[/] [miniuart2/] [trunk/] [sw/] [TestCom/] [Thread.h] - Blame information for rev 3

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 philippe
//---------------------------------------------------------------------------
2
#ifndef ThreadH
3
#define ThreadH
4
//---------------------------------------------------------------------------
5
#include <Classes.hpp>
6
 
7
#define READ_TIMEOUT 500   // milliseconds
8
 
9
#define TWMD_WITH_GLERR 1
10
#define TWMD_AND_CLOSE  2
11
 
12
struct stErr
13
{
14
   DWORD Err;
15
   AnsiString asMsg;
16
};
17
 
18
 
19
//---------------------------------------------------------------------------
20
class Thread_Com : public TThread
21
{
22
enum {CANT_OPEN_COM = 1, CANT_CONFIG_COM, CREATE_EV_ERROR, ERR_READ_COM,
23
        ERR_READOVER_COM, ERR_READWAIT_COM, ERR_WRITE_COM};
24
 
25
private:
26
protected:
27
 
28
   void __fastcall Execute();
29
   void __fastcall HandleASuccessfulRead(char c);
30
public:
31
   int NumPort;
32
   int BaudRate;
33
        int dwLastErr;
34
        AnsiString sLastErr;
35
   BOOL __fastcall WriteToComPort(AnsiString ASbuf);
36
   __fastcall Thread_Com(bool CreateSuspended, int NumPortD, int BaudRate);
37
    virtual void __fastcall AfterConstruction();
38
};
39
//---------------------------------------------------------------------------
40
BOOL WriteToComPort(AnsiString ASbuf);
41
BOOL ChangePort(int PortNum);
42
#endif

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.