Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 39 Next »

INI File Overview


Aptina Imaging software uses sensor specific .ini files for many of its applications. The .ini file contains groups of commands called presets. Each preset has a name enclosed in square brackets, like [INI File Users Guide#Reset]. Some presets are required for the DevWare application; while others can be added by the user. The DevWare application provides several tools which will allow the user to create and edit ini presets. There is also a function in the ApBase API which allows the user to load a preset from an .ini file in their own custom application (see ap_LoadINIPreset()).

Pre-defined DevWare Presets

The following presets are used by DevWare and other Aptina Imaging software. The user may edit the commands in these presets, but the preset should not be deleted or renamed for proper software execution.

[Reset]

Reset the sensor to its power-on state. Activated by the Reset button the DevWare toolbar.

[Demo Initialization]

The recommended register settings for the sensor in the demo environment. Activated by the Init button on the DevWare toolbar.

[DevWare Initialization]

Settings to initialize DevWare and the sensor for the demo environment. If this preset doesn't exist, Demo Initialization is used.

[SensorDemo Initialization]

Settings to initialize SensorDemo (DevWare /DEMO) and the sensor. If this preset doesn't exist, SensorDemo will fall back to DevWare Initialization or Demo Initialization.

[Monochrome Initialization]

Recommended register settings to use for the monochrome version of the sensor.

[Initialize]

Create a file called prescan.ini and put it in the apps_data directory of the installation directory. In the file have a preset called [Initialize].
[Initialize] will be executed prior to other board initialization and prior to accesses to the sensor board. This works for Demo 2, 2X, 3 and 3X.

Note: There aren't separate initialize preset names per base board type, but it's possible to distinguish between, for example, Demo3 and 3X, with an IF_SERIAL command in the [Initialize] preset.

[Startup Wizard]DevWare will run that instead of the Startup Wizard dialog. Doing that is unconditional, though. There is no way to run Startup Wizard from ini script.

[Viewfinder ON]

Switch into Preview mode. Activated by the Preview button on the DevWare toolbar.

[Viewfinder OFF]

Switch out of Preview mode. Activated by the Preview button on the DevWare toolbar.

[Video Capture ON]

Switch into Video Capture mode. Activated by the Record button on the DevWare toolbar unless Screen capture only (no register changes) is selected on Sensor Control, Video Capture dialog.

[Video Capture OFF]

Switch out of Video Capture mode. Activated when video capture ends, unless Screen capture only (no register changes) is selected on Sensor Control, Video Capture dialog.

[Color Processing ON]

Enable software color processing. Activated by the Auto button on the DevWare toolbar.

[Color Processing OFF]

Disable software color processing. Activated by the Auto button on the DevWare toolbar.

[Camera 1]

Select primary sensor on a two-sensor system.

[Camera 2]

Select secondary sensor on a two-sensor system.

[Pre Still Capture]

Activated before a still image capture, unless Current Image is selected on Sensor Control, Still Capture dialog.

[Post Still Capture]

Activated after a still image capture, unless Current Image is selected on Sensor Control, Still Capture dialog.

[Data Types]

Define data types for sensor registers and bitfields. Activated at DevWare startup. Deprecated since the .xsdat files contain this information now.

[Register Tabs]Define the tabs, groups, and controls for the optional "Scripts" version of the Register Dialog.
[Python:]Python code that will be executed automatically when the file is opened in a Presets dialog in DevWare. This is a good place to put import statements, function def statements and any other definitions that may be used by other presets in the file.
[Python: Unload]Python code that will be executed automatically when the Presets dialog is closed (including when DevWare exits).


User-Defined DevWare Presets

You may create your own presets using a text editor, or various tools in DevWare.
The preset name may consist of any combination of ASCII characters (alphanumeric, symbolic, space, etc.) except "[", "]", "," or the sequence "//".
To execute the preset select it in the DevWare Presets dialog and click Load.

Special Preset Name Prefixes

The following preset name prefixes have special meaning.

[Toolbar: …]

The preset will get a button on the User Toolbar assigned to it. See below.

[Toolbar2: …]

The preset will get a button on the 2nd User Toolbar assigned to it. See below.

[Python: …]

The preset contains Python code instead of ini commands. See the DevWare Python Development Guide document.

[Hidden: …]

The preset will not appear in the DevWare Presets dialog list box. You can leave off the 'Hidden:' part in INI File Users Guide#LOAD= commands. For example 'LOAD=PLL-On' can load [Hidden: PLL-On].

[Patch <id>; <color>; <description>]

A preset name formatted like this will be recognized as a firmware patch by the Load Patches dialog page of the Sensor Control dialog.
<id> is the patch ID, usually four hex digits.
<color> is one of "critical", "recommended", "feature-recommended", "feature recommended", "customer", "customer-specific", "customer specific".
<description> is a short text description of the patch.


User-Defined DevWare Toolbar Buttons

If the name of a preset begins with "Toolbar:" or "Toolbar2:" then DevWare will create a button on the corresponding User Toolbar that executes the preset. The remainder of the preset name after "Toolbar:" or "Toolbar2:" will be used as the button label. You can further define the characteristics and behavior of the toolbar button with the INI File Users Guide#ICON=, INI File Users Guide#TOOLTIP=, INI File Users Guide#MENUITEM= and SHORTCUT= special commands.
The maximum number of buttons on a User Toolbar is 20.


Example: Simple button
[Toolbar: Zoom 1X]
ICON= zoom.ico
TOOLTIP= "Restore the display zoom to 1X"
SHORTCUT= Ctrl+1
STATE= Display Zoom Percent, 100

Example: Menu button
[Toolbar: Quick Zoom]
ICON= zoom.ico
TOOLTIP= "Select a Display Zoom setting"
MENUITEM= "1/4", LOAD= Zoom.25X, RADIO= STATE:Display Zoom Percent == 25
MENUITEM= "1:1", LOAD= Zoom1X, RADIO= STATE:Display Zoom Percent == 100
MENUITEM= "4X", LOAD= Zoom4X, RADIO= STATE:Display Zoom Percent == 400
[Zoom.25X]
STATE= Display Zoom Percent, 25
[Zoom1X]
STATE= Display Zoom Percent, 100
[Zoom4X]
STATE= Display Zoom Percent, 400

List of INI Commands


Command

Definition

INI File Users Guide#BITFIELD

Write a value to a bitfield of a register.

INI File Users Guide#DATATYPE

Define the data type and optional valid range of a named register or bitfield.

INI File Users Guide#DELAY

Delay a certain amount of time (in milliseconds) before continuing.

INI File Users Guide#ERROR_IF

Output an error message and stop execution if a condition is met.

INI File Users Guide#FAR1

Write a value to a sensor register on the first attached camera.

INI File Users Guide#FAR2

Write a value to a sensor register on the second attached camera.

INI File Users Guide#FIELD_WR

Write to a register or bitfield by name. Command works for any kind of register, variable or SFR.

INI File Users Guide#ICON

Define the icon for a User Toolbar button.

INI File Users Guide#IF_FIELD

Similar to LOAD, but conditioned on the value of a register.

INI File Users Guide#IF_REG

Similar to LOAD, but conditioned on the value of a register.

INI File Users Guide#IF_SERIAL

Similar to IF_REG, but can access any device on the SHiP bus.

INI File Users Guide#IMAGE

Set software to expect the given image size and type. Command does not change sensor mode.

INI File Users Guide#LOAD

Load a preset from an ini file.

INI File Users Guide#LOAD_PROM

Load a preset from an EEPROM.

INI File Users Guide#LOG

Add a text string to the Log window.

INI File Users Guide#MEM

Write a value to an SOC RAM location.

INI File Users Guide#MEM8

Write a value to an 8-bit SOC RAM location.

INI File Users Guide#MEM32

Write a value to a 32-bit SOC RAM location.

INI File Users Guide#MENUITEM

Define sub-menu items for a User Toolbar button.

INI File Users Guide#OPTION

Set a DevWare Option variable.

INI File Users Guide#POLL_FIELD

Poll a register. Similar to DELAY, but conditioned on the value of a register.

INI File Users Guide#POLL_REG

Poll a register. Similar to DELAY, but conditioned on the value of a register.

INI File Users Guide#POLL_VAR

Poll a variable. Similar to DELAY, but conditioned on the value of a variable.

INI File Users Guide#PROMPT

Give the user a multiple-choice dialog, or show a message.

INI File Users Guide#PYTHONInvoke a one-line Python statement.

INI File Users Guide#REG

Write a value to a register.

INI File Users Guide#REG_BURST

Write a sequence of register values in one bus transaction.

INI File Users Guide#SAVE_IMAGE

Write image data to files.

INI File Users Guide#SAVE_REGS

Write register values to a file.

INI File Users Guide#SENSOR_BASE

Set or detect the sensor SHiP base address.

INI File Users Guide#SERIAL_REG

Low-level write to Two-Wire Serial Interface register.

INI File Users Guide#SFR

Write a value to a special function register, on certain sensors.

INI File Users Guide#SFR8

Write a value to an 8-bit special function register, on certain sensors.

INI File Users Guide#SHORTCUT

Define a keyboard shortcut for a User Toolbar button.

INI File Users Guide#STATE

Set a variable within the software, not on the sensor.

INI File Users Guide#TOOLTIP

Define a tooltip for a User Toolbar button.

INI File Users Guide#VAR

Write a value to a firmware variable.

INI File Users Guide#VAR32

Write a value to a 32-bit firmware variable.

INI File Users Guide#VAR8

Write a value to an 8-bit firmware variable.

INI File Users Guide#XMCLK

Set the XMCLK (sensor external clock) frequency.


Command Syntax


Note: [ ] items are optional.

BITFIELD = [<page>,] <address>, <mask>, <value> //<comment>

Write a value to a bitfield of a register.

Example: for register 0xC3 on page 2, set bit 5 to 1
BITFIELD= 2, 0xC3, 0x0020, 1

DATATYPE = <register name>, [<bitfield name>,] <type> [, RANGE= <min>:<max>] //<comment>

Defines a data type and optional valid range for a register or bitfield. The data type is used by DevWare when displaying the value in decimal format in the Registers window and Watch window. The range is used for the slider control on the Registers window.

Possible values for <type> are: unsigned, signed (2's complement), signmag (sign-magnitude), fixed1fixed32 (2's complement fixed-point), ufixed1ufixed32, float16, float (IEEE single precision).

Example: RED_GAIN register has five fractional bits.
DATATYPE = RED_GAIN, ufixed5
Example: CAM_HUE_ANGLE is signed and ranges from -22 to 22.
DATATYPE= CAM_HUE_ANGLE, signed, RANGE= -22:22

DELAY = <milliseconds> //<comment>

Valid value range is 1 to 5000.

Delay a certain amount of time (in milliseconds) before continuing.

Example: Delay 1000 milliseconds.
DELAY = 1000 //delay 1000 milliseconds

ERROR_IF = <register name>, [<bitfield name>,] <condition>, "<message>" //<comment>

Only <, <=, ==, !=, >, >= are supported for <condition>.

If the condition is true, show the message in an error dialog. The user may choose to continue executing the preset or stop. (The midlib2 mi_LoadINIPreset() call will output a message to the log file if logging is on, and stop executing the preset.)

Example: Read register SEQ_STATE, if it is not equal to 3 show the message "Not in preview mode".
ERROR_IF= SEQ_STATE, !=3, "Not in preview mode."

FAR1 = <page>, <address>, [<mask>,] <value> //<comment>

Write to a register on the first attached camera. The <page> parameter is required. If the sensor doesn't use paged register addressing use 0 for the page number.

The optional mask parameter lets you set a bitfield, like the BITFIELD command.
Example: Set bit 5 in register 0x3044 on the attached camera
FAR1= 0, 0x3044, 0x0020, 1

FAR2 = <page>, <address>, [<mask>,] <value> //<comment>

Write to a register on the second attached camera. The <page> parameter is required. If the sensor doesn't use paged register addressing use 0 for the page number.

The optional mask parameter lets you set a bitfield, like the BITFIELD command.
Example: Set bit 5 in register 0x3044 on the attached camera
FAR2= 0, 0x3044, 0x0020, 1

FIELD_WR = <register name>, [<bitfield name>,] <value> //<comment>

Write to a register or bitfield by name. Command works for any kind of register, variable or SFR.

Example: Set "SEQ_CAP_MODE" variable to 0.
FIELD_WR = SEQ_CAP_MODE, 0 //capture parameters, VIDEO Off

ICON = <icon name> [,CHECKED|RADIO= <register name>[:<bitfield name>]|STATE:<STATE variable> <condition>] [,ENABLED= <register name>[:<bitfield name>|:<mask>]|STATE:<STATE variable> <condition>]  //<comment>

Otherwise the name specifies a built-in icon image. The built-in images are different colored shapes. Specify the shape and color. The shapes are circle, square, triangle and star. The colors are black, brown, red, orange, yellow, green, blue, violet, gray and white.

Example: Use a built-in icon image.
ICON= green square.

Optionally you can define the 'checked' (pressed-in) and enabled (not grayed out) state for the button, based on the value of a register, bitfield or DevWare STATE variable. The <condition> can be ==, !=, <, >, <=, or >= followed by a numerical constant. Use the RADIO keyword for a group of mutually exclusive buttons. Use the CHECKED keyword for independent buttons.

Example: Load icon from file antishake.bmp, and declare that the button should be pressed-in when SEQ_STATE_CFG_2_AS equals 1 and not pressed otherwise.
ICON= antishake.bmp, CHECKED= SEQ_STATE_CFG_2_AS == 1

Example: Load icon from file Zoom1.bmp, and declare that the button should be pressed-in when the DevWare STATE variable Display Zoom Percent equals 100.
ICON= Zoom1.bmp, CHECKED= STATE:Display Zoom Percent == 100

See also the MENUITEM= and TOOLTIP= commands.

IF_FIELD = <register name>, [<bitfield name>,] <condition>, LOAD=<preset1> [, ELSELOAD=<preset2>] //<comment>

Only <, <=, ==, !=, >, >= are supported for <condition>.

Similar to LOAD, but conditioned on the value of a register.

Example: Read register SHUTTER_WIDTH_LIM_AE, if it is greater than 0x100, load preset [Night mode], otherwise, load preset [Day mode].
IF_FIELD= SHUTTER_WIDTH_LIM_AE,>0x100, LOAD=Night mode, ELSELOAD=Day mode

IF_REG = [<addr_space>,] <address>, <mask>, <condition>, LOAD=<preset1> [, ELSELOAD=<preset2>] //<comment>

Only <, <=, ==, !=, >, >= are supported for <condition>.

Similar to LOAD, but conditioned on the value of a register.

Example: Read register 0x37 on page 2, if it is equal to 0x100, load preset [Night mode], otherwise, load preset [Day mode].
IF_REG= 2, 0x37, 0xFFFF,== 0x100, LOAD=Night mode, ELSELOAD=Day mode

IF_SERIAL= <base>, <address>, <mask>, [<addrsize>:<datasize>, ] <condition>, LOAD=<preset1> [, ELSELOAD=<preset2>] //<comment>

Only <, <=, ==, !=, >, >= are supported for <condition>.

Similar to LOAD, but conditioned on the value of a SHiP register. This command can read any SHiP bus device, not just the sensor. Typically it could be used to test a headboard EEPROM location.

Example: Read location 0x1FF1 in an EEPROM at base address 0xA8, and if it is equal to 1 then load preset [Serial Init], otherwise, load preset [Par init].
IF_SERIAL= 0xA8, 0x1FF1, 0xFF, 16:8, == 1, LOAD=Serial Init, ELSELOAD=Par Init

IMAGE = <width>, <height> [, < image type>]  [, <context>] //<comment>

Set software to expect the given image size and type. Command does not change sensor mode.

Width and height parameters are required, but you can use 0 for either value to mean "don't change". The image type is optional. Possible values for image type are: BAYER-8, BAYER-10, BAYER-8+2, BAYER-10IHDR, BAYER-12, BAYER-8+4, BAYER-12HDR, BAYER-14, BAYER-14HDR, BAYER-20, BAYER-16+4, YCBCR, YCBCR-16, YUV-420, M420, RGB-565, RGB-555, RGB-444X, RGB-X444, RGB-332, RGB-24, RGB-32, RGB-48, JPEG, JPEG-SPEEDTAGS

Context is optional, and represents the context number to apply the settings to.  Value is 0 to n, where n is the maximum number of contexts - 1.

Example: Tell the software that the sensor output will be 808 x 608, 10-bit Bayer.
IMAGE = 808, 608, BAYER-10, 0

LOAD = [< ini file name>,] <preset> //<comment>

Load a preset from an ini file.

Examples:
Load preset [Video Capture On] from current INI file.
LOAD= Video Capture ON

Load preset [Day mode] from A-0360-REV2.ini.
LOAD= A-0360-REV2.ini, Day mode

LOAD_PROM = <I2C-address>, <type> [, <label>] [, ELSELOAD= <preset>] //<comment>

Load a preset from an EEPROM on the sensor headboard. The type can be CCM, PGA, SWCCM, SWPGA or SWSTEREO to load hardware or software CCM (color correction) or PGA (lens correction) settings or stereo alignment. The label is optional to specify which settings to load if there are more than one stored in the EEPROM. The midlib API function ap_LoadINIPreset() does not support SWCCM, SWPGA, or SWSTEREO.

Optionally you can specify a preset in the ini file to load in the case where the EEPROM does not have the data.

Example:
Load software lens correction settings.
LOAD_PROM= 0xA8, SWPGA

LOG = "<text>" //<comment>

Add a line of text to the DevWare Register Log window. If the Register Log window is not enabled then nothing happens.

Remember that DevWare users expect the contents of the Log to be an executable ini file sequence, so your text should either begin with a // comment mark, or be a valid ini file command.

Example:
Add a comment to the Log window.
LOG= "// Setting Night Mode"

MEM = <region>, <address>, [<mask>,] <value> //<comment>

Write a value to a 16-bit RAM location.

Example: Set 16-bit location 0xB0A in patch RAM to a value of 0x0010.
MEM= 0, 0x0B0A, 0x0010

MEM8 = <region>, <address>, [<mask>,] <value> //<comment>

Write a value to an 8-bit RAM location.

Example: Set 8-bit RAM location 0x411 to value of 0x02.
MEM8= 0, 0x411, 0x02

MEM32 = <region>, <address>, [<mask>,] <value> //<comment>

Write a value to a 32-bit RAM location.

Example: Set 32-bit location 0xD950 to a value of 0x00FF01FF.
MEM32= 0, 0xD950, 0x00FF01FF

MENUITEM = "<menu text>", LOAD= <preset> [, ICON= <icon name>] [,CHECKED|RADIO= <register name>[:<bitfield name>|:<mask>]|STATE:<STATE variable> <condition>] [,ENABLED= <register name>[:<bitfield name>|:<mask>]|STATE:<STATE variable> <condition>][,SHORTCUT=<key combination>]  //<comment>

Defines a drop-down menu item for a User Toolbar button in DevWare. Only takes effect if the preset name begins with "Toolbar:" or "Toolbar2:". This command causes the toolbar button behavior to change to a drop-down menu action.

The INI File Users Guide#ICON=, CHECKED=, RADIO= and ENABLED= attributes work as in the ICON= command, except they apply only to the menu item, not the toolbar button. The icon file must be a .bmp (32-bpp, R-G-B-alpha) file, 13x13 pixels for the normal Windows text size. SHORTCUT= attribute works like the SHORTCUT= command, but applies only to this menu item.

If ICON= is used then CHECKED= or RADIO= will may have no visible effect depending on OS or GUI library.

The maximum number of menu items on a single toolbar button is 25.

Example: Group multiple presets under one button, with a separator between Parallel and HiSPi.
[Toolbar: 1280x720]
MENUITEM= "Parallel 1280x720 36.19fps", LOAD= Parallel 1280x720 36.19fps XBin2YBin2_BinSum
MENUITEM= "Parallel 1280x720 51.69fps", LOAD= Parallel 1280x720 51.69fps XBin2YSkip2_ColSum2
MENUITEM="-"
MENUITEM= "HiSPi 1280x720 51.69fps", LOAD= HiSPi 1280x720 51.69fps XBin2YSkip2_ColSum2

Example: Image Orientation control for a SMIA sensor using radio button icons
[Toolbar: Orientation]
MENUITEM= "Normal", LOAD= Normal, RADIO= IMAGE_ORIENTATION==0
MENUITEM= "Mirror", LOAD= Horiz Mirror, RADIO= IMAGE_ORIENTATION==1
MENUITEM= "Flip", LOAD= Vertical Flip, RADIO= IMAGE_ORIENTATION==2
MENUITEM= "Rotate 180", LOAD= Rotate 180, RADIO= IMAGE_ORIENTATION==3
[Normal]
FIELD_WR= IMAGE_ORIENTATION, 0
[Horiz Mirror]
FIELD_WR= IMAGE_ORIENTATION, 1
[Vertical Flip]
FIELD_WR= IMAGE_ORIENTATION, 2
[Rotate 180]
FIELD_WR= IMAGE_ORIENTATION, 3

Note: if "LOAD=" is not supplied, then that MENUITEM will be disabled but still displayed. 
To to provide visual separators between MENUITEM sections, use MENUITEM= "-".

See also the ICON=, SHORTCUT= and TOOLTIP= commands.

OPTION = <option name>, <value> //<comment>
OPTION = <option name>, "<string>" //<comment>

Set an Option variable. If the second parameter is enclosed in quotation marks then set a string-valued variable, else set an integer-valued variable.

See the DevWare COM Development Guide document for more information about the Option variables in DevWare, under the section titled "Option Functions".

Example: Make the Analysis Graph window visible.
OPTION= AnalysisDlg Show, 1
Example: Set the still image capture file name and path.
OPTION= Capture File, "c:\stillimages\capture"

POLL_FIELD = <register name>, [<bitfield name>,] <condition>, DELAY=<delay>, TIMEOUT=<iterations> //<comment>

Only <, <=, ==, !=, >, >= are supported for <condition>.

Poll a register. Similar to DELAY, but conditioned on the value of a register. The polling continues while the condition is true. The timeout value is in iterations of the polling loop. The timeout in milliseconds is therefore delay*timeout.

Example: Read register AE_ZONE_INDEX, if the value is greater than 8, wait for 50ms and then read the register again. Otherwise proceed to the next command. If the condition is still true after 10 tries, the loop times out. It is essentially a while loop used to delay until a condition is met.
POLL_FIELD= AE_ZONE_INDEX,>8, DELAY=50, TIMEOUT=10

POLL_REG = [<addr_space>,] <address>, <mask>, <condition>, DELAY=<delay>, TIMEOUT=<timeout> //<comment>

Only <, <=, ==, !=, >, >= are supported for <condition>.

Poll a register. Similar to DELAY, but conditioned on the value of a register. The polling continues while the condition is true. The timeout value is in iterations of the polling loop. The timeout in milliseconds is therefore delay*timeout.

Example: Read register 0x3F on page 2, if the value is greater than 8, wait for 50ms and then read the register again. Stop when the condition is false or after 10 tries.
POLL_REG= 2, 0x3F, 0xFFFF,>8, DELAY=50, TIMEOUT=10

POLL_VAR = <page>, <address>, <mask>, <condition>, DELAY=<delay>, TIMEOUT=<timeout> //<comment>

Only <, <=, ==, !=, >, >= are supported for <condition>.

Like POLL_REG, but polls a variable.

PROMPT =  [OKONLY,] "<message>" [, "<choice1>", LOAD=<preset1>, etc.] //<comment>

Create a multiple-choice dialog box, and execute the preset chosen by the user. A "Skip this" choice is automatically added so the user can choose to do nothing. The user can stop execution of the current preset by clicking Cancel.

"OKONLY" is optional. When present and the user does not select "OK", a new Prompt will be displaying warning the user that not selecting OK may have unintended results.
The choices are optional. If there are no choices then the dialog only shows the message and OK and Cancel buttons that will continue execution of the current preset or stop execution.

Commas are allowed inside quoted strings. The \n sequence in the message will convert to a newline.

Example: Ask user whether to do parallel or serial configuration.
PROMPT= "Is this camera using a parallel or serial interface?", "Parallel". LOAD=Parallel Init, "Serial", LOAD=Serial Init

PYTHON = <statement>

Execute a single Python statement. This makes it convenient to have a small Python instruction in an otherwise non-Python preset. Typical uses would be to set a register to a calculated value, or call a Python function defined elsewhere in the ini file.

Example: Call a Python function.
PYTHON= setExposureMode(SensorExposureMode.EXPOSURE_MODE_HDR_DLO)

REG = [<page>,] <address>, <value> //<comment>

Write a value to a sensor register.

Example: Set register 0xE0 on page 1 to value of 1
REG= 1, 0xE0, 0x0001 // ENABLE ccp format = jpeg

REG_BURST = [<page>,] <address>, <value> [,<value> …] //<comment>

Write a sequence of sensor register values in one bus transaction. Normally the device will auto-increment the address so the values go to sequential addresses. The page parameter must be present if the device uses 8-bit addressing with pages, and must not be present otherwise.

USB has a limit of 64 bytes per command, so that is the limit. DevWare allows the REG_BURST command to be any length, but if it is longer than 64 bytes (including the address at the beginning) then it will be split into several commands.


Example: Set registers 0xC8 through 0xCB on page 1
REG_BURST= 1, 0xC8, 0x03A1, 0x4444, 0xC902, 0x3E56



SAVE_IMAGE = [<filename>] [, <filename2> …] [,debug] //<comment>

Attempt to get a frame of image data from the camera. If successful and if filenames are provided, write the data to the files in the image capture directory or in the path(s) given. The image gets no processing. A four-digit sequence number will be appended to the filename. The midlib mi_LoadINIPreset() function can only save binary raw files. DevWare can save other file formats including text files, PNG files and DNG files.
If no path is provided for the filename, the file(s) will be stored in the location specified in the "Image Save Options" dialog of "Sensor Control".

If no filename is given then the command will get the next image from the camera and discard it. This can be useful to skip a bad frame or wait one frame time.
If the debug option is specified then the data will be saved regardless of any I/O error that might occur. If debug is not specified then the file will only be created if there was no I/O error.

Usage rules for filename:

1. If only a file name is given, it will be saved at the location set in "Image Save Options".
2. If a path is supplied, it must be a full path including a leading drive and/or "\" - relative paths are not supported.
3. If a path is supplied and a folder doesn't exist in that path, only a single folder can be created in the path.
The folder to be created can be either a single folder (e.g. c:\f1 - f1 is created) or the last folder in the path (e.g c:\f1\f2 - f1 exists and f2 is created).

Example:
SAVE_IMAGE = capture.raw

SAVE_REGS = <filename> [, <register spec>, …] //<comment>

Write register values to a file. If no register names are specified, write all registers. The register values are written in the ini file format. A four-digit sequence number will be appended to the filename.
If no path is provided for the filename, the file(s) will be stored in the location specified in the "Image Save Options" dialog of "Sensor Control".

Specify registers to save by their names as defined in the sensor data file, separated by commas. Wildcards are allowed. An '*' matches 0 or more characters, and a '?' matches exactly one character, like filename wildcards.
On sensors with multiple pages (address spaces) of registers, you can specify a page by its name from the address spaces section of the sensor data file, followed by a colon. For example, CORE: specifies all registers in page "CORE". If you prefix a register specification with a page, then only registers in that page will be saved. Wildcards are not allowed in the page name.

Example: Save all registers to a file.
SAVE_REGS = all.ini
Save all registers with "AE" or "AWB" in their names.
SAVE_REGS = ae_awb_.ini, AE, AWB
Save all sensor core registers.
SAVE_REGS = core.ini, CORE:
Save all sensor core registers with "GAIN" in their names.
SAVE_REGS = core_gain.ini, CORE:GAIN

SENSOR_BASE = <base> //<comment>

Force the sensor SHiP base address to a particular value, or auto-detect the base address. To force the address use a number for <base>. To auto-detect the address use * (asterisk) for <base>.

Example: Set the sensor base address to 0x6E.
SENSOR_BASE= 0x6E

SERIAL_REG = <base>, <addr>, <value> [, <addrsize>:<datasize>] //<comment>

Low-level write to Two-Wire Serial Interface register.

Although this command can be used to access registers on the sensor, its primary use is to write to registers on other devices given its base address. The sizes, in bits, of the register address and value may be specified after the value. The possible sizes are 0, 8, 16 or 32 bits. The default is 8:16.

Example: Set register 0x10 at base address 0x64 on the Demo2 FPGA to value of 16 through the Serial bus. The register address is 8 bits and the value is 16 bits.
SERIAL_REG= 0x64, 0x10, 16, 8:16

SFR = <address>, [<mask>,] <value> //<comment>

Write a value to a 16-bit special function register, on certain sensors. This is like MEM=, but without the region parameter.

The optional mask parameter lets you set a bitfield, like the BITFIELD command.
Example: Set 16bit SFR GPIO register 0x1070, bit 5 to 1
SFR= 0x1070, 0x0020, 1 // GPIO_DATA

SFR8 = <address>, [<mask>,] <value> //<comment>

Write a value to an 8-bit special function register, on certain sensors. This is like MEM8=, but without the region parameter.

Example: Set upper 4 bits of 8-bit SFR GPIO register 0x10B0 to 3
SFR8= 0x10B0, 0xF0, 3 // GPIO_WG_CONFIG, EN_16BIT_COUNTER

SHORTCUT = <key combination> //<comment>

Define a keyboard shortcut to be associated with this preset. Must be near the beginning of the preset.

At this time the SHORTCUT command only has effect in User Toolbar buttons (if the name of the preset begins with Toolbar: or Toolbar2:.).

Note: using a built-in shortcut used by DevWare can disable it; see section 2.2.2 of the DevWare Detailed documentation for a list of built-in shortcuts.

Any key can be used for the shortcut, for example SHORTCUT= Z, or SHORTCUT= F7. The key name is not case-sensitive. Also modifier keys Shift, Ctrl and Alt can be specified with the key name. Use a plus sign + between the modifier key name and the main key name, for example SHORTCUT= Shift+F6, or SHORTCUT= Ctrl+E. Multiple modifiers can be used, for example SHORTCUT= Ctrl+Shift+F6. The modifiers must come before the main key name, but they can be in any order. Spaces between the modifier and key name are OK.

When deciding on shortcut keys, keep in mind the keyboard layout and existing conventions. For example Shift+= is impossible on U.S. keyboards as the = sign is on the unshifted key. On some international keyboards the opposite may be true. Also, keys like Home may have different names on international keyboards. But always specify modifier keys with "Shift", "Ctrl" and "Alt" (the U.S. keyboard names) even for international keyboards. The Alt key is typically used for menu navigation, so it's use should be limited to a few function keys, or avoided.

SHORTCUT= key definitions will override the default key definitions in DevWare, so this feature can be used to reassign keys if you don't need the default action. These key assignments (as well as the default key assignments) only take effect when the main DevWare window has keyboard focus, not if a dialog or other UI control has keyboard focus. This means that it is OK to use numbers and letters for shortcuts, and you will still be able to enter text in edit boxes, etc.


Example: Define a keyboard shortcut for a toolbar button.
[Toolbar: Zoom 1X]
SHORTCUT= Ctrl+1

STATE = <state>, <value> //<comment>

Set a variable within the software, not on the sensor. See STATE Variables for a list of supported states.

Example: Set Auto Exposure Target to 50
STATE= Auto Exposure Target, 50

TOOLTIP = "<tip text>" //<comment>

Define a tooltip to be associated with this preset. Must be near the beginning of the preset.

At this time the TOOLTIP command only has effect in User Toolbar buttons (if the name of the preset begins with Toolbar: or Toolbar2:.). The tip text is shown on the screen when the user hovers the mouse cursor over the toolbar button.

Example: Define a tooltip for a toolbar button.
[Toolbar: Anti-Shake]
TOOLTIP= "Toggle the anti-shake feature on and off"

VAR = <page>, <address>, [<mask>,] <value> //<comment>

Write a value to a 16-bit firmware variable.

Example: Set 16-bit firmware variable 0x0B on page 7 to value of 0x0010.
VAR= 7, 0x0B, 0x0010 //ENABLE JPEG FOR MODE B

VAR8 = <page>, <address>, [<mask>,] <value> //<comment>

Write a value to an 8-bit firmware variable.

Example: Set 8-bit firmware variable 0x20 on page 1 to value of 0x02.
VAR8= 1, 0x20, 0x02 // SETUP SEQUENCER, video

VAR32 = <page>, <address>, [<mask>,] <value> //<comment>

Write a value to a 32-bit firmware variable.

Example: Set 32-bit firmware variable 0x8 on page 18 to value of 27000000.
VAR32= 18, 0x08, 27000000 // CAM_SENSOR_CFG_PIXCLK

XMCLK = <Hz> //<comment>

Set the frequency of the clock signal XMCLK on DEMO2 camera base boards. XMCLK typically routes to the clock input on the sensor if the jumper on the headboard is set to XMCLK. DEMO2 supports only 6.75, 10, 12, 13.5, 20, 24, 27, 40, 48, 54, 80, or 96 MHz. DEMO2X supports any frequency.

Example: Set XMCLK to 24MHz.
XMCLK= 24000000

Custom Register Dialog Definition via "[Register Tabs"]

The per-defined preset "Register Tabs" is used to define a customized version of the Register Dialog.
It uses constructs from Python to define and control the entries connected to registers or Python "getter" and "setter" routines.
It is assumed that the user has a solid understand of Python and its implementation in DevWare; that User Guide is here.

The types of controls include;

  • Check Box; enable/disable.

  • Spin Box; up/down arrows to run through values. Also allows for direct entry of a value.

  • Slider; a slider to run through values.

  • List Box; a user-defined set of values to select from.

For usage details, see the DevWare Python Developer Guide section on "Register Tabs".

  • No labels