EasyManuals Logo

THORLABS DCU22 Series Description And Sdk Manual

THORLABS DCU22 Series
513 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #299 background imageLoading...
Page #299 background image
© 2016 Thorlabs Scientific Imaging
4 Programming (SDK)
297
Example 10
INT nRet = IS_SUCCESS;
IO_GPIO_CONFIGURATION gpioConfiguration;
// Read information about GPIO1
gpioConfiguration.u32Gpio = IO_GPIO_1;
nRet = is_IO(hCam, IS_IO_CMD_GPIOS_GET_CONFIGURATION, (void*)&gpioConfiguration,
sizeof(gpioConfiguration) );
if (nRet == IS_SUCCESS)
{
if ((gpioConfiguration.u32Caps & IS_GPIO_PWM) != 0)
{
// GPIO1 supports PWM
}
if ((gpioConfiguration.u32Caps & IS_GPIO_FLASH) != 0)
{
// GPIO1 supports Flash
}
if (gpioConfiguration.u32Configuration == IS_GPIO_OUTPUT)
{
// GPIO1 is currently configured as output
if (gpioConfiguration.u32State == 1)
{
// GPIO1 is currently output HIGH
}
}
}
Example 11
INT nRet = IS_SUCCESS;
IO_GPIO_CONFIGURATION gpioConfiguration;
// Set configuration of GPIO1 (OUTPUT LOW)
gpioConfiguration.u32Gpio = IO_GPIO_1;
gpioConfiguration.u32Configuration = IS_GPIO_OUTPUT;
gpioConfiguration.u32State = 0;
nRet = is_IO(hCam, IS_IO_CMD_GPIOS_SET_CONFIGURATION, (void*)&gpioConfiguration,
sizeof(gpioConfiguration));
Example 12
INT nRet = IS_SUCCESS;
IO_GPIO_CONFIGURATION gpioConfiguration;
// Set configuration of GPIO1 (COM-port TX)
// GPIO1 configured as RX is not supported!
gpioConfiguration.u32Gpio = IO_GPIO_1;
gpioConfiguration.u32Configuration = IS_GPIO_COMPORT_TX;
// GPIO2 will be configured as IS_GPIO_COMPORT_RX automatically!
nRet = is_IO(hCam, IS_IO_CMD_GPIOS_SET_CONFIGURATION, (void*)&gpioConfiguration,
sizeof(gpioConfiguration));
// The following code leads to the same setting
// Set configuration of GPIO2 (COM-port RX)
gpioConfiguration.u32Gpio = IO_GPIO_2;
gpioConfiguration.u32Configuration = IS_GPIO_COMPORT_RX;
// GPIO1 will be configured as IS_GPIO_COMPORT_TX automatically!
nRet = is_IO(hCam, IS_IO_CMD_GPIOS_SET_CONFIGURATION, (void*)&gpioConfiguration,
sizeof(gpioConfiguration));

Table of Contents

Other manuals for THORLABS DCU22 Series

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the THORLABS DCU22 Series and is the answer not in the manual?

THORLABS DCU22 Series Specifications

General IconGeneral
BrandTHORLABS
ModelDCU22 Series
CategorySecurity Camera
LanguageEnglish

Related product manuals