Programming Guide
163
Proprietary properties
Except standard APIs, we also provide a proprietary IO control
which can read and write external general purpose IO pin.
/* configure the direction (in or out) of each
gpio bit prior to reading or writing gpio.
*/
int config_gpio (void)
{
unsigned int value = 0xC3FEFF;
if (-1 == ioctl (fd,
BT878_S_GPIO_OUT_ENABLE, &value))
return -1;
return 0;
}
int read_gpio (void)
{
unsigned int value;
if (-1 == ioctl (fd, BT878_G_GPIO_VALUE,
&value))
return -1;
value &= 0x100;// bit 8 is used to store the
input value
if(value)
return 1;
else
return 0;
}
int write_gpio (int value)
{
unsigned int gpio;
if (-1 == ioctl (fd, BT878_G_GPIO_VALUE,
&gpio))
return -1;
gpio |= 0x40;// bit 6 is used to set the
output
if(value)
gpio -= 0x40;
if (-1 == ioctl (fd, BT878_S_GPIO_VALUE,
&gpio))
return -1;
return 0;
}
Summary of Contents for cRTV-24
Page 4: ......
Page 8: ...List of Tables iv Table 5 2 C C Data Types 83 Table 5 3 Pixel Data 122 ...
Page 10: ......
Page 18: ...8 Introduction ...
Page 34: ...24 Hardware Reference Figure 2 8 STRG Address Jumpers ...
Page 55: ...Installation Guide 45 Figure 3 2 cRTV 24 3U cPCI ...
Page 61: ...Installation Guide 51 ...
Page 62: ...52 Installation Guide ...
Page 64: ...54 Installation Guide The Device Manager should be as follows ...
Page 67: ...Installation Guide 57 ...
Page 68: ...58 Installation Guide 3 When the following window appears please click Con tinue Anyway ...
Page 70: ...60 Installation Guide The Device Manager should be as follows ...
Page 72: ...62 Installation Guide 3 Click the Finish button to finish the installation ...
Page 76: ...66 Installation Guide ...
Page 144: ...134 Function Library ...
Page 174: ...164 Programming Guide ...