Sensor Data File Definition

Each sensor will have an associated sensor data file. The sensor data file is meant to be the "spec" for the sensor. These files were taken directly from the specifications provided for each sensor.
The sensor data file should adhere to the following format. Note that all of the fields in the chip descriptor section are required. The register section contains all registers for the sensor. Some registers are used internally in our supported applications and should not be removed or renamed or the application will be unable to function properly.
All numerical constants can be expressed in decimal or hex with 0x prefix, ex. 0x7B.
Some reserved register names are:
CHIP_VERSION_REG
RESET_REG
GREEN1_GAIN_REG
BLUE_GAIN_REG
RED_GAIN_REG
GREEN2_GAIN_REG
HORZ_BLANK_REG
INTEG_TIME_REG
VREF_REG
//Comments may be placed outside of sections
//This is the chip descriptor section, where each line has a "field = value"
[CHIP_DESCRIPTOR]
SENSORNAME = "string"
WIDTH = integer
HEIGHT = integer
IMAGE_TYPE = BAYER
BITS_PER_CLOCK = integer
CLOCKS_PER_PIXEL = integer
PIXEL_CLOCK_POLARITY = 0/1
SHIP_BASE_ADDRESS = integer or (integer integer …)
[END]
//The [ADDR_SPACE] section is required for sensors which have multiple
//address spaces (ie A-1310SOC). The ID "ID1" will be used in the register
//section for all of the registers that are part of the ID1 address
//space. The IDs can be any string, although common ones have been "SENSOR",
//"IP", "COLPIPE", etc. The type can be REG, MCU or SFR. If the type is not
//used, the default is REG. The integer is the value of the address space
//for that page.
[ADDR_SPACE]
ID1 = {type, integer, string}
ID2 = {type, integer, string}
ID3 = {type, integer, string}
[END]
//These are optional settings.
//PART_NUMBER is the Micron/Aptina MT9 number for the sensor
//EXTRA_DESC_REG is a workaround for sensors without a unique chip id
//SENSOR_VERSION specifies the REV version of the sensor
//VERSION_NAME overrides using REV as the version name, so for example ES1
//FULL_WIDTH and FULL_HEIGHT are used if sensors default width is not the
// full image size
//SDAT_VERSION is used to describe the version number of the sensor data file –
// current value is 2
//REG_ADDR_SIZE is the size of the register address (default is 8)
//REG_DATA_SIZE is the size of the register data (default is 16)
[OPTIONAL]
PART_NUMBER = string
EXTRA_DESC_REG = register
SENSOR_VERSION = integer
VERSION_NAME = string
FULL_WIDTH = integer
FULL_HEIGHT = integer
SDAT_VERSION = integer
REG_ADDR_SIZE = integer
REG_DATA_SIZE = integer
[END]
//This is the register section
//The register definitions supply the following information, the
//bitfield information is optional
//REGDEF1 = {ADDR, TYPE, SPAN, MASK, RW, DEFAULT, DESC, DETAIL}
// {BITDEF1, MASK, RW, DESC, DETAIL}
// {BITDEF2, MASK, RW, DESC, DETAIL}
// ...
// {BITDEF3, MASK, RW, DESC, DETAIL}
[REGISTERS]
REGDEF1 = {integer, CORE/IP, integer, integer, RW/RO, integer, "string", "string", "string"}
{BITDEF1, integer, RW/RO, "string", "string"}
{BITDEF2, integer, RW/RO, "string", "string"}
...
{BITDEF3, integer, RW/RO, "string", "string"}
REGDEF2 = {integer, CORE/IP, integer, RW/RO, integer, "string", "string", "string"}
[END]

Sample Sensor Data File

This is an example of a partial sensor data file. Note that the register section includes register descriptions (i.e., CHIP_VERSION_REG ROW_WINDOW_START_REG) as well as bitfield descriptions (APERTURE_GAIN_VALUE, APERTURE_GAIN_AUTO) for the APERTURE_GAIN register.
The registers cover all three address spaces listed: SENSOR, COLPIPE and CAMCTRL.
[CHIP_DESCRIPTOR]
SENSORNAME = "A-1310SOC"
WIDTH = 640
HEIGHT = 512
IMAGE_TYPE = YCBCR
BITS_PER_CLOCK = 8
CLOCKS_PER_PIXEL = 2
PIXEL_CLOCK_POLARITY = 1
SHIP_BASE_ADDRESS = 0xBA
[END]
[ADDR_SPACE]
SENSOR = {0, "0: Sensor Core"}
COLPIPE = {1, "1: Color Pipe"}
CAMCTRL = {2, "2: Camera Control"}
[END]
[OPTIONAL]
PART_NUMBER = "MT9M111"
SENSOR_VERSION = 1
VERSION_NAME = "REV1""
FULL_WIDTH = 1280
FULL_HEIGHT = 1024
[END]
[REGISTERS]
CHIP_VERSION_REG = {0x00, SENSOR, 0xFFFF, RO, 0x1419, "Chip Version", ""}
ROW_WINDOW_START_REG = {0x01, SENSOR, 0x07FF, RW, 0x000C, "Row Start", ""}
COL_WINDOW_START_REG = {0x02, SENSOR, 0x07FF, RW, 0x001C, "Column Start", ""}
APERTURE_GAIN = {0x05, COLPIPE,0x000F, RW, 0x0003, "Aperture", ""}
{APERTURE_GAIN_VALUE, 0x0007, RW,"0-2: Sharpening", ""}
{APERTURE_GAIN_AUTO, 0x0008, RW,"3: Auto Sharpening", ""}
BASE_MATRIX_SIGNS = {0x02, CAMCTRL,0x01FF, RW, 0x006E, "Signs", ""}
[END]