Visible to Intel only — GUID: lzg1639044433734
Ixiasoft
Visible to Intel only — GUID: lzg1639044433734
Ixiasoft
6. Video and Vision Processing IPs Software Programming Model
HAL Device Drivers for Nios II SBT
For software control and run-time reconfiguration, the Intel video and vision processing IPs have an associated software driver. The video IPs do not fit any of the generic device models provided by the Nios II HAL. Consequently, the bare-metal drivers only provide partial HAL support with a few dedicated accessor functions to the control and status registers. The video functions cannot be accessed indirectly through the generic HAL API or the ANSI C standard library.
Using these drivers in your application is optional. If you do not use drivers, Intel recommends you use the definitions provided by the register header files to control the IP components (*_regs.h) and avoid using unnamed constants and addresses to access the run-time register map from your application.
Refer to the Nios® II Software Developer's Handbook to get started with the Nios® II development tools.
Common Software API
Many Intel video and vision processing IPs expose a register map with common registers located at the same location (refer to the Video and Vision Processing Registers. To limit code footprint, many video and vision processing device structures (C struct) include a common device structure as their first member. This shared base allows the definition of a set of common functions to query the VID_PID and VERSION registers, respectively at addresses 0x0000 and 0x0004, and the set of IMG_INFO registers in the range 0x0120-0x013C.
Common API reference
Register definition header file: intel_vvp_core_regs.h
Include file: intel_vvp_core.h
Name | Description |
---|---|
intel_vvp_core_init | Initialize the instance. |
intel_vvp_core_get_vendor_id | Returns the vendor ID. |
intel_vvp_core_get_product_id | Returns the product ID. |
intel_vvp_core_get_qpds_major | Returns the version major number. |
intel_vvp_core_get_qpds_update | Returns the version update number. |
intel_vvp_core_get_qpds_patch | Returns the version patch number. |
intel_vvp_core_get_register_map_version | Returns the version number of the register map. |
intel_vvp_core_get_img_info_width | Returns the width read from the IMG_INFO_WIDTH register. |
intel_vvp_core_get_img_info_height | Returns the height read from the IMG_INFO_HEIGHT register. |
intel_vvp_core_get_img_info_interlace | Returns the interlace nibble read from the IMG_INFO_INTERLACE register. |
intel_vvp_core_get_img_info_colorspace | Returns the colorspace code read from the IMG_INFO_COLORSPACE register. |
intel_vvp_core_get_img_info_subsampling | Returns the subsampling code read from the IMG_INFO_SUBSAMPLING register. |
intel_vvp_core_get_img_info_cositing | Returns the cositing code read from the IMG_INFO_COSITING register. |
intel_vvp_core_get_img_info_field_count | Returns the field count code read from the IMG_INFO_FIELD_COUNT register. |
intel_vvp_core_set_img_info_width | Writes a width to the IMG_INFO_WIDTH register. |
intel_vvp_core_set_img_info_height | Writes a height to the IMG_INFO_HEIGHT register. |
intel_vvp_core_set_img_info_interlace | Writes an interlace nibble to the IMG_INFO_INTERLACE register. |
intel_vvp_core_set_img_info_colorspace | Writes a colorspace code to the IMG_INFO_COLORSPACE register. |
intel_vvp_core_set_img_info_subsampling | Writes a subsampling code to the IMG_INFO_SUBSAMPLING register. |
intel_vvp_core_set_img_info_cositing | Writes a cositing code to the IMG_INFO_COSITING register. |
intel_vvp_core_init
- Prototype
-
eIntelVvpCoreErrors intel_vvp_core_init(intel_vvp_core_instance *instance, intel_vvp_core_base base, uint16_t expected_product_id);
- Description
-
Initializes the common members intel_vvp_core_instance. The initialization stops early if the vendor ID or product ID read at the base address are not a match. Otherwise, the function proceeds to read and store the version numbers in the second register
- Arguments
-
instance – pointer to the intel_vvp_core software driver instance structure
base – base address of the register map
expected_product_id – the expected product id
- Returns
-
kIntelVvpCoreOk (0) in case of success, a negative error code in case of error
kIntelVvpCoreVidErr if the vendor id of the core is not the IntelFPGA vendor ID (0x6AF7).
kIntelVvpCorePidErr if the product_id does not match with the expectation
kIntelVvpCoreInstanceErr if the instance is a null pointer
intel_vvp_core_get_vendor_id
- Prototype
-
uint16_t intel_vvp_core_get_vendor_id(void *instance);
- Description
-
Query the vendor_id of an initialized instance
- Arguments
-
instance – pointer to the initialized intel_vvp_core software driver instance structure or any software driver structure derived from it
- Returns
-
the vendor_id field in the intel_vvp_core_instance instance
intel_vvp_core_get_product_id
- Prototype
-
uint16_t intel_vvp_core_get_product_id(void *instance);
- Description
-
Query the product _id of an initialized instance
- Arguments
-
instance – pointer to the initialized intel_vvp_core software driver instance structure or any software driver structure derived from it
- Returns
-
the product_id field in the intel_vvp_core_instance instance
intel_vvp_core_get_qpds_major
- Prototype
-
uint8_t intel_vvp_core_get_qpds_major(void *instance);
- Description
-
Query the major version number of an instance. The instance must have been initialized successfully.
- Arguments
-
instance – pointer to the initialized intel_vvp_core software driver instance structure or any software driver structure derived from it
- Returns
-
the major version number field in the intel_vvp_core_instance instance
intel_vvp_core_get_qpds_update
- Prototype
-
uint8_t intel_vvp_core_get_qpds_ update(void *instance);
- Description
-
Query the minor version number of an instance. The instance must have been initialized successfully.
- Arguments
-
instance – pointer to the initialized intel_vvp_core software driver instance structure or any software driver structure derived from it
- Returns
-
the update (minor) version number field in the intel_vvp_core_instance instance
intel_vvp_core_get_qpds_patch
- Prototype
-
uint8_t intel_vvp_core_get_qpds_patch(void *instance);
- Description
-
Query the patch version number of an instance. The instance must have been initialized successfully.
- Arguments
-
instance – pointer to the initialized intel_vvp_core software driver instance structure or any software driver structure derived from it
- Returns
-
the patch (build) version number field in the intel_vvp_core_instance instance
intel_vvp_core_get_register_map_version
- Prototype
-
uint8_t intel_vvp_core_get_register_map_version(void *instance);
- Description
-
Query the register map version number of an instance. The instance must have been initialized successfully.
- Arguments
-
instance – pointer to the initialized intel_vvp_core software driver instance structure or any software driver structure derived from it
- Returns
-
the register map version number field in the intel_vvp_core_instance instance
intel_vvp_core_get_img_info_width
- Prototype
-
uint32_t intel_vvp_core_get_img_info_width(void *instance);
- Description
-
Read the IMG_INFO_WIDTH register of an instance. The instance must have been initialized successfully and the register readable.
- Arguments
-
instance – pointer to the initialized intel_vvp_core software driver instance structure or any software driver structure derived from it
- Returns
-
the value returned from a read to the image info width register
intel_vvp_core_get_img_info_height
- Prototype
-
uint32_t intel_vvp_core_get_img_info_height(void *instance);
- Description
-
Read the IMG_INFO_HEIGHT register of an instance. The instance must have been initialized successfully and the register readable.
- Arguments
-
instance – pointer to the initialized intel_vvp_core software driver instance structure or any software driver structure derived from it
- Returns
-
the value returned from a read to the image info height register
intel_vvp_core_get_img_info_interlace
- Prototype
-
uint8_t intel_vvp_core_get_img_info_interlace(void *instance);
- Description
-
Read the IMG_INFO_INTERLACE register of an instance. The instance must have been initialized successfully and the register readable.
- Arguments
-
instance – pointer to the initialized intel_vvp_core software driver instance structure or any software driver structure derived from it
- Returns
-
the value returned from a read to the image info interlace register
intel_vvp_core_get_img_info_colorspace
- Prototype
-
uint8_t intel_vvp_core_get_img_info_colorspace(void *instance);
- Description
-
Read the IMG_INFO_COLORSPACE register of an instance. The instance must have been initialized successfully and the register readable.
- Arguments
-
instance – pointer to the initialized intel_vvp_core software driver instance structure or any software driver structure derived from it
- Returns
-
the value returned from a read to the image info colorspace register
intel_vvp_core_get_img_info_subsampling
- Prototype
-
uint8_t intel_vvp_core_get_img_info_subsampling(void *instance);
- Description
-
Read the IMG_INFO_SUBSAMPLING register of an instance. The instance must have been initialized successfully and the register readable.
- Arguments
-
instance – pointer to the initialized intel_vvp_core software driver instance structure or any software driver structure derived from it
- Returns
-
the value returned from a read to the image info subsampling register
intel_vvp_core_get_img_info_cositing
- Prototype
-
uint8_t intel_vvp_core_get_img_info_cositing(void *instance);
- Description
-
Read the IMG_INFO_COSITING register of an instance. The instance must have been initialized successfully and the register readable.
- Arguments
-
instance – pointer to the initialized intel_vvp_core software driver instance structure or any software driver structure derived from it
- Returns
-
the value returned from a read to the image info cositing register
intel_vvp_core_get_img_info_field_count
- Prototype
-
uint16_t intel_vvp_core_get_img_info_field_count(void *instance);
- Description
-
Read the IMG_INFO_FIELD_COUNT register of an instance. The instance must have been initialized successfully and the register readable.
- Arguments
-
instance – pointer to the initialized intel_vvp_core software driver instance structure or any software driver structure derived from it
- Returns
-
the value returned from a read to the image info field count register
intel_vvp_core_set_img_info_width
- Prototype
-
eIntelVvpCoreErrors intel_vvp_core_set_img_info_width(void *instance, uint32_t width);
- Description
-
Write a new width to the IMG_INFO_WIDTH register of an instance. The instance must have been initialized successfully and the register writable.
- Arguments
-
instance – pointer to the initialized intel_vvp_core software driver instance structure or any software driver structure derived from it
width – new width
- Returns
-
kIntelVvpCoreOk (0) in case of success, a negative error code in case of error
intel_vvp_core_set_img_info_height
- Prototype
-
eIntelVvpCoreErrors intel_vvp_core_set_img_info_height(void *instance, uint32_t height);
- Description
-
Write a new height to the IMG_INFO_HEIGHT register of an instance. The instance must have been initialized successfully and the register writable.
- Arguments
-
instance – pointer to the initialized intel_vvp_core software driver instance structure or any software driver structure derived from it
height – new height
- Returns
-
kIntelVvpCoreOk (0) in case of success, a negative error code in case of error
intel_vvp_core_set_img_info_interlace
- Prototype
-
eIntelVvpCoreErrors intel_vvp_core_set_img_info_interlace(void *instance, uint8_t height);
- Description
-
Write a new interlace to the IMG_INFO_INTERLACE register of an instance. The instance must have been initialized successfully and the register writable.
- Arguments
-
instance – pointer to the initialized intel_vvp_core software driver instance structure or any software driver structure derived from it
height – new height
- Returns
-
kIntelVvpCoreOk (0) in case of success, a negative error code in case of error
intel_vvp_core_set_img_info_colorspace
- Prototype
-
eIntelVvpCoreErrors intel_vvp_core_set_img_info_colorpsace (void *instance, uint8_t colorspace);
- Description
-
Write a new colorspace to the IMG_INFO_COLORSPACE register of an instance. The instance must have been initialized successfully and the register writable.
- Arguments
-
instance – pointer to the initialized intel_vvp_core software driver instance structure or any software driver structure derived from it
colorspace – new colorspace
- Returns
-
kIntelVvpCoreOk (0) in case of success, a negative error code in case of error
intel_vvp_core_set_img_info_subsampling
- Prototype
-
eIntelVvpCoreErrors intel_vvp_core_set_img_info_subsampling(void *instance, uint8_t subsampling);
- Description
-
Write a new subsampling to the IMG_INFO_SUBSAMPLING register of an instance. The instance must have been initialized successfully and the register writable.
- Arguments
-
instance – pointer to the initialized intel_vvp_core software driver instance structure or any software driver structure derived from it
subsampling – new subsampling
- Returns
-
kIntelVvpCoreOk (0) in case of success, a negative error code in case of error
intel_vvp_core_set_img_info_cositing
- Prototype
-
eIntelVvpCoreErrors intel_vvp_core_set_img_info_cositing (void *instance, uint8_t cositing);
- Description
-
Write a new cositing to the IMG_INFO_COSITING register of an instance. The instance must have been initialized successfully and the register writable.
- Arguments
-
instance – pointer to the initialized intel_vvp_core software driver instance structure or any software driver structure derived from it
cositing – new cositing
- Returns
-
kIntelVvpCoreOk (0) in case of success, a negative error code in case of error