Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

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.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top