Logo Search packages:      
Sourcecode: libdc1394-22 version File versions  Download package

dc1394error_t dc1394_avt_set_io ( dc1394camera_t camera,
uint32_t  IO,
dc1394bool_t  polarity,
uint32_t  mode,
dc1394bool_t  pinstate 
)

Set the polarity, the mode and the state of the IO

Definition at line 930 of file avt.c.

References dc1394_get_adv_control_register(), and dc1394_set_adv_control_register().

{
    dc1394error_t err;
    uint32_t curval;

    /* Retrieve current IO parameters */
    err=dc1394_get_adv_control_register(camera,IO, &curval);
    DC1394_ERR_RTN(err,"Could not get AVT IO register");

    /* polarity : Bit 7 */
    curval = (curval & 0xFEFFFFFFUL) | ((polarity ) << 24);

    /* mode : Bits 11..15 */
    curval = (curval & 0xFFE0FFFFUL) | ((mode << 16) & 0x1F0000UL );

    /* Pin state: bit 31 */
    if (mode==1)
        curval = (curval & 0xFFFFFFFEUL) | pinstate;

    /* Set  new IO parameters */
    err=dc1394_set_adv_control_register(camera,IO, curval);
    DC1394_ERR_RTN(err,"Could not set AVT IO register");

    return DC1394_SUCCESS;
}


Generated by  Doxygen 1.6.0   Back to index