Constants

Details

Colorhug.BUFFER_INPUT_CMD = 0
Colorhug.BUFFER_INPUT_DATA = 1
Colorhug.BUFFER_OUTPUT_CMD = 1
Colorhug.BUFFER_OUTPUT_DATA = 2
Colorhug.BUFFER_OUTPUT_RETVAL = 0
Colorhug.CALIBRATION_DESCRIPTION_LEN = 23
Colorhug.CALIBRATION_INDEX_CRT = 1
Colorhug.CALIBRATION_INDEX_FACTORY_ONLY = 0
Colorhug.CALIBRATION_INDEX_LCD = 0
Colorhug.CALIBRATION_INDEX_LED = 3
Colorhug.CALIBRATION_INDEX_MAX = 6
Colorhug.CALIBRATION_INDEX_PROJECTOR = 2
Colorhug.CALIBRATION_MAX = 64
Colorhug.CALIBRATION_SPECTRAL = 65535
Colorhug.CALIBRATION_TYPE_ALL = 255
Colorhug.CALIBRATION_TYPE_CRT = 2
Colorhug.CALIBRATION_TYPE_LCD = 1
Colorhug.CALIBRATION_TYPE_LED = 8
Colorhug.CALIBRATION_TYPE_PROJECTOR = 4
Colorhug.CCD_SPECTRAL_RESOLUTION = 1024
Colorhug.CMD_BOOT_FLASH = 39

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 | ✓ | ×

New in version 0.1.29.

Colorhug.CMD_CLEAR_ERROR = 97

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 | × | ×

New in version 1.3.1.

Colorhug.CMD_ERASE_FLASH = 41

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 | ✓ | ×

New in version 0.1.29.

Colorhug.CMD_GET_ADC_CALIBRATION_NEG = 82

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 | × | ×

New in version 0.1.31.

Colorhug.CMD_GET_ADC_CALIBRATION_POS = 81

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 | × | ×

New in version 0.1.31.

Colorhug.CMD_GET_CALIBRATION = 9

Gets the calibration matrix. The description does not have to be None 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 | × | ×

New in version 0.1.29.

Colorhug.CMD_GET_CALIBRATION_MAP = 46

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 | × | ×

New in version 0.1.29.

Colorhug.CMD_GET_CCD_CALIBRATION = 83

Gets the spectral indexes for the RGB calibration which are values between 0 and Colorhug.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 | × | ×

New in version 0.1.31.

Colorhug.CMD_GET_COLOR_SELECT = 1

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 | × | ✓

New in version 0.1.29.

Colorhug.CMD_GET_DAC_VALUE = 60

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 | × | ×

New in version 1.1.6.

Colorhug.CMD_GET_DARK_OFFSETS = 15

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 | × | ×

New in version 0.1.29.

Colorhug.CMD_GET_ERROR = 96

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 | × | ×

New in version 1.3.1.

Colorhug.CMD_GET_FIRMWARE_VERSION = 7

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 | ✓ | ✓

New in version 0.1.29.

Colorhug.CMD_GET_HARDWARE_VERSION = 48

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 | ✓ | ✓

New in version 0.1.29.

Colorhug.CMD_GET_ILLUMINANTS = 21

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 | × | ×

New in version 1.3.4.

Colorhug.CMD_GET_INTEGRAL_TIME = 5

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 | × | ✓

New in version 0.1.29.

Colorhug.CMD_GET_LEDS = 13

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 | ✓ | ✓

New in version 0.1.29.

Colorhug.CMD_GET_MEASURE_MODE = 55

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 | × | ×

New in version 0.1.29.

Colorhug.CMD_GET_MULTIPLIER = 3

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 | × | ✓

New in version 0.1.29.

Colorhug.CMD_GET_OWNER_EMAIL = 19

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 | × | ×

New in version 0.1.29.

Colorhug.CMD_GET_OWNER_NAME = 17

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 | × | ×

New in version 0.1.29.

Colorhug.CMD_GET_PCB_ERRATA = 51

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 | × | ×

New in version 0.1.29.

Colorhug.CMD_GET_POST_SCALE = 42

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 | × | ×

New in version 0.1.29.

Colorhug.CMD_GET_PRE_SCALE = 44

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 | × | ×

New in version 0.1.29.

Colorhug.CMD_GET_REMOTE_HASH = 53

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 | × | ×

New in version 0.1.29.

Colorhug.CMD_GET_SERIAL_NUMBER = 11

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 | × | ✓

New in version 0.1.29.

Colorhug.CMD_GET_TEMPERATURE = 59

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 | × | ×

New in version 0.1.29.

Colorhug.CMD_LOAD_SRAM = 65

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 | × | ×

New in version 0.1.29.

Colorhug.CMD_READ_FLASH = 37

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 | ✓ | ×

New in version 0.1.29.

Colorhug.CMD_READ_SRAM = 56

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 | × | ×

New in version 0.1.29.

Colorhug.CMD_RESET = 36

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 | ✓ | ✓

New in version 0.1.29.

Colorhug.CMD_SAVE_SRAM = 66

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 | × | ×

New in version 0.1.29.

Colorhug.CMD_SELF_TEST = 64

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 | ✓ | ×

New in version 0.1.29.

Colorhug.CMD_SET_CALIBRATION = 10

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 | × | ×

New in version 0.1.29.

Colorhug.CMD_SET_CALIBRATION_MAP = 47

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 | × | ×

New in version 0.1.29.

Colorhug.CMD_SET_CCD_CALIBRATION = 84

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 | × | ×

New in version 0.1.31.

Colorhug.CMD_SET_COLOR_SELECT = 2

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 | × | ✓

New in version 0.1.29.

Colorhug.CMD_SET_CRYPTO_KEY = 112

Sets the 128 bit encyption 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 | × | ×

New in version 1.3.1.

Colorhug.CMD_SET_DAC_VALUE = 61

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 | × | ×

New in version 1.1.6.

Colorhug.CMD_SET_DARK_OFFSETS = 16

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 | × | ×

New in version 0.1.29.

Colorhug.CMD_SET_FLASH_SUCCESS = 40

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.

New in version 0.1.29.

Colorhug.CMD_SET_ILLUMINANTS = 22

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 | × | ×

New in version 1.3.4.

Colorhug.CMD_SET_INTEGRAL_TIME = 6

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 | × | ✓

New in version 0.1.29.

Colorhug.CMD_SET_LEDS = 14

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 | × | ✓

New in version 0.1.29.

Colorhug.CMD_SET_MEASURE_MODE = 54

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 | × | ×

New in version 0.1.29.

Colorhug.CMD_SET_MULTIPLIER = 4

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 | × | ✓

New in version 0.1.29.

Colorhug.CMD_SET_OWNER_EMAIL = 20

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 | × | ×

New in version 0.1.29.

Colorhug.CMD_SET_OWNER_NAME = 18

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 | × | ×

New in version 0.1.29.

Colorhug.CMD_SET_PCB_ERRATA = 50

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 | × | ×

New in version 0.1.29.

Colorhug.CMD_SET_POST_SCALE = 43

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 | × | ×

New in version 0.1.29.

Colorhug.CMD_SET_PRE_SCALE = 45

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 | × | ×

New in version 0.1.29.

Colorhug.CMD_SET_REMOTE_HASH = 52

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 | × | ×

New in version 0.1.29.

Colorhug.CMD_SET_SERIAL_NUMBER = 12

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 | × | ×

New in version 0.1.29.

Colorhug.CMD_TAKE_READINGS = 34

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 | × | ×

New in version 0.1.29.

Colorhug.CMD_TAKE_READING_ARRAY = 49

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 | × | ×

New in version 0.1.29.

Colorhug.CMD_TAKE_READING_RAW = 33

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 | × | ✓

New in version 0.1.29.

Colorhug.CMD_TAKE_READING_SPECTRAL = 85

Takes a spectral reading putting Colorhug.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 | × | ×

New in version 0.1.31.

Colorhug.CMD_TAKE_READING_XYZ = 35

Take a reading taking into account:

dark offsets

the calibration matrix

If the calibration index > Colorhug.CALIBRATION_MAX then the calibration map is used to find the default calibration index to use.

If the calibration index is set to Colorhug.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 | × | ×

New in version 0.1.29.

Colorhug.CMD_WRITE_EEPROM = 32

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 | × | ×

New in version 0.1.29.

Colorhug.CMD_WRITE_FLASH = 38

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 | ✓ | ×

New in version 0.1.29.

Colorhug.CMD_WRITE_SRAM = 57

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 | × | ×

New in version 0.1.29.

Colorhug.DEVICE_GUID_COLORHUG = '40338ceb-b966-4eae-adae-9c32edfcc484'
Colorhug.DEVICE_GUID_COLORHUG2 = '2082b5e0-7a64-478a-b1b2-e3404fab6dad'
Colorhug.DEVICE_GUID_COLORHUG_ALS = '84f40464-9272-4ef7-9399-cd95f12da696'
Colorhug.DEVICE_GUID_COLORHUG_PLUS = '6d6f05a9-3ecb-43a2-bcbb-3844f1825366'
Colorhug.DEVICE_USB_TIMEOUT = 10000
Colorhug.EEPROM_ADDR_RUNCODE = 16384
Colorhug.EEPROM_ADDR_RUNCODE_ALS = 8192
Colorhug.EP0_TRANSFER_SIZE = 64
Colorhug.EP0_TRANSFER_SIZE_V2 = 1024
Colorhug.FIRMWARE_ID_TOKEN1 = '40338ceb'
Colorhug.FIRMWARE_ID_TOKEN2 = '2082b5e0'
Colorhug.FIRMWARE_ID_TOKEN_ALS = '84f40464'
Colorhug.FIRMWARE_ID_TOKEN_PLUS = '6d6f05a9'
Colorhug.FLASH_ERASE_BLOCK_SIZE = 1024
Colorhug.FLASH_RECONNECT_TIMEOUT = 5000
Colorhug.FLASH_TRANSFER_BLOCK_SIZE = 32
Colorhug.FLASH_WRITE_BLOCK_SIZE = 64
Colorhug.INTEGRAL_TIME_VALUE_100MS = 14848
Colorhug.INTEGRAL_TIME_VALUE_200MS = 29952
Colorhug.INTEGRAL_TIME_VALUE_50MS = 7936
Colorhug.INTEGRAL_TIME_VALUE_5MS = 768
Colorhug.INTEGRAL_TIME_VALUE_MAX = 65535
Colorhug.OWNER_LENGTH_MAX = 60
Colorhug.USB_CONFIG = 1
Colorhug.USB_HID_EP = 1
Colorhug.USB_HID_EP_IN = 128
Colorhug.USB_HID_EP_OUT = 0
Colorhug.USB_HID_EP_SIZE = 64
Colorhug.USB_INTERFACE = 0
Colorhug.USB_PID_BOOTLOADER = 4096
Colorhug.USB_PID_BOOTLOADER2 = 4101
Colorhug.USB_PID_BOOTLOADER_ALS = 4102
Colorhug.USB_PID_BOOTLOADER_DFU = 4106
Colorhug.USB_PID_BOOTLOADER_PLUS = 4099
Colorhug.USB_PID_FIRMWARE = 4097
Colorhug.USB_PID_FIRMWARE2 = 4100
Colorhug.USB_PID_FIRMWARE_ALS = 4103
Colorhug.USB_PID_FIRMWARE_ALS_SENSOR_HID = 4104
Colorhug.USB_PID_FIRMWARE_DFU = 4105
Colorhug.USB_PID_FIRMWARE_PLUS = 4098
Colorhug.USB_PID_LEGACY = 63706
Colorhug.USB_VID = 10047
Colorhug.USB_VID_LEGACY = 1240
Colorhug.WRITE_EEPROM_MAGIC = 'Un1c0rn2'