![Connect Tech DAG103 Скачать руководство пользователя страница 36](http://html.mh-extra.com/html/connect-tech/dag103/dag103_user-manual_2652840036.webp)
Xtreme I/O Express ADC-DAC
Users Guide
Document: CTIM-00435
Revision: 0.08
Page 36 of 47
Connect Tech Inc. 800-426-8979 | 519-836-1291
Date: 2016-11-18
GPIO_OUTPUT (Offset 0x0004 : Read/Write)
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9
8
7
6
5
4
3
2
1
0
Reserved / Future Use
Upper Byte GPIO Pins
Lower Byte GPIO Pins
This register controls the output logic state of any of the GPIO pins that are set to OUTPUTS via the
GPIO_COMMAND register. Each bit corresponds to the GPIO pin on the connector, IE bit-0 =
GPIO0 and bit-9 = GPIO9. Setting a ‘1’ to the bit will cause the output to be logic HIGH, setting a
‘0’ will cause the output to be low.
GPIO_CMD (Offset 0x0008 : Read/Write)
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9
8
7
6
5
4
3
2
1
0
Reserved / Future Use
UB LB
UB
0 = GPIO Pins 8 to 15 are set to OUTPUTS
1 = GPIO Pins 8 to 15 are set to INPUTS
LB
0 = GPIO Pins 0 to 7 are set to OUTPUTS
1 = GPIO Pins 0 to 7 are set to INPUTS
Application Examples
Example A – Walking 1’s and 0’s
printf(
"Setting Direction - Upper Byte Output -> Lower Byte Input\n"
);
CTIFPGAWrDword(pbrd, BarIndex, GPGPIO_CMD, 0x1);
// Walking 1 test
outgpio = 0x1;
ingpio = 0x0;
printf(
"Walking 1's\n"
);
for
(count=0; count<8;count++)
{
CTIFPGAWrByte(pbrd, BarIndex, GPGPIO0x1, outgpio);
CTIFPGARdByte(pbrd, BarIndex, GPGPIO_INPUT, &ingpio);
// Compare Values
if
(outgpio != ingpio){
printf(
" ERROR MIS-MATCH\n"
);
result = FALSE;
}
else
printf(
"OK!\n"
);
// Shift the 1 over
outgpio = outgpio << 1;
}
// Walking 0 test
outgpio = 0xFE;
printf(
"Walking 0's\n"
);