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

dc1394error_t dc1394_feature_set_absolute_control ( dc1394camera_t camera,
dc1394feature_t  feature,
dc1394switch_t  pwr 
)

Sets the feature in absolute control mode (ON/OFF)

Definition at line 1745 of file control.c.

References dc1394_get_control_register(), and dc1394_set_control_register().

{
    dc1394error_t err;
    uint64_t offset;
    uint32_t curval;

    if ( (feature<DC1394_FEATURE_MIN) || (feature>DC1394_FEATURE_MAX) )
        return DC1394_INVALID_FEATURE;

    FEATURE_TO_VALUE_OFFSET(feature, offset);

    err=dc1394_get_control_register(camera, offset, &curval);
    DC1394_ERR_RTN(err, "Could not get abs setting status for feature");

    if (pwr && !(curval & 0x40000000UL)) {
        curval|= 0x40000000UL;
        err=dc1394_set_control_register(camera, offset, curval);
        DC1394_ERR_RTN(err, "Could not set absolute control for feature");
    }
    else if (!pwr && (curval & 0x40000000UL)) {
        curval&= 0xBFFFFFFFUL;
        err=dc1394_set_control_register(camera, offset, curval);
        DC1394_ERR_RTN(err, "Could not set absolute control for feature");
    }

    return err;
}


Generated by  Doxygen 1.6.0   Back to index