
69
Chapter 4
CTL_CODE(FILE_DEVICE_UNKNOWN, 0x950,
METHOD_BUFFERED, FILE_ANY_ACCESS)
#define IOCTL_STOP_BUZZER
CTL_CODE(FILE_DEVICE_UNKNOWN, 0x951,
METHOD_BUFFERED, FILE_ANY_ACCESS)
HANDLE hDev;
DWORD i, dwGot, dwNumReturned;
// LED & IO Test Program.
hDev = CreateFile( _T("ADV1:"), // Pointer to the name of
the port
GENERIC_READ | GENERIC_WRITE, //Access (read-write)
mode
0, // Share mode
NULL, // Pointer to the security attribute
OPEN_EXISTING, // How to open the serial port
0, // Port attributes
NULL ); // Handle to port with attribute
if (!hDev)
{
printf("Can't load ADV1 driver properly!\r\n");
return 0;
}
for(i=0; i<20; i++)
{
if( i & 0x01 )
{