Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Usage of pins is made easy with the Keith & Koep Seco drvlib_app.dll:

Code Block
#include "windows.h"
#define  CPLUSPLUS 1
#include "drvlib_app.h"

int WINAPI WinMain( HINSTANCE hInstance,
                    HINSTANCE hPrevInstance,
                    LPTSTR    lpCmdLine,
                    int       nCmdShow)
{
   PGIO_REGS ptr;
   unsigned long arg_l = 0;
   BOOL state;
 
   arg_l=_wtol(lpCmdLine);

   ptr = GPIO_AllocSpace();
    
   state = GPIO_Get_Pin( ptr, (unsigned char)arg_l);
   GPIO_Init_Pin(ptr, (unsigned char)arg_l, TRUE, !state);
   Sleep(3000);
   GPIO_Set_Pin( ptr, (unsigned char) arg_l, state);
   
   GPIO_FreeSpace();
   return 0;
}

...