Boot into to the flash memory. IN: [1:cmd] OUT: [1:retval][1:cmd] This command is available under these conditions: | Bootloader | Firmware ---------------+--------------+----------- ColorHug | ✓ | × ColorHug2 | ✓ | × ColorHug+ | ✓ | × ColorHugALS | ✓ | × Clears any recorded error on the device. PROTOCOLv2: bRequest: [cmd] wValue: 0x00 wIndex: interface wLength: 0x00 Direction: DEVICE->HOST Data: [] This command is available under these conditions: | Bootloader | Firmware ---------------+--------------+----------- ColorHug | × | × ColorHug2 | × | × ColorHug+ | × | ✓ ColorHugALS | × | × Erases flash memory before a write is done. Erasing flash can only be done in 1k byte chunks and should be aligned to 1k. IN: [1:cmd][2:address][2:length] OUT: [1:retval][1:cmd] This command is available under these conditions: | Bootloader | Firmware ---------------+--------------+----------- ColorHug | ✓ | × ColorHug2 | ✓ | × ColorHug+ | ✓ | × ColorHugALS | ✓ | × Gets the value of the Vref- ADC adjustment. @vref is a packed float. IN: [1:cmd] OUT: [1:retval][1:cmd][4:vref] This command is available under these conditions: | Bootloader | Firmware ---------------+--------------+----------- ColorHug | × | × ColorHug2 | × | × ColorHug+ | × | ✓ ColorHugALS | × | × Gets the value of the Vref+ ADC adjustment. @vref is a packed float. IN: [1:cmd] OUT: [1:retval][1:cmd][4:vref] This command is available under these conditions: | Bootloader | Firmware ---------------+--------------+----------- ColorHug | × | × ColorHug2 | × | × ColorHug+ | × | ✓ ColorHugALS | × | × Gets the calibration matrix. The description does not have to be NULL terminated. @types is a bitmask which corresponds to: bit: 0 Can be used with LCD panels 1 Can be used with CRT monitors 2 Can be used with projectors 3 Can be used with LED panels 4-7 Reserved for future use IN: [1:cmd][2:index] OUT: [1:retval][1:cmd][2*9:matrix_value][1:types][23:description] This command is available under these conditions: | Bootloader | Firmware ---------------+--------------+----------- ColorHug | × | ✓ ColorHug2 | × | ✓ ColorHug+ | × | × ColorHugALS | × | × Get the mappings from default calibration type to calibration indexes. The calibration types are as follows: LCD = 0 CRT = 1 Projector = 2 LED = 3 Custom1 = 4 Custom2 = 5 In the future CustomX may be renamed to another display technology, e.g. e-ink. IN: [1:cmd] OUT: [1:retval][1:cmd][6*2:types] This command is available under these conditions: | Bootloader | Firmware ---------------+--------------+----------- ColorHug | × | ✓ ColorHug2 | × | ✓ ColorHug+ | × | × ColorHugALS | × | × Gets the spectral indexes for the RGB calibration which are values between 0 and %CH_CCD_SPECTRAL_RESOLUTION pointing to the dominant peak for the color. Red is nominally 625nm, green 520nm and blue 465nm. IN: [1:cmd] OUT: [1:retval][1:cmd][2:red-idx][2:green-idx][2:blue-idx] This command is available under these conditions: | Bootloader | Firmware ---------------+--------------+----------- ColorHug | × | × ColorHug2 | × | × ColorHug+ | × | ✓ ColorHugALS | × | × Get the color select state. IN: [1:cmd] OUT: [1:retval][1:cmd][1:color_select] This command is available under these conditions: | Bootloader | Firmware ---------------+--------------+----------- ColorHug | × | ✓ ColorHug2 | × | × ColorHug+ | × | × ColorHugALS | × | ✓ Get the DAC value. @scale is a packed float, where 1.0f is 3.3V IN: [1:cmd] OUT: [1:retval][1:cmd][4:value] This command is available under these conditions: | Bootloader | Firmware ---------------+--------------+----------- ColorHug | × | × ColorHug2 | × | × ColorHug+ | × | ✓ ColorHugALS | × | × Get the dark offsets. IN: [1:cmd] OUT: [1:retval][1:cmd][2:red][2:green][2:blue] This command is available under these conditions: | Bootloader | Firmware ---------------+--------------+----------- ColorHug | × | ✓ ColorHug2 | × | × ColorHug+ | × | ✓ ColorHugALS | × | × Gets any recorded error from the device. PROTOCOLv2: bRequest: [cmd] wValue: 0x00 wIndex: interface wLength: 0x00 Direction: DEVICE->HOST Data: [1:error][1:cmd] This command is available under these conditions: | Bootloader | Firmware ---------------+--------------+----------- ColorHug | × | × ColorHug2 | × | × ColorHug+ | × | ✓ ColorHugALS | × | × Gets the firmware version. IN: [1:cmd] OUT: [1:retval][1:cmd][2:major][2:minor][2:micro] This command is available under these conditions: | Bootloader | Firmware ---------------+--------------+----------- ColorHug | ✓ | ✓ ColorHug2 | ✓ | ✓ ColorHug+ | ✓ | ✓ ColorHugALS | ✓ | ✓ Get the hardware version. The hardware versions are as follows: 0x00 = Pre-production hardware 0x01 = ColorHug 0x02 = ColorHug2 0x03 = ColorHug+ 0x04 = ColorHugALS 0x05-0x0f = Reserved for future use IN: [1:cmd] OUT: [1:retval][1:cmd][1:hw_version] This command is available under these conditions: | Bootloader | Firmware ---------------+--------------+----------- ColorHug | ✓ | ✓ ColorHug2 | ✓ | ✓ ColorHug+ | ✓ | ✓ ColorHugALS | ✓ | ✓ Get the illuminant state. IN: [1:cmd] OUT: [1:retval][1:cmd][1:illuminants] This command is available under these conditions: | Bootloader | Firmware ---------------+--------------+----------- ColorHug | × | × ColorHug2 | × | × ColorHug+ | × | ✓ ColorHugALS | × | × Gets the integral time. IN: [1:cmd] OUT: [1:retval][1:cmd][2:integral_time] This command is available under these conditions: | Bootloader | Firmware ---------------+--------------+----------- ColorHug | × | ✓ ColorHug2 | × | × ColorHug+ | × | ✓ ColorHugALS | × | ✓ Get the LED state. IN: [1:cmd] OUT: [1:retval][1:cmd][1:led_state] This command is available under these conditions: | Bootloader | Firmware ---------------+--------------+----------- ColorHug | × | ✓ ColorHug2 | × | ✓ ColorHug+ | × | ✓ ColorHugALS | ✓ | ✓ Gets the measurement mode. IN: [1:cmd] OUT: [1:retval][1:cmd][1:measure_mode] This command is available under these conditions: | Bootloader | Firmware ---------------+--------------+----------- ColorHug | × | ✓ ColorHug2 | × | × ColorHug+ | × | × ColorHugALS | × | × Gets the multiplier value. IN: [1:cmd] OUT: [1:retval][1:cmd][1:multiplier_value] This command is available under these conditions: | Bootloader | Firmware ---------------+--------------+----------- ColorHug | × | ✓ ColorHug2 | × | × ColorHug+ | × | × ColorHugALS | × | ✓ Get User's Email Address IN: [1:cmd] OUT: [1:retval][1:cmd][60:owner-email] This command is available under these conditions: | Bootloader | Firmware ---------------+--------------+----------- ColorHug | × | ✓ ColorHug2 | × | ✓ ColorHug+ | × | ✓ ColorHugALS | × | × Get User's Name IN: [1:cmd] OUT: [1:retval][1:cmd][60:owner-name] This command is available under these conditions: | Bootloader | Firmware ---------------+--------------+----------- ColorHug | × | ✓ ColorHug2 | × | ✓ ColorHug+ | × | ✓ ColorHugALS | × | × Gets the board errata value. IN: [1:cmd] OUT: [1:retval][1:cmd][2:pcb_errata] This command is available under these conditions: | Bootloader | Firmware ---------------+--------------+----------- ColorHug | × | ✓ ColorHug2 | × | ✓ ColorHug+ | × | ✓ ColorHugALS | × | × Get the post XYZ scaling constant. @scale is a packed float. IN: [1:cmd] OUT: [1:retval][1:cmd][4:scale] This command is available under these conditions: | Bootloader | Firmware ---------------+--------------+----------- ColorHug | × | ✓ ColorHug2 | × | × ColorHug+ | × | × ColorHugALS | × | × Get the pre XYZ scaling constant. @scale is a packed float. IN: [1:cmd] OUT: [1:retval][1:cmd][4:scale] This command is available under these conditions: | Bootloader | Firmware ---------------+--------------+----------- ColorHug | × | ✓ ColorHug2 | × | × ColorHug+ | × | × ColorHugALS | × | × Gets the remote hash which is used to get the last profile saved to a public web service. IN: [1:cmd] OUT: [1:retval][1:cmd][20:sha1_hash] This command is available under these conditions: | Bootloader | Firmware ---------------+--------------+----------- ColorHug | × | ✓ ColorHug2 | × | ✓ ColorHug+ | × | ✓ ColorHugALS | × | × Gets the device serial number. IN: [1:cmd] OUT: [1:retval][1:cmd][4:serial_number] This command is available under these conditions: | Bootloader | Firmware ---------------+--------------+----------- ColorHug | × | ✓ ColorHug2 | × | ✓ ColorHug+ | × | ✓ ColorHugALS | × | ✓ Gets the temperature of the sensor in degrees celsius IN: [1:cmd] OUT: [1:retval][1:cmd][4:temperature] This command is available under these conditions: | Bootloader | Firmware ---------------+--------------+----------- ColorHug | × | × ColorHug2 | × | ✓ ColorHug+ | × | ✓ ColorHugALS | × | × Load the SRAM from the EEPROM. PROTOCOLv2: bRequest: [cmd] wValue: 0x00 wIndex: interface wLength: 0x00 Direction: DEVICE->HOST Data: [1:error][1:cmd] This command is available under these conditions: | Bootloader | Firmware ---------------+--------------+----------- ColorHug | × | × ColorHug2 | × | × ColorHug+ | × | ✓ ColorHugALS | × | × Read in raw data from the flash memory. IN: [1:cmd][2:address][1:length] OUT: [1:retval][1:cmd][1:checksum][1-60:data] This command is available under these conditions: | Bootloader | Firmware ---------------+--------------+----------- ColorHug | ✓ | × ColorHug2 | ✓ | × ColorHug+ | ✓ | × ColorHugALS | ✓ | × Read in raw data from the SRAM memory. PROTOCOLv1: IN: [1:cmd][2:address][1:length] OUT: [1:retval][1:cmd][1-60:data] PROTOCOLv2: bRequest: [cmd] wValue: [address-index/64] wIndex: interface wLength: 0x64 Direction: DEVICE->HOST Data: [64:DATA] This command is available under these conditions: | Bootloader | Firmware ---------------+--------------+----------- ColorHug | × | × ColorHug2 | × | ✓ ColorHug+ | × | ✓ ColorHugALS | × | × Reset the processor. IN: [1:cmd] OUT: [1:retval][1:cmd] (but with success the device will disconnect) This command is available under these conditions: | Bootloader | Firmware ---------------+--------------+----------- ColorHug | ✓ | ✓ ColorHug2 | ✓ | ✓ ColorHug+ | ✓ | ✓ ColorHugALS | ✓ | ✓ Save the SRAM to the EEPROM. PROTOCOLv2: bRequest: [cmd] wValue: 0x00 wIndex: interface wLength: 0x00 Direction: DEVICE->HOST Data: [1:error][1:cmd] This command is available under these conditions: | Bootloader | Firmware ---------------+--------------+----------- ColorHug | × | × ColorHug2 | × | × ColorHug+ | × | ✓ ColorHugALS | × | × Tests the device by trying to get a non-zero reading from each color channel. IN: [1:cmd] OUT: [1:retval][1:cmd] This command is available under these conditions: | Bootloader | Firmware ---------------+--------------+----------- ColorHug | ✓ | ✓ ColorHug2 | ✓ | ✓ ColorHug+ | ✓ | ✓ ColorHugALS | ✓ | × Sets the calibration matrix. IN: [1:cmd][2:index][4*9:matrix_value][1:types][23:description] OUT: [1:retval][1:cmd] This command is available under these conditions: | Bootloader | Firmware ---------------+--------------+----------- ColorHug | × | ✓ ColorHug2 | × | ✓ ColorHug+ | × | × ColorHugALS | × | × Set the calibration type to index map. IN: [1:cmd][6*2:types] OUT: [1:retval][1:cmd] This command is available under these conditions: | Bootloader | Firmware ---------------+--------------+----------- ColorHug | × | ✓ ColorHug2 | × | ✓ ColorHug+ | × | × ColorHugALS | × | × Sets the spectral indexes for the RGB calibration. IN: [1:cmd][2:red-idx][2:green-idx][2:blue-idx] OUT: [1:retval][1:cmd] This command is available under these conditions: | Bootloader | Firmware ---------------+--------------+----------- ColorHug | × | × ColorHug2 | × | × ColorHug+ | × | ✓ ColorHugALS | × | × Set the color select state. IN: [1:cmd][1:color_select] OUT: [1:retval][1:cmd] This command is available under these conditions: | Bootloader | Firmware ---------------+--------------+----------- ColorHug | × | ✓ ColorHug2 | × | × ColorHug+ | × | × ColorHugALS | × | ✓ Sets the 128 bit encryption key for the device. PROTOCOLv2: bRequest: [cmd] wValue: 0x00 wIndex: interface wLength: 0x00 Direction: DEVICE->HOST Data: [4:key0][4:key1][4:key2][4:key3] This command is available under these conditions: | Bootloader | Firmware ---------------+--------------+----------- ColorHug | × | × ColorHug2 | × | × ColorHug+ | × | ✓ ColorHugALS | × | × Set the DAC value. @scale is a packed float, where 1.0f is 3.3V IN: [1:cmd][4:value] OUT: [1:retval][1:cmd] This command is available under these conditions: | Bootloader | Firmware ---------------+--------------+----------- ColorHug | × | × ColorHug2 | × | × ColorHug+ | × | ✓ ColorHugALS | × | × Set the dark offsets for use when taking samples when the measure mode is FREQUENCY. When the measure mode is DURATION these values have no effect. IN: [1:cmd][2:red][2:green][2:blue] OUT: [1:retval][1:cmd] This command is available under these conditions: | Bootloader | Firmware ---------------+--------------+----------- ColorHug | × | ✓ ColorHug2 | × | × ColorHug+ | × | ✓ ColorHugALS | × | × Sets the result of the firmware flashing. The idea of this command is that the flashing interaction is thus: 1. Reset() device goes to bootloader mode 2. SetFlashSuccess(FALSE) 3. WriteFlash($data) 4. ReadFlash($data) to verify 5. BootFlash() switch to program mode 6. SetFlashSuccess(TRUE) The idea is that we only set the success FALSE from the bootoloader to indicate that on booting we should not boot into the program. We can only set the success true from the *new* program code so as to verify that the new program boots, and can accept HID commands. IN: [1:cmd][1:success] OUT: [1:retval][1:cmd] This command is available under these conditions: | Bootloader | Firmware ---------------+--------------+----------- ColorHug | ✓ | ✓ ColorHug2 | ✓ | ✓ ColorHug+ | ✓ | ✓ ColorHugALS | ✓ | ✓ Different values of @success are permitted in each mode. Set the illuminants. IN: [1:cmd][1:illuminant] OUT: [1:retval][1:cmd] This command is available under these conditions: | Bootloader | Firmware ---------------+--------------+----------- ColorHug | × | × ColorHug2 | × | × ColorHug+ | × | ✓ ColorHugALS | × | × Sets the integral time. IN: [1:cmd][2:integral_time] OUT: [1:retval][1:cmd] This command is available under these conditions: | Bootloader | Firmware ---------------+--------------+----------- ColorHug | × | ✓ ColorHug2 | × | × ColorHug+ | × | ✓ ColorHugALS | × | ✓ Set the LED state. Using a @repeat value of anything other than 0 will block the processor for the duration of the command. If @repeat is not 0, then the LEDs are reset to all off at the end of the sequence. IN: [1:cmd][1:led_state][1:repeat][1:on-time][1:off-time] OUT: [1:retval][1:cmd] This command is available under these conditions: | Bootloader | Firmware ---------------+--------------+----------- ColorHug | × | ✓ ColorHug2 | × | ✓ ColorHug+ | × | ✓ ColorHugALS | × | ✓ Sets the measurement mode. The mode can either be frequency or pulse duration. The former is well tested, but the latter is much more precise. IN: [1:cmd][1:measure_mode] OUT: [1:retval][1:cmd] This command is available under these conditions: | Bootloader | Firmware ---------------+--------------+----------- ColorHug | × | ✓ ColorHug2 | × | × ColorHug+ | × | × ColorHugALS | × | × Sets the multiplier value. IN: [1:cmd][1:multiplier_value] OUT: [1:retval][1:cmd] This command is available under these conditions: | Bootloader | Firmware ---------------+--------------+----------- ColorHug | × | ✓ ColorHug2 | × | × ColorHug+ | × | × ColorHugALS | × | ✓ Set User's Email Address IN: [1:cmd][60:owner-email] OUT: [1:retval][1:cmd] This command is available under these conditions: | Bootloader | Firmware ---------------+--------------+----------- ColorHug | × | ✓ ColorHug2 | × | ✓ ColorHug+ | × | ✓ ColorHugALS | × | × Set User's Name IN: [1:cmd][60:owner-name] OUT: [1:retval][1:cmd] This command is available under these conditions: | Bootloader | Firmware ---------------+--------------+----------- ColorHug | × | ✓ ColorHug2 | × | ✓ ColorHug+ | × | ✓ ColorHugALS | × | × Sets the board errata value. Board errata is used to correct swapped LEDs and any future problems discovered that only affect some batches of hardware version 1. The errata bitmask is as follows: 0x00 = No errata for this PCB 0x01 = Leds are swapped 0x02-0xffff = Reserved for future use IN: [1:cmd][2:pcb_errata] OUT: [1:retval][1:cmd] This command is available under these conditions: | Bootloader | Firmware ---------------+--------------+----------- ColorHug | × | ✓ ColorHug2 | × | ✓ ColorHug+ | × | ✓ ColorHugALS | × | × Set the post XYZ scaling constant. @scale is a packed float. IN: [1:cmd][4:scale] OUT: [1:retval][1:cmd] This command is available under these conditions: | Bootloader | Firmware ---------------+--------------+----------- ColorHug | × | ✓ ColorHug2 | × | × ColorHug+ | × | × ColorHugALS | × | × Set the pre XYZ scaling constant. @scale is a packed float. IN: [1:cmd][4:scale] OUT: [1:retval][1:cmd] This command is available under these conditions: | Bootloader | Firmware ---------------+--------------+----------- ColorHug | × | ✓ ColorHug2 | × | × ColorHug+ | × | × ColorHugALS | × | × Sets the remote SHA1 hash of the profile. This is designed to be used by the calibration program to indicate the key which allows the completed profile to be found from a public web service. IN: [1:cmd][20:sha1_hash] OUT: [1:retval][1:cmd] This command is available under these conditions: | Bootloader | Firmware ---------------+--------------+----------- ColorHug | × | ✓ ColorHug2 | × | ✓ ColorHug+ | × | ✓ ColorHugALS | × | × Sets the device serial number. IN: [1:cmd][4:serial_number] OUT: [1:retval][1:cmd] This command is available under these conditions: | Bootloader | Firmware ---------------+--------------+----------- ColorHug | × | ✓ ColorHug2 | × | ✓ ColorHug+ | × | ✓ ColorHugALS | × | × Take a reading taking into account just dark offsets. All of @red, @green and @blue are packed float values. This command is useful if you want to do an ambient reading. IN: [1:cmd] OUT: [1:retval][1:cmd][4:red][4:green][4:blue] This command is available under these conditions: | Bootloader | Firmware ---------------+--------------+----------- ColorHug | × | ✓ ColorHug2 | × | ✓ ColorHug+ | × | ✓ ColorHugALS | × | × Takes 30 raw samples and returns them in an array. This command can be used to find the optimum delay between patches by showing a black sample area, then white, and then using this command to find out how long the actual hardware delay is. It can also be used to find out how stable the device or output is over a small amount of time, typically ~2.5 seconds for the maximum integral time. IN: [1:cmd] OUT: [1:retval][1:cmd][30:reading_array] This command is available under these conditions: | Bootloader | Firmware ---------------+--------------+----------- ColorHug | × | ✓ ColorHug2 | × | × ColorHug+ | × | × ColorHugALS | × | × Take a raw reading. IN: [1:cmd] OUT: [1:retval][1:cmd][4:count] This command is available under these conditions: | Bootloader | Firmware ---------------+--------------+----------- ColorHug | × | ✓ ColorHug2 | × | × ColorHug+ | × | ✓ ColorHugALS | × | ✓ Takes a spectral reading putting %CH_CCD_SPECTRAL_RESOLUTION uint16_t values (typically 7296 bytes) in SRAM. The values are scaled from 0x0000 to 0x03ff and correspond to the actual signal amplitude once Vref- and Vref+ have been taken into account. IN: [1:cmd] OUT: [1:retval][1:cmd][4:addr] This command is available under these conditions: | Bootloader | Firmware ---------------+--------------+----------- ColorHug | × | × ColorHug2 | × | × ColorHug+ | × | ✓ ColorHugALS | × | × Take a reading taking into account: 1. dark offsets 2. the calibration matrix If the calibration index > %CH_CALIBRATION_MAX then the calibration map is used to find the default calibration index to use. If the calibration index is set to %CH_CALIBRATION_SPECTRAL then the spectral hardware is used if it is available. The CIE 1931 luminosity function data is used by default. IN: [1:cmd][2:calibration-index] OUT: [1:retval][1:cmd][4:red][4:green][4:blue] This command is available under these conditions: | Bootloader | Firmware ---------------+--------------+----------- ColorHug | × | ✓ ColorHug2 | × | ✓ ColorHug+ | × | ✓ ColorHugALS | × | × Write values to EEPROM. IN: [1:cmd][8:eeprom_magic] OUT: [1:retval][1:cmd] This command is available under these conditions: | Bootloader | Firmware ---------------+--------------+----------- ColorHug | × | ✓ ColorHug2 | × | ✓ ColorHug+ | × | ✓ ColorHugALS | × | × Write raw data to the flash memory. You can only write aligned to a 32 byte boundary, and you must flush any incomplete 64 byte block. IN: [1:cmd][2:address][1:length][1:checksum][1-32:data] OUT: [1:retval][1:cmd] This command is available under these conditions: | Bootloader | Firmware ---------------+--------------+----------- ColorHug | ✓ | × ColorHug2 | ✓ | × ColorHug+ | ✓ | × ColorHugALS | ✓ | × Write raw data to the SRAM memory. IN: [1:cmd][2:address][1:length][1-60:data] OUT: [1:retval][1:cmd] This command is available under these conditions: | Bootloader | Firmware ---------------+--------------+----------- ColorHug | × | × ColorHug2 | × | ✓ ColorHug+ | × | ✓ ColorHugALS | × | × Adds a raw command to the device queue. A #ChDeviceQueue A #GUsbDevice The command, e.g. %CH_CMD_TAKE_READINGS The input buffer, or %NULL The size of @buffer_in The output buffer, or %NULL The size of @buffer_out Boots the device from bootloader to firmware mode. NOTE: This command is available on hardware version: 1 & 2 A #ChDeviceQueue A #GUsbDevice Clears a calibration slot. NOTE: This command is available on hardware version: 1 & 2 A #ChDeviceQueue A #GUsbDevice Slot Erase program code on the device. NOTE: This command is available on hardware version: 1 & 2 A #ChDeviceQueue A #GUsbDevice The device EEPROM address The length of @data Gets the ADC Vref- calibration value. NOTE: This command is available on hardware version: 2 A #ChDeviceQueue A #GUsbDevice The voltage reference, ranging from 0.0 to 3.3V. Gets the ADC Vref+ calibration value. NOTE: This command is available on hardware version: 2 A #ChDeviceQueue A #GUsbDevice The voltage reference, ranging from 0.0 to 3.3V. Gets the calibration data. NOTE: This command is available on hardware version: 1 & 2 A #ChDeviceQueue A #GUsbDevice The slot position the 3x3 calibration matrix The types the matrix supports The description of the calibration Gets the calibration map. NOTE: This command is available on hardware version: 1 & 2 A #ChDeviceQueue A #GUsbDevice An array of slot positions Gets the CCD spectral calibration indexes. These are "pointers" to specific spectral peaks returned by the CCD. NOTE: This command is available on hardware version: 2 A #ChDeviceQueue A #GUsbDevice An array of red, green, blue indexes Gets the selected sensor color. NOTE: This command is available on hardware version: 1 & 2 A #ChDeviceQueue A #GUsbDevice The color select, e.g. %CH_COLOR_SELECT_RED Gets the DAC value. NOTE: This command is available on hardware version: 2 A #ChDeviceQueue A #GUsbDevice value between 0.0 and 0.99 Gets the device dark offsets. NOTE: This command is available on hardware version: 1 & 2 A #ChDeviceQueue A #GUsbDevice A #CdColorRGB Gets the firmware version. NOTE: This command is available on hardware version: 1 & 2 A #ChDeviceQueue A #GUsbDevice The firmware major version The firmware minor version The firmware micro version Gets the hardware version. NOTE: This command is available on hardware version: 1 & 2 A #ChDeviceQueue A #GUsbDevice The hardware version Gets the reading integral time. NOTE: This command is available on hardware version: 1 & 2 A #ChDeviceQueue A #GUsbDevice The sensor integral time in device units Gets the LED status. NOTE: This command is available on hardware version: 1 & 2 A #ChDeviceQueue A #GUsbDevice The LED bitfield Gets the measurement mode. NOTE: This command is available on hardware version: 1 & 2 A #ChDeviceQueue A #GUsbDevice The #ChMeasureMode, e.g. %CH_MEASURE_MODE_DURATION Gets the sensor multiplier. NOTE: This command is available on hardware version: 1 & 2 A #ChDeviceQueue A #GUsbDevice The device multiplier, e.g. %CH_FREQ_SCALE_100 Gets the owner email address. NOTE: This command is available on hardware version: 1 & 2 A #ChDeviceQueue A #GUsbDevice An email address Gets the owner name. NOTE: This command is available on hardware version: 1 & 2 A #ChDeviceQueue A #GUsbDevice The owner name Gets the PCB errata level. NOTE: This command is available on hardware version: 1 & 2 A #ChDeviceQueue A #GUsbDevice The PCB errata, e.g. %CH_PCB_ERRATA_SWAPPED_LEDS Gets the post scale value. NOTE: This command is available on hardware version: 1 & 2 A #ChDeviceQueue A #GUsbDevice The post-scale value Gets the pre scale value. NOTE: This command is available on hardware version: 1 & 2 A #ChDeviceQueue A #GUsbDevice Pre-scale value Gets the remote hash stored on the device. NOTE: This command is available on hardware version: 1 & 2 A #ChDeviceQueue A #GUsbDevice A #ChSha1 Gets the device serial number. NOTE: This command is available on hardware version: 1 & 2 A #ChDeviceQueue A #GUsbDevice The device serial number Gets the device temperature. NOTE: This command is available on hardware version: 2 A #ChDeviceQueue A #GUsbDevice Temperature in Celsius Processes all commands in the command queue. WARNING: this function is synchronous and will block. %TRUE if the commands were executed successfully. A #ChDeviceQueue Flags how to process the queue, e.g. %CH_DEVICE_QUEUE_PROCESS_FLAGS_CONTINUE_ERRORS #GCancellable or %NULL Processes all commands in the command queue. A #ChDeviceQueue A #GCancellable, or %NULL A #GAsyncReadyCallback that will be called when finished. User data passed to @callback Gets the result from the asynchronous function. %TRUE if the request was fulfilled. a #ChDeviceQueue instance. the #GAsyncResult Reads firmware on the device. NOTE: This command is available on hardware version: 1 & 2 A #ChDeviceQueue A #GUsbDevice Firmware binary data Size of @data Read flash code from the device. NOTE: This command is available on hardware version: 1 & 2 A #ChDeviceQueue A #GUsbDevice The device EEPROM address Binary data The length of @data Reads binary data from the SRAM. NOTE: This command is available on hardware version: 2 A #ChDeviceQueue A #GUsbDevice The device memory address The binary data Size of @data Resets the device back to bootloader mode. NOTE: This command is available on hardware version: 1 & 2 A #ChDeviceQueue A #GUsbDevice Performs some self tests on the device. NOTE: This command is available on hardware version: 1 & 2 A #ChDeviceQueue A #GUsbDevice Sets the calibration data. NOTE: This command is available on hardware version: 1 & 2 A #ChDeviceQueue A #GUsbDevice The slot position the 3x3 calibration matrix The types the matrix supports The description of the calibration Sets the calibration map. NOTE: This command is available on hardware version: 1 & 2 A #ChDeviceQueue A #GUsbDevice An array of slot positions Sets the CCD spectral calibration indexes. These are "pointers" to specific spectral peaks returned by the CCD. NOTE: This command is available on hardware version: 2 A #ChDeviceQueue A #GUsbDevice An array of red, green, blue indexes Sets the sensor measurement color. NOTE: This command is available on hardware version: 1 & 2 A #ChDeviceQueue A #GUsbDevice The color select, e.g. %CH_COLOR_SELECT_RED Sets the post scale value. NOTE: This command is available on hardware version: 1 & 2 A #ChDeviceQueue A #GUsbDevice The DAC value Sets the device dark offsets. NOTE: This command is available on hardware version: 1 & 2 A #ChDeviceQueue A #GUsbDevice A #CdColorRGB Sets the firmware flash success value. Be careful using this function as misuse can result in a 'bricked' ColorHug device. NOTE: This command is available on hardware version: 1 & 2 A #ChDeviceQueue A #GUsbDevice Success value Sets the reading integral time. NOTE: This command is available on hardware version: 1 & 2 A #ChDeviceQueue A #GUsbDevice The sensor integral time in device units Sets the LED status. NOTE: This command is available on hardware version: 1 & 2 A #ChDeviceQueue A #GUsbDevice The LEDs bitfield Sets the number of times to repeat the pattern Set the on time Set the off time Sets the measurement mode. NOTE: This command is available on hardware version: 1 & 2 A #ChDeviceQueue A #GUsbDevice The #ChMeasureMode, e.g. %CH_MEASURE_MODE_DURATION Sets the sensor multiplier. NOTE: This command is available on hardware version: 1 & 2 A #ChDeviceQueue A #GUsbDevice The device multiplier, e.g. %CH_FREQ_SCALE_100 Sets the owner email address. NOTE: This command is available on hardware version: 1 & 2 A #ChDeviceQueue A #GUsbDevice An email address Sets the owner name. NOTE: This command is available on hardware version: 1 & 2 A #ChDeviceQueue A #GUsbDevice The owner name Sets the PCB board errata. NOTE: This command is available on hardware version: 1 & 2 A #ChDeviceQueue A #GUsbDevice The PCB errata, e.g. %CH_PCB_ERRATA_SWAPPED_LEDS Sets the post scale value. NOTE: This command is available on hardware version: 1 & 2 A #ChDeviceQueue A #GUsbDevice The post-scale value Sets the pre-scale value. NOTE: This command is available on hardware version: 1 & 2 A #ChDeviceQueue A #GUsbDevice Pre-scale value Sets the remote hash on the device. NOTE: This command is available on hardware version: 1 & 2 A #ChDeviceQueue A #GUsbDevice A #ChSha1 Sets the device serial number. NOTE: This command is available on hardware version: 1 & 2 A #ChDeviceQueue A #GUsbDevice The device serial number Get an array of raw readings in quick succession. NOTE: This command is available on hardware version: 1 & 2 A #ChDeviceQueue A #GUsbDevice An array of raw readings Take a raw reading from the sensor. NOTE: This command is available on hardware version: 1 & 2 A #ChDeviceQueue A #GUsbDevice A raw reading value Takes a raw spectral reading. NOTE: This command is available on hardware version: 2 A #ChDeviceQueue A #GUsbDevice The SRAM location where the data is held Take a RGB triplet of readings from the sensor without applying the calibration matrix. NOTE: This command is available on hardware version: 1 & 2 A #ChDeviceQueue A #GUsbDevice The #CdColorRGB of the raw reading Take an XYZ fully cooked reading from the sensor. NOTE: This command is available on hardware version: 1 & 2 A #ChDeviceQueue A #GUsbDevice The #CdColorXYZ for a given calibration slot Verifies firmware on the device. NOTE: This command is available on hardware version: 1 & 2 A #ChDeviceQueue A #GUsbDevice Firmware binary data Size of @data Verify flash code from the device. NOTE: This command is available on hardware version: 1 & 2 A #ChDeviceQueue A #GUsbDevice The device EEPROM address Binary data The length of @data Writes values to the firmware to be set at device startup. NOTE: This command is available on hardware version: 1 & 2 A #ChDeviceQueue A #GUsbDevice The magic sekret string Writes new firmware to the device. NOTE: This command is available on hardware version: 1 & 2 A #ChDeviceQueue A #GUsbDevice Firmware binary data Size of @data Write flash code to the device. NOTE: This command is available on hardware version: 1 & 2 A #ChDeviceQueue A #GUsbDevice The device EEPROM address Binary data The length of @data Writes binary data to the SRAM. NOTE: This command is available on hardware version: 2 A #ChDeviceQueue A #GUsbDevice The device memory address The binary data Size of @data CH_DEVICE_QUEUE_PROCESS_FLAGS_NONE: Normal operation, where a single device command failure makes the return value of the process %FALSE, but the queue contibues to run for other devices. CH_DEVICE_QUEUE_PROCESS_FLAGS_CONTINUE_ERRORS: Continue to submit commands to a device that has failed a command, for example where one command might not be supported in the middle of a queue of commands. CH_DEVICE_QUEUE_PROCESS_FLAGS_NONFATAL_ERRORS: Do not consider a device error to be fatal, but instead emit a signal and continue with the rest of the queue. If the flag %CH_DEVICE_QUEUE_PROCESS_FLAGS_CONTINUE_ERRORS is not used then other commands to the same device will not be submitted. Flags for controlling processing options Gets a string representation of the SHA1 hash. A string, free with g_free(). A %ChSha1 Parses a SHA1 hash from a string value. %TRUE for success A string representation of the SHA1 hash A %ChSha1 Checks the firmware is suitable for the ColorHug device that is attached. %TRUE if the command was executed successfully. firmware binary data size of @data ChDevice error quark. Gets the ADC positive calibration value. %TRUE for success A #GUsbDevice offset value a #GCancellable, or %NULL Gets the ADC positive calibration value. %TRUE for success A #GUsbDevice offset value a #GCancellable, or %NULL Gets any PCB wavelength_cal from the device. %TRUE for success A #GUsbDevice a #GCancellable, or %NULL Gets the status for the last operation. %TRUE for success A #GUsbDevice a #ChError, e.g. %CH_ERROR_INVALID_ADDRESS a #ChCmd, e.g. %CH_CMD_TAKE_READING_SPECTRAL a #GCancellable, or %NULL Returns the GUID for the connected ColorHug device. the GUID address, or %NULL for error A #GUsbDevice Gets the illuminants from the device. %TRUE for success A #GUsbDevice serial number a #GCancellable, or %NULL Gets the integration time used for taking the next samples. %TRUE for success A #GUsbDevice integration time in ms a #GCancellable, or %NULL Gets the LEDs from the device. %TRUE for success A #GUsbDevice serial number a #GCancellable, or %NULL Gets any PCB errata from the device. %TRUE for success A #GUsbDevice #ChPcbErrata, e.g. %CH_PCB_ERRATA_SWAPPED_LEDS a #GCancellable, or %NULL Returns the runcode address for the ColorHug device. the runcode address, or 0 for error A #GUsbDevice Gets the serial number from the device. %TRUE for success A #GUsbDevice serial number a #GCancellable, or %NULL Gets the spectrum from the device. This queries the device multiple times until the spectrum has been populated. a #CdSpectrum, or %NULL for error A #GUsbDevice a #GCancellable, or %NULL Gets the spectrum from the device. This queries the device multiple times until the spectrum has been populated. a #CdSpectrum, or %NULL for error A #GUsbDevice A #ChSpectrumKind a #GCancellable, or %NULL Gets the PCB board temperature from the device. %TRUE for success A #GUsbDevice temperature in Celsius a #GCancellable, or %NULL Loads the entire SRAM from the device EEPROM. %TRUE for success A #GUsbDevice a #GCancellable, or %NULL Gets the device mode from the unique code stored in the firmware data. The firmware identifier has been present since colorhug-1.2.2.bin for ColorHug and all firmware versions for ColorHug2 and ColorHug+. A #ChDeviceMode firmware binary data size of @data Opens the device ready for use. %TRUE for success A #GUsbDevice a #GCancellable, or %NULL Reads a value from the SRAM. %TRUE for success A #GUsbDevice a #GCancellable, or %NULL Saves the entire SRAM space into the device EEPROM. %TRUE for success A #GUsbDevice a #GCancellable, or %NULL Performs a self test on the device %TRUE for success A #GUsbDevice a #GCancellable, or %NULL Sets any PCB wavelength_cal on the device %TRUE for success A #GUsbDevice a #GCancellable, or %NULL Sets the firmware signing keys on the device. IMPORTANT: This can only be called once until the device is unlocked. %TRUE for success A #GUsbDevice a set of XTEA keys a #GCancellable, or %NULL Sets the illuminants on the device %TRUE for success A #GUsbDevice serial number a #GCancellable, or %NULL Sets the integration value for the next sample. %TRUE for success A #GUsbDevice integration time in ms a #GCancellable, or %NULL Sets the LEDs on the device %TRUE for success A #GUsbDevice serial number a #GCancellable, or %NULL Sets any PCB errata on the device %TRUE for success A #GUsbDevice #ChPcbErrata, e.g. %CH_PCB_ERRATA_SWAPPED_LEDS a #GCancellable, or %NULL Sets the serial number on the device %TRUE for success A #GUsbDevice serial number a #GCancellable, or %NULL Sets the spectrum from the device. This sends data multiple multiple times until the spectrum has been populated. %TRUE for success A #GUsbDevice A #ChSpectrumKind A #CdSpectrum a #GCancellable, or %NULL Takes a reading from the device. %TRUE for success A #GUsbDevice a #ChSpectrumKind, e.g. %CH_SPECTRUM_KIND_RAW a #GCancellable, or %NULL Takes a reading from the device and returns the XYZ value. a #CdColorXYZ, or %NULL for error A #GUsbDevice A calibration index or 0 for none a #GCancellable, or %NULL Sends a message to the device and waits for a reply. %TRUE if the command was executed successfully. A #GUsbDevice The command to use, e.g. %CH_CMD_GET_COLOR_SELECT The input buffer of data, or %NULL The input buffer length The output buffer of data, or %NULL The output buffer length A #GCancellable or %NULL Sends a message to the device and waits for a reply. A #GUsbDevice The command to use, e.g. %CH_CMD_GET_COLOR_SELECT The input buffer of data, or %NULL The input buffer length The output buffer of data, or %NULL The output buffer length A #GCancellable, or %NULL A #GAsyncReadyCallback that will be called when finished. User data passed to @callback Gets the result from the asynchronous function. %TRUE if the request was fulfilled. a #GUsbDevice instance. the #GAsyncResult Loads the entire SRAM from the device EEPROM. %TRUE for success A #GUsbDevice A #GBytes a #GCancellable, or %NULL Parses a SHA1 hash from a string value. %TRUE for success A string representation of the SHA1 hash A %ChSha1