Lines Matching refs:cal
296 usb_RestoreCalData( Plustek_Device *dev, CalData *cal )
301 regs[0x3b] = (u_char)cal->red_gain;
302 regs[0x3c] = (u_char)cal->green_gain;
303 regs[0x3d] = (u_char)cal->blue_gain;
304 regs[0x38] = (u_char)cal->red_offs;
305 regs[0x39] = (u_char)cal->green_offs;
306 regs[0x3a] = (u_char)cal->blue_offs;
308 regs[0x2a] = _HIBYTE((u_short)cal->light.green_pwm_duty);
309 regs[0x2b] = _LOBYTE((u_short)cal->light.green_pwm_duty);
311 regs[0x2c] = _HIBYTE((u_short)cal->light.red_light_on);
312 regs[0x2d] = _LOBYTE((u_short)cal->light.red_light_on);
313 regs[0x2e] = _HIBYTE((u_short)cal->light.red_light_off);
314 regs[0x2f] = _LOBYTE((u_short)cal->light.red_light_off);
316 regs[0x30] = _HIBYTE((u_short)cal->light.green_light_on);
317 regs[0x31] = _LOBYTE((u_short)cal->light.green_light_on);
318 regs[0x32] = _HIBYTE((u_short)cal->light.green_light_off);
319 regs[0x33] = _LOBYTE((u_short)cal->light.green_light_off);
321 regs[0x34] = _HIBYTE((u_short)cal->light.blue_light_on);
322 regs[0x35] = _LOBYTE((u_short)cal->light.blue_light_on);
323 regs[0x36] = _HIBYTE((u_short)cal->light.blue_light_off);
324 regs[0x37] = _LOBYTE((u_short)cal->light.blue_light_off);
326 hw->red_lamp_on = (u_short)cal->light.red_light_on;
327 hw->red_lamp_off = (u_short)cal->light.red_light_off;
328 hw->green_lamp_on = (u_short)cal->light.green_light_on;
329 hw->green_lamp_off = (u_short)cal->light.green_light_off;
330 hw->blue_lamp_on = (u_short)cal->light.blue_light_on;
331 hw->blue_lamp_off = (u_short)cal->light.blue_light_off;
371 CalData cal;
386 sprintf( tmp, "%s-coarse.cal", dev->calFile );
424 &cal.red_gain, &cal.red_offs,
425 &cal.green_gain, &cal.green_offs,
426 &cal.blue_gain, &cal.blue_offs,
427 &cal.light.red_light_on, &cal.light.red_light_off,
428 &cal.light.green_light_on, &cal.light.green_light_off,
429 &cal.light.blue_light_on, &cal.light.blue_light_off,
430 &cal.light.green_pwm_duty );
433 usb_RestoreCalData( dev, &cal );
453 usb_PrepCalData( Plustek_Device *dev, CalData *cal )
457 memset( cal, 0, sizeof(CalData));
458 cal->version = _PT_CF_VERSION;
460 cal->red_gain = (u_short)regs[0x3b];
461 cal->green_gain = (u_short)regs[0x3c];
462 cal->blue_gain = (u_short)regs[0x3d];
463 cal->red_offs = (u_short)regs[0x38];
464 cal->green_offs = (u_short)regs[0x39];
465 cal->blue_offs = (u_short)regs[0x3a];
467 cal->light.green_pwm_duty = regs[0x2a] * 256 + regs[0x2b];
469 cal->light.red_light_on = regs[0x2c] * 256 + regs[0x2d];
470 cal->light.red_light_off = regs[0x2e] * 256 + regs[0x2f];
471 cal->light.green_light_on = regs[0x30] * 256 + regs[0x31];
472 cal->light.green_light_off = regs[0x32] * 256 + regs[0x33];
473 cal->light.blue_light_on = regs[0x34] * 256 + regs[0x35];
474 cal->light.blue_light_off = regs[0x36] * 256 + regs[0x37];
489 CalData cal;
505 sprintf( fn, "%s-coarse.cal", dev->calFile );
509 usb_PrepCalData ( dev, &cal );
515 cal.red_gain, cal.red_offs,
516 cal.green_gain, cal.green_offs,
517 cal.blue_gain, cal.blue_offs,
518 cal.light.red_light_on, cal.light.red_light_off,
519 cal.light.green_light_on, cal.light.green_light_off,
520 cal.light.blue_light_on, cal.light.blue_light_off,
521 cal.light.green_pwm_duty );
533 if( version == cal.version ) {
560 fprintf( fp, "version=0x%04X\n", cal.version );
591 sprintf( fn, "%s-fine.cal", dev->calFile );
677 sprintf( tmp, "%s-fine.cal", dev->calFile );