User`s manual

Software Manual • EKF Intelligent I/O Controller Family On
CompactPCI
- 26 -
EKF Elektronik GmbH * Philipp-Reis-Str. 4 * D-59065 HAMM (Germany)
Tel. +49 (0)2381/6890-0 * Fax. +49 (0)2381/6890-90 * E-Mail info@ekf.de * Internet http://www.ekf.de
Most of these I/O controls are entered by the C function
DeviceIoControl
, nevertheless exists
a couple of specialized C functions. The general format of DeviceIoControl is:
BOOL DeviceIoControl(
HANDLE hDevice, // handle to device
DWORD dwIoControlCode, // operation
PVOID lpInBuffer, // input data buffer
DWORD nInBufferSize, // size of input data buffer
PVOID lpOutBuffer, // output data buffer
DWORD nOutBufferSize, // size of output data buffer
PDWORD lpBytesReturned, // byte count
POVERLAPPED lpOverlapped // overlapped information
);
DeviceIoControl
returns TRUE on success. If the I/O control request failed, FALSE is
returned and a call to
GetLastError
returns a corresponding error code.
The following sections will give a description of the I/O control requests supported by the
“ekf960si1" driver in alphabetical order.
Erase Firmware Flash ROMs: IOCTL_EKF960SI1_FLASH_ERASE
This I/O control request erases the firmware flash ROMs on an I/O controller.
Call: DeviceIoControl(
handle, // handle returned by
CreateFile
IOCTL_EKF960SI1_FLASH_ERASE,
NULL,
0,
NULL,
0,
&unused, // pointer to a DWORD variable
pOverlapped // optional pointer to overlapped buffer (may be NULL)
);
Caution:
Absolutely caution should be given when executing this I/O control request.
Use makes sense only if a new firmware binary is available that is
downloaded to the firmware flash ROMs with the I/O control request
IOCTL_EKF960SI1_FLASH_WRITE after erasing.
The board is no more
functional, if a hardware reset occurred while or after erasing.
The application may open any port that resides on the corresponding board when calling the
flash ROM erasure request. A call of IOCTL_EKF960SI1_LOCK should be done before
calling the erase request to avoid confusion, if several threads try to update the same board
firmware.