![Sonifex avn PC-AD2 Скачать руководство пользователя страница 19](http://html1.mh-extra.com/html/sonifex/avn-pc-ad2/avn-pc-ad2_handbook_1321191019.webp)
11
PC-AD2 - GPIO 4
4. GPIO
The PC-AD2 has two optically-isolated general purpose inputs and outputs
which are accessed through a programming API supplied with the driver
package.
The API library itself is in the PCAD2.dll file. To access this from your
application software, insert the header file PCAD2.h into your source and
link to the library file PCAD2.lib. 32-bit and 64-bit versions of these files are
provided.
The API consists of four functions as follows.
HANDLE
PCAD2Open
(unsigned
CardInstance)
;
This returns a handle to the card for use with the other API functions. When
no longer required, this handle must be closed by calling the Windows
function
CloseHandle
.
When multiple cards are in use,
CardInstance
selects the card. If only one
card is present, set this to zero.
unsigned
PCAD2GetGPI
(HANDLE
CardHandle)
;
This returns the state of the two general purpose inputs in the least
significant bits. Set CardHandle to the handle returned from
PCAD2Open
.
void
PCAD2SetGPO
(HANDLE
CardHandle
, unsigned Outputs);
This sets the state of the two general purpose outputs from the least
significant bits of Outputs. Set
CardHandle
to the handle returned from
PCAD2Open
.
__int64
PCAD2GetHardwareID
(HANDLE
CardHandle
);
This returns the unique 64-bit hardware identifier for the card. It can be
used to disambiguate multiple cards. The same identifier is shown on the
card’s Configuration page in Device Manager.
A simple demonstration program is included with the driver package
to illustrate the operation of the GPIO API and to quickly test the GPIO
functionality.
Fig 4-1: PC-AD2 GPIO Demonstration Screen
The input indicators will glow yellow when the corresponding inputs are
active, while holding down the left mouse button on the output buttons will
activate the corresponding outputs.
Содержание avn PC-AD2
Страница 21: ...Notes ...
Страница 22: ...Notes ...
Страница 23: ...Notes ...
Страница 24: ...www sonifex co uk t 44 0 1933 650 700 f 44 0 1933 650 726 sales sonifex co uk ...