Aptina Imaging Device Library API

Aptina Imaging Device Library API

Camera Functions

The following API functions are used by the application to open and close cameras.

mi_OpenCameras()

Definition:
mi_s32 mi_OpenCameras(mi_camera_t *pCameras[MI_MAX_CAMERAS], mi_s32 *nNumCameras, const char *sensor_dir_file);
Summary:
This routine goes through all supported transport types and attempts to initialize each camera. It returns the number of successfully opened cameras and a pointer to each. The user may specify the full path of a particular sensor data file (.sdat or .xsdat) or image file or video file, or a directory name to search for a valid sensor data file. For this purpose, the function mi_SensorData() returns the path to the sensor data files installation directory. If the call is successful, the user must then start the transport they wish to connect to by calling mi_startTransport() on the desired camera. This is the first device library routine the application must call.
If you specify a directory to search, mi_OpenCameras() will try all .sdat and .xsdat files in the directory until it finds a match with the attached sensor. The operation may take some time, so you may want provide a Cancel button on your user interface. Call mi_CancelProbe() from another thread to cancel the device probe. If so cancelled, mi_OpenCameras() will return MI_CAMERA_ERROR.
If you specify a particular sensor data file, the device probe operation will be skipped, and the SHiP base address will be set to the first address listed in the sensor data file. If the sensor may be on a secondary base address then you may call mi_DetectSensorBaseAddr() to automatically select the correct base address.
If there is no sensor data file available, either because the hardware doesn't contain a sensor or because no sensor data file has been defined for this sensor; the user may pass a NULL string "" for the sensor_dir_file. No mi_sensor_t structure (mi_camera_t::sensor) will be created at this time. To create one the user must call mi_updateFrameSize. The user must have a mi_sensor_t structure in order to use mi_grabFrame().
The sensor data file may be an image file or video file. The library will create mi_camera_t and mi_sensor_t structures that can be used in any midlib API call. mi_grabFrame() will return the image data from the file. In this case no physical camera need be present.
Parameters:
mi_camera_t *pCameras[MI_MAX_CAMERAS] - list of cameras found
mi_s32*nNumCameras - number of cameras found
const char * sensor_dir_file - full directory path or filename of sensor data file or "" if there is no sensor data file
Returns:
Error code if no cameras are found otherwise MI_CAMERA_SUCCESS
See also:
mi_initTransport()
mi_updateFrameSize()

mi_OpenCameras2()

Definition:
mi_s32 mi_OpenCameras2(mi_camera_t *pCamera[MI_MAX_CAMERAS], mi_s32 *nNumCameras, const char *sensor_dir_file, mi_u32 transportType, const char *dllName);
Summary:
This function is an extended version of mi_OpenCameras() that lets you specify which transport types to use and optionally the filename of the DLL or directory name to search for a DLL-defined transport. See the MIDLib Transport DLL Development Guide document (MIDLib Transport DLL Development Guide.pdf) for details on how to write a transport DLL.
Parameters:
mi_camera_t *pCameras[MI_MAX_CAMERAS]- list of cameras found
mi_s32*nNumCameras- number of cameras found
const char * sensor_dir_file- full directory path or filename of sensor data file or "" if there is no sensor data file
mi_u32transportType- Logical OR of transport types defined in midlib2.h
const char *dllName- Optional filename for DLL or directory to search for DLLs.
Returns:
Error code if no cameras are found otherwise MI_CAMERA_SUCCESS

mi_CloseCameras()

Definition:
void mi_CloseCameras();
Summary:
This routine closes and frees all opened cameras. It must be called before exiting the application.
Parameters:
None
Returns:
None

mi_CloseCameras2()

Definition:
void mi_CloseCameras2(mi_camera_t *pCameras[], mi_s32 nNumCameras);
Summary:
This routine closes and frees the cameras specified in the array of camera pointers passed in. Reverses the effect of a call to mi_OpenCameras() or mi_OpenCameras2(). It is useful in particular when you have simultaneously opened both a physical camera and an image file pseudo-camera with two separate calls to mi_OpenCameras() and you want to close only one of them.
Parameters:
mi_camera_t *pCameras[MI_MAX_CAMERAS]- list of cameras
mi_s32 nNumCameras- number of cameras in the list
Returns:
None

mi_DetectSensorBaseAddr()

Definition:
mi_s32 mi_DetectSensorBaseAddr(mi_camera_t *pCamera);
Summary:
This function searches the SHiP base addresses listed in the sensor data file to find out which base address the sensor is using, and then sets the sensor->shipAddr field of the pCamera structure. It works by attempting to read CHIP_VERSION_REG register using each base address and looking for a match. If you passed a specific sensor data file name to mi_OpenCameras() then you should call this function to find the sensor base address in use.
Parameters:
mi_camera_t *pCamera- camera structure being used
Returns:
MI_CAMERA_SUCCESS if the sensor base address was positively identified.
MI_CAMERA_ERROR otherwise. In this case the shipAddr field will remain unchanged.

mi_DetectPartNumber()

Definition:
mi_s32 mi_DetectPartNumber(mi_camera_t *pCamera);
Summary:
If the sensor data file had multiple part numbers declared, this function selects the correct part number. If you passed a specific sensor data file name to mi_OpenCameras() then you may call this function to correct the part number.
Parameters:
mi_camera_t *pCamera- camera structure being used
Returns:
MI_CAMERA_SUCCESS always.

mi_ProbeFarBus()

Definition:
mi_s32 mi_ProbeFarBus(mi_camera_t *pCamera);
Summary:
This function is for ICP-HD or similar devices. It will test all device addresses on the ICP-HD bus master and remember which ones ACK. Subsequently, any attempt to access an address that did not ACK during probe will immediately fail. This is necessary because the ICP-HD DMA function will halt the firmware if there is no ACK. This function must be called at the appropriate point in the startup sequence. It is unsafe to call after ICP-HD is up and running.
Parameters:
mi_camera_t *pCamera- camera structure being used
Returns:
MI_CAMERA_SUCCESS always.

mi_CancelProbe()

Definition:
void mi_CancelProbe();
Summary:
Cancels any device probe (the process of searching a directory for sensor data files that match the sensors attached to the computer) that may be in progress in another thread. mi_OpenCameras() will return immediately with MI_CAMERA_ERROR.
Parameters:
None
Returns:
None

Register Search Functions

The following are functions used to search the list of registers, defined in the sensor data file. These are not necessary for basic camera operation and are only provided for convenience.

mi_ExistsRegister()

Definition:
mi_s32 mi_ExistsRegister(mi_camera_t* pCamera, const char* pszRegisterName);
Summary:
This routine determines if the pszRegisterName (Unique identifier) exists in the sensor register list (pCamera->sensor->regs). Put another way, it returns whether mi_FindRegister() will return a valid pointer.
Parameters:
mi_camera_t* pCamera - camera structure being used
const char* pszRegisterName - unique ID of register to look for
Returns:
True (1) if register exists or False (0) if the register cannot be found

mi_ExistsBitfield()

Definition:
mi_s32 mi_ExistsBitfield(mi_camera_t* pCamera, const char* pszRegisterName, const char* pszBitfieldName);
Summary:
This routine determines if the pszBitfieldName exists as a bitfield for the register of pszRegisterName (unique identifier) in the sensor register list (pCamera->sensor->regs). If the bitfield name is NULL or "" the function returns false. Put another way, it returns whether mi_FindBitfield() will return a valid pointer.
Parameters:
mi_camera_t* pCamera- camera structure being used
const char* pszRegisterName- unique ID of register containing bitfield
const char* pszBitfieldName- name of bitfield to look for
Returns:
True (1) if register exists or False (0) if the bitfield cannot be found

mi_FindRegister()

Definition:
mi_reg_data_t* mi_FindRegister(mi_camera_t* pCamera, const char* pszRegisterName);
Summary:
This routine returns a pointer to the mi_reg_data_t structure with pszRegisterName (unique identifier) found in the sensor register list (pCamera->sensor->regs).
Parameters:
mi_camera_t* pCamera- camera structure being used
const char* pszRegisterName- unique ID of register to look for
Returns:
Pointer to the mi_reg_data_t structure with name "pszRegisterName". Returns NULL if register not found.

mi_FindBitfield()

Definition:
mi_bitfield_t* mi_FindBitfield(mi_camera_t* pCamera, const char* pszRegisterName, const char* pszBitfieldName);
Summary:
This routine returns a pointer to the mi_bitfield_t structure with "pszBitfieldName" within the register of pszRegisterName (unique identifier) found in the sensor register list (pCamera->sensor->regs).
Parameters:
mi_camera_t* pCamera - camera structure being used
const char* pszRegisterName - unique ID of register to look for
const char* pszBitfieldName - name of bitfield in register to look for
Returns:
Pointer to the mi_bitfield_ structure with name "pszBitfieldName". Returns NULL if register or bitfield is not found.

mi_ExistsRegister2()

Definition:
mi_s32 mi_ExistsRegister2(mi_camera_t* pCamera, const char* pszRegisterName);
Summary:
Similar to mi_ExistsRegister(), but searches the chip (non-sensor) registers also.
Parameters:
mi_camera_t* pCamera- camera structure being used
const char* pszRegisterName- unique ID of register to look for
Returns:
True (1) if register exists or False (0) if the register cannot be found

mi_ExistsBitfield2()

Definition:
mi_s32 mi_ExistsBitfield2(mi_camera_t* pCamera, const char* pszRegisterName, const char* pszBitfieldName);
Summary:
Similar to mi_ExistsBitfield(), but searches the chip (non-sensor) registers also.
Parameters:
mi_camera_t* pCamera- camera structure being used
const char* pszRegisterName- unique ID of register containing bitfield
const char* pszBitfieldName- name of bitfield to look for
Returns:
True (1) if register exists or False (0) if the bitfield cannot be found

mi_FindRegister2()

Definition:
mi_reg_data_t* mi_FindRegister(mi_camera_t* pCamera, const char* pszRegisterName);
Summary:
Similar to mi_FindRegister(), but searches the chip (non-sensor) registers also.
Parameters:
mi_camera_t* pCamera- camera structure being used
const char* pszRegisterName- unique ID of register to look for
Returns:
Pointer to the mi_reg_data_t structure with name "pszRegisterName". Returns NULL if register not found.

mi_FindBitfield2()

Definition:
mi_bitfield_t* mi_FindBitfield2(mi_camera_t* pCamera, const char* pszRegisterName, const char* pszBitfieldName);
Summary:
Similar to mi_FindBitfield(), but searches the chip (non-sensor) registers also.
Parameters:
mi_camera_t* pCamera- camera structure being used
const char* pszRegisterName- unique ID of register to look for
const char* pszBitfieldName- name of bitfield in register to look for
Returns:
Pointer to the mi_bitfield_ structure with name "pszBitfieldName". Returns NULL if register or bitfield is not found.

mi_FindRegisterAddr()

Definition:
mi_reg_data_t* mi_FindRegisterAddr(mi_camera_t* pCamera, mi_u32 regAddr, mi_u32 addrSpace, mi_addr_type addrType);
Summary:
This routine returns a pointer to the mi_reg_data_t structure with a given register address, address space and address type found in the sensor register list (pCamera->sensor->regs)
Parameters:
mi_camera_t*pCamera - camera structure being used
mi_u32 regAddr - register address
mi_u32 addrSpace - address space or page being searched
mi_addr_type addrType - address type for this register
(i.e., MI_REG_ADDR, MI_MCU_ADDR)
Returns:
Pointer to the register structure of the matching register. Returns NULL if register is not found.

mi_FindRegisterWildcard()

Definition:
mi_reg_data_t* mi_FindRegisterWildcard(mi_camera_t* pCamera, const char* pszWildcard, int *pnPos);
Summary:
This routine returns a pointer to the first mi_reg_data_t structure with a unique identifier that matches the wildcard found in the sensor register list (pCamera->sensor->regs). The search starts at position *pnPos in the pCamera->sensor->regs list.
The wildcard works like filename wildcards where "" matches 0 or more characters and "?" matches any single character. For example "AWB" matches any register name beginning with "AWB". On sensors with multiple pages of registers you can restrict the search to a single page by specifying the page name followed by a colon, for example "CORE:GAIN". A page name by itself matches all registers on the page. "" matches all registers. Initialize *pnPos to 0 to start the search at the beginning of the sensor register list.
Parameters:
mi_camera_t* pCamera- camera structure being used
const char* pszWildcard - unique ID wildcard string
int *pnPos- pointer to an integer to track the search
Returns:
Pointer to the mi_reg_data_t structure matching the wildcard, or NULL.

mi_CurrentAddrSpace()

Definition:
mi_addr_space_val_t* mi_CurrentAddrSpace(mi_camera_t* pCamera);
Summary:
This routine returns a pointer to the mi_addr_space_val_t for the current address space being used by the sensor. This is only relevant for sensors which have an address space (page) register.
Parameters:
mi_camera_t * pCamera - camera structure being used
Returns:
Pointer to the relevant mi_addr_space_val_t structure from the array pCamera->sensor->addr_space->addr_space_val.
If the sensor data file has no address spaces defined, then that array will not exist and this function returns NULL. This is typical of Bayer-only sensors with only one address space. In such a case, use 0 for the address space and MI_REG_ADDR for the address space type in midlib function calls which require those parameters.

Register Read and Write Functions

There are several read/write functions that are used to access "high level" sensor registers; they only vary in the parameters which select the register to access. "High Level" means that the register is not limited to hardware registers it also includes microprocessor variables and registers that cover multiple address spans. The mi_Read/WriteSensorReg versions are used when you have access to the mi_reg_data_t structure. The mi_Read/WriteRegAddr functions are used when you only have register address information for the register. The mi_Read/WriteSensorRegStr can be used when you know the unique ID for the register.

mi_ReadSensorReg()

Definition:
mi_s32 mi_ReadSensorReg(mi_camera_t* pCamera, mi_reg_data_t* pReg, mi_u32* val);
Summary:
This routine will read the sensor register pointed to by pReg. The register can be a hardware register, a microprocessor variable or a multi-span register.
Parameters:
mi_camera_t* pCamera - camera structure being used
mi_reg_data_t*pReg - pointer to the structure for the register being read
mi_u32* val - value read
Returns:
MI_CAMERA_SUCCESS for successful register read or error code for failure

mi_WriteSensorReg()

Definition:
mi_s32 mi_WriteSensorReg(mi_camera_t pCamera, mi_reg_data_t pReg, mi_u32 val);
Summary:
This routine will write "val" to the sensor register pointed to by pReg. The register can be a hardware register, a microprocessor variable or a multi-span register.
Parameters:
mi_camera_t* pCamera - pointer to camera structure being used
mi_reg_data_t*pReg - pointer to the register structure of the register being written
mi_u32val - value to write
Returns:
MI_CAMERA_SUCCESS for successful register write or error code for failure

mi_ReadSensorRegAddr()

Definition:
mi_s32 mi_ReadSensorRegAddr(mi_camera_t* pCamera, mi_addr_type addrType, mi_u32 addrSpace, mi_u32 addr, mi_s32 is8, mi_u32 *value);
Summary:
This routine will read the sensor register defined by addrType, addrSpace and Addr. The register type can be a hardware register (MI_REG_ADDR), a microprocessor variable (MI_MCU_ADDR) or a multi-span register. This routine is only recommended if you do not have access to the register data structure or unique ID since you are required to pass in all of the information required to access the register. The is8 parameter has different meaning depending on addrType. If addrType is MI_MCU_ADDR or MI_SFR_ADDR then is8 is the width of the variable in bytes, with the special case that is8 == 0 means two bytes. If addrType is MI_REG_ADDR then is8 is the span, with the special case of is8 == 0 means span = 1.
Parameters:
mi_camera_t* pCamera - camera structure being used
mi_addr_typeaddrType - address type for this register
mi_u32addrSpace - address space (or page) register is on
mi_u32addr - register address (or offset for mcu variables)
mi_s32is8 - variable width or register span
mi_u32*value - value read
Returns:
MI_CAMERA_SUCCESS for successful register read or error code for failure

mi_WriteSensorRegAddr()

Definition:
mi_s32 mi_WriteSensorRegAddr(mi_camera_t* pCamera, mi_addr_type addrType, mi_u32 addrSpace, mi_u32 addr, mi_s32 is8, mi_u32 value);
Summary:
Like mi_ReadSensorRegAddr() except writes a register.
Parameters:
mi_camera_t* pCamera - camera structure being used
mi_addr_typeaddrType - address type for this register
mi_u32addrSpace - address space (or page) register is on
mi_u32addr - register address (or offset for mcu variables)
mi_s32is8 - variable width or register span
mi_u32value - value to write
Returns:
MI_CAMERA_SUCCESS for successful register write or error code for failure

mi_ReadSensorRegStr()

Definition:
mi_s32 mi_ReadSensorRegStr(mi_camera_t pCamera, const char pszRegisterName, const char* pszBitfieldName, mi_u32 *val);
Summary:
This routine will read the sensor register given the register name (unique ID from sensor data file). An optional bitfield name (from sensor data file) can be provided to read part of a register. The register can be any register or variable defined in the sensor data file.
Parameters:
mi_camera_t* pCamera - pointer to camera structure being used
const char*pszRegisterName - unique ID of register to read
const char*pszBitfieldName - name of bitfield in register read or ""
mi_u32*val - value read
Returns:
MI_CAMERA_SUCCESS for successful register read or error code for failure

mi_WriteSensorRegStr()

Definition:
mi_WriteSensorRegStr(mi_camera_t pCamera, const char pszRegisterName, const char* pszBitfieldName, mi_u32 val);
Summary:
This routine will write the sensor register given the register name (unique ID from sensor data file). An optional bitfield name (from sensor data file) can be provided to write part of a register (note that this will cause the entire register will be read first). The register can be any register or variable defined in the sensor data file.
Parameters:
mi_camera_t* pCamera - pointer to camera structure being used
const char*pszRegisterName - unique ID of register to write
const char*pszBitfieldName - name of bitfield in register write or ""
mi_u32val - value to write
Returns:
MI_CAMERA_SUCCESS for successful register write or error code for failure

Register Data Type Functions

Registers and bitfields may have a data type. For example, signed, unsigned, fixed point or floating point. The data types supported by midlib are enumerated in the mi_data_types definition. Midlib includes helper functions for converting the unsigned integer values used by the register read and write routines into double precision floating point and string representations.
For example if a register with bitmask 0xFFF (12 bits) and data type signed fixed point with five fraction bits has a value of 0xE13, the double representation is -15.40625, and the string representation is "-15.406".

mi_Int2Str()

Definition:
mi_s32 mi_Int2Str(mi_data_types dataType, mi_u32 val, mi_u32 mask, char *pszStr, mi_s32 bufferLen);
Summary:
Convert the unsigned integer used by the register read/write routines into a string according to the given data type and mask. The pszStr parameter may be NULL in which case the function just returns the required buffer size. Conversion to string is always in decimal unless the data type MI_HEX is used.
Parameters:
mi_data_types dataType- data type
mi_u32 val- register value data
mi_u32mask- right-aligned bitmask
char *pszStr- buffer to receive the string
mi_s32bufferLen- size of pszStr buffer
Returns:
The number of bytes written to the pszStr buffer, including the trailing NUL byte.

mi_Int2Double()

Definition:
double mi_Int2Double(mi_data_types dataType, mi_u32 val, mi_u32 mask);
Summary:
Convert the unsigned integer used by the register read/write routines into a C double according to the given data type and mask.
Parameters:
mi_data_typesdataType- data type
mi_u32val- register value data
mi_u32mask- right-aligned bitmask
Returns:
The input value converted to a double according to the data type.

mi_Str2Int()

Definition:
mi_u32 mi_Str2Int(mi_data_types dataType, const char *pszStr, mi_u32 mask);
Summary:
Convert the string to the corresponding unsigned integer value used by the register read/write routines according to the given data type and mask.
Parameters:
mi_data_typesdataType- data type
const char *pszStr- the string
mi_u32mask- right-aligned bitmask
Returns:
The unsigned integer value.

mi_Str2Double()

Definition:
double mi_Str2Double(mi_data_types dataType, const char *pszStr, mi_u32 mask);
Summary:
Convert the string to the corresponding double value according to the given data type and mask.
Parameters:
mi_data_typesdataType- data type
const char *pszStr- the string
mi_u32mask- right-aligned bitmask
Returns:
The input string converted to a double according to the data type.

mi_Double2Int()

Definition:
mi_u32 mi_Double2Int(mi_data_types dataType, double d, mi_u32 mask);
Summary:
Convert the double value into the unsigned integer value used by the register read/write routines, according to the given data type and mask.
Parameters:
mi_data_typesdataType- data type
doubled- register value data
mi_u32mask- right-aligned bitmask
Returns:
The input value converted to an unsigned integer.

mi_Double2Str()

Definition:
mi_s32 mi_Double2Str(mi_data_types dataType, double d, mi_u32 mask, char *pszStr, mi_s32 bufferLen);
Summary:
Convert the double value into a string according to the given data type and mask. The pszStr parameter may be NULL in which case the function just returns the required buffer size. Conversion to string is always in decimal unless the data type MI_HEX is used.
Parameters:
mi_data_typesdataType- data type
doubled- register value data
mi_u32mask- right-aligned bitmask
char *pszStr- buffer to receive the string
mi_s32bufferLen- size of pszStr buffer
Returns:
The number of bytes written to the pszStr buffer, including the trailing NUL byte.

mi_GetDataTypeString()

Definition:
const char *mi_GetDataTypeString(mi_data_types dataType);
Summary:
Return a string representing the name of the data type. For example mi_GetDataTypeString (MI_FIXED5) returns "fixed5".
Parameters:
mi_data_typesdataType- data type
Returns:
Pointer to a string.

mi_DataTypeFromString()

Definition:
mi_data_types mi_DataTypeFromString(const char *pszStr);
Summary:
Return the mi_data_types value given the name of a data type. For example mi_DataTypeFromString("fixed5") returns MI_FIXED5.
Parameters:
const char *pszStr- name of a data type
Returns:
Data type.

mi_DataTypeMinimum()

Definition:
double mi_DataTypeMinimum(mi_data_types dataType, mi_u32 mask);
Summary:
Return the minimum value possible with the given data type and mask. For example, the minimum value for 12-bit signed fixed point with five fraction bits is -64.0. The minimum value is undefined for floating point types, and this function will return 0.0.
Parameters:
mi_data_types dataType- data type
mi_u32mask- right-aligned bitmask
Returns:
Minimum possible value.

mi_DataTypeMaximum()

Definition:
double mi_DataTypeMaximum(mi_data_types dataType, mi_u32 mask);
Summary:
Return the maximum value possible with the given data type and mask. For example, the maximum value for 12-bit signed fixed point with five fraction bits is 63.96875. The maximum value is undefined for floating point types, and this function will return 0.0.
Parameters:
mi_data_typesdataType- data type
mi_u32mask- right-aligned bitmask
Returns:
Maximum possible value.

mi_DataTypeStep()

Definition:
double mi_DataTypeStep(mi_data_types dataType, mi_u32 mask);
Summary:
Return the difference between two successive values of the given data type. For example the step for fixed point with five fraction bits is 0.03125. The step is undefined for floating point types, and this function will return 0.0.
Parameters:
mi_data_typesdataType- data type
mi_u32mask- right-aligned bitmask
Returns:
Step between successive values.

Xsdat/sdat, INI and Cdat File Functions

 

mi_ParseSensorFile()

Definition:
mi_s32 mi_ParseSensorFile(mi_camera_t pCamera, const char fileName, mi_sensor_t *sensor_data);
Summary:
This routine parses a sensor data (.sdat or .xsdat) file (fileName) into the mi_sensor_t structure and returns an error message if there are parse errors. For more detailed information as to which line failed, turn on error logging. You can parse a sensor data file into a memory-only mi_camera_t without accessing any physical device with the following code
mi_camera_t *pCamera = (mi_camera_t *)calloc(1, sizeof(mi_camera_t));
pCamera->sensor = (mi_sensor_t *)calloc(1, sizeof(mi_sensor_t));
mi_InitCameraContext(pCamera);
retVal = mi_ParseSensorFile(pCamera, fileName, pCamera->sensor);
The functions mi_FindRegister(), mi_ExistsRegister(), etc. can be used with the pCamera structure.
To clean up when finished with the memory-only mi_camera_t do the following:
mi_DestructSensor(pCamera->sensor);
mi_FreeCameraContext(pCamera);
free(pCamera->sensor);
free(pCamera);
Parameters:
mi_camera_t*pCamera- camera structure being used
const char* filename- fileName of sensor data file to parse
mi_sensor_t*sensor_data- structure to fill in with sensor data
Returns:
MI_PARSE_SUCCESS Parsing was successful
MI_DUPLICATE_DESC_ERROR Duplicate unique descriptor was found
MI_PARSE_FILE_ERROR Unable to open sensor data file
MI_PARSE_REG_ERROR Error parsing the register descriptor
MI_UKNOWN_SECTION_ERROR Unknown Section found in sensor data file
MI_CHIP_DESC_ERROR Error parsing the chip descriptor section
MI_PARSE_ADDR_SPACE_ERROR Error parsing the address space section
See Also:
mi_OpenErrorLog()
mi_InitCameraContext()
mi_DestructSensor()

mi_ParseFarSensorFile()

Definition:
mi_s32 mi_ParseFarSensorFile (mi_camera_t *pCamera, const char *far_id, mi_addr_type far_type, mi_u32 far_base, const char *far_sdat, mi_sensor_t *sensor_data);
Summary:
This routine loads a sensor data file and adds the register data to the existing pCamera as FAR type registers. A Far sensor is one that is attached to a 'host' chip and accessed indirectly, for example a secondary sensor attached to a primary sensor. Up to two Far sensors may be declared, designated FAR1 and FAR2.
Parameters:
mi_camera_t*pCamera- camera structure being used
const char * far_id- symbol for the registers, can be anything but is
normally either "FAR1" or "FAR2"
mi_addr_type far_type- MI_FAR1_REG_ADDR or MI_FAR2_REG_ADDR
mi_u32far_base- SHIP base address of the Far sensor
const char *far_sdat- full path name of sensor data file to load
mi_sensor_t *sensor_data- data structure to accept the file data, may be NULL
Returns:
MI_PARSE_SUCCESS Parsing was successful
MI_DUPLICATE_DESC_ERROR Duplicate unique descriptor was found
MI_PARSE_FILE_ERROR Unable to open sensor data file
MI_PARSE_REG_ERROR Error parsing the register descriptor
MI_UKNOWN_SECTION_ERROR Unknown Section found in sensor data file
MI_CHIP_DESC_ERROR Error parsing the chip descriptor section
MI_PARSE_ADDR_SPACE_ERROR Error parsing the address space section
See Also:
mi_ParseFarSensorFile()

mi_ParseChipFile()

Definition: mi_s32 mi_ParseChipFile(mi_camera_t pCamera, const char fileName, mi_chip_t *chip_data); Summary: This routine parses a chip data (.cdat) file (fileName) into the mi_chip_t structure and returns an error message if there are parse errors. For more detailed information as to which line failed, turn on error logging. Parameters: mi_camera_t *pCamera- camera structure being used const char* fileName- fileName of chip data file to parse mi_chip_t*chip_data- structure to fill in with chip data Returns: MI_PARSE_SUCCESS Parsing was successful MI_DUPLICATE_DESC_ERROR Duplicate unique descriptor was found MI_PARSE_FILE_ERROR Unable to open chip data file MI_PARSE_REG_ERROR Error parsing the register descriptor MI_UKNOWN_SECTION_ERROR Unknown Section found in chip data file MI_CHIP_DESC_ERROR Error parsing the chip descriptor section See Also: mi_OpenErrorLog()