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

dc1394error_t dc1394_avt_set_dsnu ( dc1394camera_t camera,
dc1394bool_t  on_off,
dc1394bool_t  compute,
uint32_t  frame_nb 
)

Set DSNU mode, number of frames used for computing and launch the the computation of the dsnu frame

Definition at line 804 of file avt.c.

References dc1394_get_adv_control_register(), and dc1394_set_adv_control_register().

{
    dc1394error_t err;
    uint32_t curval;

    /* Retrieve current dsnu parameters */
    err=dc1394_get_adv_control_register(camera,REG_CAMERA_AVT_DSNU_CONTROL, &curval);
    DC1394_ERR_RTN(err,"Could not get AVT DSNU control");

    /* Compute : Bit 5 */
    curval = (curval & 0xFBFFFFFFUL) | ((compute ) << 26);

    /* ON / OFF : Bit 6 */
    curval = (curval & 0xFDFFFFFFUL) | ((!on_off ) << 25);

    /* Number of images : Bits 24..31 */
    curval = (curval & 0xFFFFFF00UL) | ((frame_nb & 0xFFUL ));

    /* Set new dsnu parameters */
    err=dc1394_set_adv_control_register(camera,REG_CAMERA_AVT_DSNU_CONTROL, curval);
    DC1394_ERR_RTN(err,"Could not set AVT DSNU control");

    int cont=1;
    while (cont) {
        usleep(50000);
        err=dc1394_get_adv_control_register(camera,REG_CAMERA_AVT_DSNU_CONTROL, &curval);
        DC1394_ERR_RTN(err,"Could not get AVT DSNU control");
        if ((curval & 0x01000000UL)==0)
            cont=0;
    }
    return DC1394_SUCCESS;
}


Generated by  Doxygen 1.6.0   Back to index