3.3 Initialization and Exit Function Calls for Windows

All the demo applications begin with the following functions and should be called in sequence to initialize the JNMM-4LP-XT Driver.

  1. JNMMCANOpen() : This function opens a handle to access the Diamond JNMM CAN driver and returns the handle value..

  2. JNMMCANClose() : This function closes the access to the Diamond JNMM CAN driver.

These function calls are important in opening and closing the handle.

int main()
{

HANDLE hHandle;
int flag;

hHandle = JNMMCANOpen(&flag);

if(hHandle == -1)
{
   return 0;
}

if(flag==1) // ISA mode
{
   printf("JNMMCAN4LP-XT-ISA mode ");
   Base_address = 0x6000;
   JNMMCANBaseAddrInit(base_address);
   Diobase_address = 0x140;
   JNMMCANDIOAddrInit(diobase_address);		
}

JNMMCANClose(hHandle);

}

Last updated