1 #ifndef HUEY_H 2 3 /* 4 * Argyll Color Correction System 5 * 6 * GretagMacbeth Huey related defines 7 * 8 * Author: Graeme W. Gill 9 * Date: 7/10/2007 10 * 11 * Copyright 2006 - 2013, Graeme W. Gill 12 * All rights reserved. 13 * 14 * (Based on i1disp.h) 15 * 16 * This material is licenced under the GNU GENERAL PUBLIC LICENSE Version 2 or later :- 17 * see the License2.txt file for licencing details. 18 */ 19 20 /* 21 If you make use of the instrument driver code here, please note 22 that it is the author(s) of the code who take responsibility 23 for its operation. Any problems or queries regarding driving 24 instruments with the Argyll drivers, should be directed to 25 the Argyll's author(s), and not to any other party. 26 27 If there is some instrument feature or function that you 28 would like supported here, it is recommended that you 29 contact Argyll's author(s) first, rather than attempt to 30 modify the software yourself, if you don't have firm knowledge 31 of the instrument communicate protocols. There is a chance 32 that an instrument could be damaged by an incautious command 33 sequence, and the instrument companies generally cannot and 34 will not support developers that they have not qualified 35 and agreed to support. 36 */ 37 38 #include "inst.h" 39 40 #ifdef __cplusplus 41 extern "C" { 42 #endif 43 44 /* Note: update huey_interp_error() and huey_interp_code() in huey.c */ 45 /* if anything of these #defines are added or subtracted */ 46 47 /* Fake Error codes */ 48 #define HUEY_INTERNAL_ERROR 0x61 /* Internal software error */ 49 #define HUEY_COMS_FAIL 0x62 /* Communication failure */ 50 #define HUEY_UNKNOWN_MODEL 0x63 /* Not an huey */ 51 #define HUEY_DATA_PARSE_ERROR 0x64 /* Read data parsing error */ 52 53 /* Real error code */ 54 #define HUEY_OK 0x00 55 56 /* Sub codes for device specific reasoning */ 57 #define HUEY_FLOAT_NOT_SET 0x01 58 #define HUEY_NOT_READY 0x02 59 60 #define HUEY_BAD_SERIAL_NUMBER 0x03 61 #define HUEY_BAD_LCD_CALIBRATION 0x04 62 #define HUEY_BAD_CRT_CALIBRATION 0x05 63 #define HUEY_EEPROM_WRITE_FAIL 0x06 64 65 #define HUEY_BAD_WR_LENGTH 0x07 66 #define HUEY_BAD_RD_LENGTH 0x08 67 #define HUEY_BAD_RET_CMD 0x09 68 #define HUEY_BAD_RET_STAT 0x0A 69 #define HUEY_UNEXPECTED_RET_VAL 0x0B 70 71 #define HUEY_BAD_STATUS 0x0C 72 #define HUEY_UNKNOWN_VERS_ID 0x0D 73 74 #define HUEY_BAD_COMMAND 0x0E /* Command isn't recognised by instrument */ 75 76 /* Internal errors */ 77 #define HUEY_BAD_REG_ADDRESS 0x20 78 #define HUEY_BAD_INT_THRESH 0x21 79 #define HUEY_NO_COMS 0x22 80 #define HUEY_NOT_INITED 0x23 81 #define HUEY_CANT_BLACK_CALIB 0x24 82 #define HUEY_CANT_MEASP_CALIB 0x25 83 #define HUEY_WRONG_DEVICE 0x26 84 85 86 /* HUEY communication object */ 87 struct _huey { 88 INST_OBJ_BASE 89 90 int lenovo; /* 0 = normal, 1 = 'huyL' */ 91 92 inst_mode mode; /* Currently selected mode */ 93 94 inst_opt_type trig; /* Reading trigger mode */ 95 96 /* EEPROM registers */ 97 /* Number is the register address, and B, S, W, F indicate the type/size */ 98 int ser_no; /* Serial number */ 99 100 double LCD_cal[9]; /* LCD 3x3 calibration matrix */ 101 int LCD_caltime; /* Calibration time in secs from January 1, 1970, UTC */ 102 103 double CRT_cal[9]; /* CRT 3x3 calibration matrix */ 104 int CRT_caltime; /* cal valid/time flag. 0xffffffff = invalid ?, */ 105 /* time in secs from January 1, 1970, UTC */ 106 107 double clk_prd; /* Master clock period, hard coded to 1e-6 */ 108 109 double dark_cal[3]; /* Dark current calibration values */ 110 111 char unlk_string[5]; /* Unlock string */ 112 113 double amb_cal; /* Ambient calibration value */ 114 115 /* Computed factors and state */ 116 double clk_freq; /* Inverted clk_prd, ie master clock frequency, typically apx 1e6 */ 117 118 int sampno; /* Number of CRT samples we're aiming to take, def 100 */ 119 int int_clocks; /* Integration time in clocks */ 120 121 inst_disptypesel *dtlist; /* Display Type list */ 122 int ndtlist; /* Number of valid dtlist entries */ 123 int icx; /* 0 = LCD, 1 = CRT matrix */ 124 disptech dtech; /* Display technology enum */ 125 int cbid; /* current calibration base ID, 0 if not a base */ 126 int ucbid; /* Underlying base ID if being used for matrix, 0 othewise */ 127 int refrmode; /* Refresh mode (always 0) */ 128 double ccmat[3][3]; /* Colorimeter correction matrix */ 129 130 /* Other state */ 131 int led_state; /* Current LED state */ 132 133 }; typedef struct _huey huey; 134 135 /* Constructor */ 136 extern huey *new_huey(icoms *icom, instType itype); 137 138 #ifdef __cplusplus 139 } 140 #endif 141 142 #define HUEY_H 143 #endif /* HUEY_H */ 144