Using FT_SetEventNotification command for FT245BM

Status
Not open for further replies.

PyrO

Newbie level 6
Joined
May 8, 2006
Messages
11
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,373
hi everyone
I'm using FT245BM in my work and I want to use FT_SetEventNotification function in my software.I would appreciate it if anyone can provide me some example codes or instructions in C# for using this function.
Thanx
 

ft_seteventnotification c#

Code:
 //---------------------------------------------------------------------------

void __fastcall CanReceive::Execute()
	{
  HANDLE hEvent;
  unsigned int command;

  read = write = 0;
  Priority = tpNormal;
  FreeOnTerminate = true;
  hEvent = CreateEvent(NULL, false, false, "");
  FT_SetEventNotification(ftHandle, FT_EVENT_RXCHAR, hEvent);

  while(Terminated == False)
  	{
    WaitForSingleObject(hEvent, INFINITE);
    EnterCriticalSection(&Form1->CS);
    usb_Read(&RxMessage[write]);
    if(++write >= BUFFERSIZE){
    	write = 0;
      }
    LeaveCriticalSection(&Form1->CS);
    }
  }

//---------------------------------------------------------------------------
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…