v_hcresampler
Vitis Drivers API Documentation
xv_hcresampler.c File Reference

Functions

int XV_hcresampler_CfgInitialize (XV_hcresampler *InstancePtr, XV_hcresampler_Config *ConfigPtr, UINTPTR EffectiveAddr)
 XV_hcresampler_CfgInitialize - Initialize the XV_hcresampler instance. More...
 
void XV_hcresampler_Start (XV_hcresampler *InstancePtr)
 This Function Starts the HC Resampler hardware core. More...
 
u32 XV_hcresampler_IsDone (XV_hcresampler *InstancePtr)
 Checks if the HC Resampler hardware core has completed its operation. More...
 
u32 XV_hcresampler_IsIdle (XV_hcresampler *InstancePtr)
 Checks if the HC Resampler hardware core is idle. More...
 
u32 XV_hcresampler_IsReady (XV_hcresampler *InstancePtr)
 Checks if the HC Resampler hardware core is ready for the next input. More...
 
void XV_hcresampler_EnableAutoRestart (XV_hcresampler *InstancePtr)
 Enables the auto-restart feature of the HC Resampler hardware. More...
 
void XV_hcresampler_DisableAutoRestart (XV_hcresampler *InstancePtr)
 Disable the auto-restart feature of the HC Resampler hardware. More...
 
void XV_hcresampler_Set_HwReg_width (XV_hcresampler *InstancePtr, u32 Data)
 Sets the hardware register width for the HC resampler instance. More...
 
u32 XV_hcresampler_Get_HwReg_width (XV_hcresampler *InstancePtr)
 Retrieves the value of the HWREG_WIDTH hardware register for the specified XV_hcresampler instance. More...
 
void XV_hcresampler_Set_HwReg_height (XV_hcresampler *InstancePtr, u32 Data)
 Sets the hardware register value for the 'height' parameter of the HC resampler instance. More...
 
u32 XV_hcresampler_Get_HwReg_height (XV_hcresampler *InstancePtr)
 Retrieves the value of the HWReg_height hardware register from the HC Resampler instance. More...
 
void XV_hcresampler_Set_HwReg_input_video_format (XV_hcresampler *InstancePtr, u32 Data)
 Sets the input video format hardware register for the HC resampler instance. More...
 
u32 XV_hcresampler_Get_HwReg_input_video_format (XV_hcresampler *InstancePtr)
 Retrieves the current input video format hardware register value. More...
 
void XV_hcresampler_Set_HwReg_output_video_format (XV_hcresampler *InstancePtr, u32 Data)
 Sets the output video format hardware register for the HC resampler instance. More...
 
u32 XV_hcresampler_Get_HwReg_output_video_format (XV_hcresampler *InstancePtr)
 Retrieves the current output video format hardware register value. More...
 
void XV_hcresampler_Set_HwReg_coefs_0_0 (XV_hcresampler *InstancePtr, u32 Data)
 Sets the hardware register coefficients for the HC resampler instance. More...
 
u32 XV_hcresampler_Get_HwReg_coefs_0_0 (XV_hcresampler *InstancePtr)
 Retrieves the current coefficient hardware register value for the HC resampler instance. More...
 
void XV_hcresampler_InterruptGlobalEnable (XV_hcresampler *InstancePtr)
 Enables global interrupts for the HC Resampler hardware core. More...
 
void XV_hcresampler_InterruptGlobalDisable (XV_hcresampler *InstancePtr)
 Disables global interrupts for the HC Resampler hardware core. More...
 
void XV_hcresampler_InterruptEnable (XV_hcresampler *InstancePtr, u32 Mask)
 Enables specific interrupts for the HC Resampler hardware core. More...
 
void XV_hcresampler_InterruptDisable (XV_hcresampler *InstancePtr, u32 Mask)
 Disable specific interrupts for the HC Resampler core. More...
 
void XV_hcresampler_InterruptClear (XV_hcresampler *InstancePtr, u32 Mask)
 Clears the specified interrupt(s) for the HC Resampler instance. More...
 
u32 XV_hcresampler_InterruptGetEnabled (XV_hcresampler *InstancePtr)
 Retrieves the interrupt enable register value for the HC Resampler instance. More...
 
u32 XV_hcresampler_InterruptGetStatus (XV_hcresampler *InstancePtr)
 Retrieves the current interrupt status for the HC Resampler instance. More...
 

Function Documentation

int XV_hcresampler_CfgInitialize ( XV_hcresampler InstancePtr,
XV_hcresampler_Config ConfigPtr,
UINTPTR  EffectiveAddr 
)

XV_hcresampler_CfgInitialize - Initialize the XV_hcresampler instance.

This function initializes an XV_hcresampler instance using the provided configuration structure and effective base address. It sets up the instance's configuration, assigns the base address, and marks the instance as ready.

Parameters
InstancePtrPointer to the XV_hcresampler instance to be initialized.
ConfigPtrPointer to the configuration structure containing hardware-specific settings.
EffectiveAddrPhysical base address of the device.
Returns
  • XST_SUCCESS if initialization was successful.

Preconditions:

  • InstancePtr must not be NULL.
  • ConfigPtr must not be NULL.
  • EffectiveAddr must not be NULL.

References XV_hcresampler_Config::BaseAddress, XV_hcresampler::Config, and XV_hcresampler::IsReady.

void XV_hcresampler_DisableAutoRestart ( XV_hcresampler InstancePtr)

Disable the auto-restart feature of the HC Resampler hardware.

This function disables the auto-restart capability of the HC Resampler by writing '0' to the AP_CTRL register. After calling this function, the hardware will not automatically restart processing after completing a task and will require manual intervention to start again.

Parameters
InstancePtrPointer to the XV_hcresampler instance.
Returns
None CODE
  • InstancePtr must not be NULL.
  • InstancePtr->IsReady must be equal to XIL_COMPONENT_IS_READY.

References XV_hcresampler_Config::BaseAddress, XV_hcresampler::Config, XV_hcresampler::IsReady, and XV_HCRESAMPLER_CTRL_ADDR_AP_CTRL.

Referenced by XV_HCrsmplStop().

void XV_hcresampler_EnableAutoRestart ( XV_hcresampler InstancePtr)

Enables the auto-restart feature of the HC Resampler hardware.

This function sets the auto-restart bit in the control register of the HC Resampler, allowing the hardware to automatically restart its operation after completing a task, without requiring software intervention.

Parameters
InstancePtrPointer to the XV_hcresampler instance.
Returns
None

Preconditions:

  • InstancePtr must not be NULL.
  • The instance must be ready (IsReady == XIL_COMPONENT_IS_READY).

References XV_hcresampler_Config::BaseAddress, XV_hcresampler::Config, XV_hcresampler::IsReady, and XV_HCRESAMPLER_CTRL_ADDR_AP_CTRL.

Referenced by XV_HCrsmplStart().

u32 XV_hcresampler_Get_HwReg_coefs_0_0 ( XV_hcresampler InstancePtr)

Retrieves the current coefficient hardware register value for the HC resampler instance.

This function reads the value of the coefficient register from the hardware and returns it to the caller. It is used to obtain the current filter coefficients configured in the HC resampler.

Parameters
InstancePtrPointer to the XV_hcresampler instance.
Returns
The value of the coefficient hardware register.

References XV_hcresampler_Config::BaseAddress, XV_hcresampler::Config, and XV_hcresampler::IsReady.

u32 XV_hcresampler_Get_HwReg_height ( XV_hcresampler InstancePtr)

Retrieves the value of the HWReg_height hardware register from the HC Resampler instance.

This function reads the current value of the HWReg_height register from the hardware using the base address specified in the instance configuration.

Parameters
InstancePtris a pointer to the XV_hcresampler instance. It must be initialized and ready before calling this function.
Returns
The value of the HWReg_height register as a 32-bit unsigned integer.
Note
The function asserts that InstancePtr is not NULL and that the instance is ready before accessing the hardware register.

References XV_hcresampler_Config::BaseAddress, XV_hcresampler::Config, and XV_hcresampler::IsReady.

Referenced by XV_HCrsmplDbgReportStatus().

u32 XV_hcresampler_Get_HwReg_input_video_format ( XV_hcresampler InstancePtr)

Retrieves the current input video format hardware register value.

This function reads the value of the input video format register from the hardware and returns it to the caller.

Parameters
InstancePtrPointer to the XV_hcresampler instance.
Returns
The value of the input video format hardware register.

References XV_hcresampler_Config::BaseAddress, XV_hcresampler::Config, and XV_hcresampler::IsReady.

Referenced by XV_HCrsmplDbgReportStatus().

u32 XV_hcresampler_Get_HwReg_output_video_format ( XV_hcresampler InstancePtr)

Retrieves the current output video format hardware register value.

This function reads the value of the output video format register from the hardware and returns it to the caller.

Parameters
InstancePtrPointer to the XV_hcresampler instance.
Returns
The value of the output video format hardware register.

References XV_hcresampler_Config::BaseAddress, XV_hcresampler::Config, and XV_hcresampler::IsReady.

Referenced by XV_HCrsmplDbgReportStatus().

u32 XV_hcresampler_Get_HwReg_width ( XV_hcresampler InstancePtr)

Retrieves the value of the HWREG_WIDTH hardware register for the specified XV_hcresampler instance.

This function reads the HWREG_WIDTH register from the hardware and returns its value. It asserts that the provided instance pointer is not NULL and that the instance is ready before accessing the register.

Parameters
InstancePtrPointer to the XV_hcresampler instance.
Returns
The value of the HWREG_WIDTH register.

References XV_hcresampler_Config::BaseAddress, XV_hcresampler::Config, and XV_hcresampler::IsReady.

Referenced by XV_HCrsmplDbgReportStatus().

void XV_hcresampler_InterruptClear ( XV_hcresampler InstancePtr,
u32  Mask 
)

Clears the specified interrupt(s) for the HC Resampler instance.

This function writes the given interrupt mask to the Interrupt Status Register (ISR) to clear the corresponding interrupt(s) for the specified HC Resampler instance.

Parameters
InstancePtrPointer to the XV_hcresampler instance.
MaskBitmask specifying which interrupt(s) to clear.
Returns
None.

References XV_hcresampler_Config::BaseAddress, XV_hcresampler::Config, and XV_hcresampler::IsReady.

void XV_hcresampler_InterruptDisable ( XV_hcresampler InstancePtr,
u32  Mask 
)

Disable specific interrupts for the HC Resampler core.

This function disables the interrupts specified by the Mask parameter for the given HC Resampler instance. It reads the current interrupt enable register, clears the bits specified by Mask, and writes the updated value back to the register.

Parameters
InstancePtrPointer to the XV_hcresampler instance.
MaskBitmask of interrupts to disable.
Returns
None.

References XV_hcresampler_Config::BaseAddress, XV_hcresampler::Config, and XV_hcresampler::IsReady.

void XV_hcresampler_InterruptEnable ( XV_hcresampler InstancePtr,
u32  Mask 
)

Enables specific interrupts for the HC Resampler hardware core.

This function sets the specified interrupt mask in the interrupt enable register of the HC Resampler hardware core, allowing those interrupts to be generated.

Parameters
InstancePtrPointer to the XV_hcresampler instance.
MaskThe mask of interrupts to enable.
Returns
None

References XV_hcresampler_Config::BaseAddress, XV_hcresampler::Config, and XV_hcresampler::IsReady.

u32 XV_hcresampler_InterruptGetEnabled ( XV_hcresampler InstancePtr)

Retrieves the interrupt enable register value for the HC Resampler instance.

This function reads the Interrupt Enable Register (IER) of the specified XV_hcresampler instance to determine which interrupts are currently enabled.

Parameters
InstancePtrPointer to the XV_hcresampler instance.
Returns
The value of the interrupt enable register (IER).

References XV_hcresampler_Config::BaseAddress, XV_hcresampler::Config, and XV_hcresampler::IsReady.

u32 XV_hcresampler_InterruptGetStatus ( XV_hcresampler InstancePtr)

Retrieves the current interrupt status for the HC Resampler instance.

This function reads the Interrupt Status Register (ISR) of the specified XV_hcresampler instance to determine which interrupts are currently active.

Parameters
InstancePtrPointer to the XV_hcresampler instance.
Returns
The value of the interrupt status register (ISR).

References XV_hcresampler_Config::BaseAddress, XV_hcresampler::Config, and XV_hcresampler::IsReady.

void XV_hcresampler_InterruptGlobalDisable ( XV_hcresampler InstancePtr)

Disables global interrupts for the HC Resampler hardware core.

This function clears the global interrupt enable bit in the control register of the HC Resampler hardware core, preventing it from generating interrupts.

Parameters
InstancePtrPointer to the XV_hcresampler instance.
Returns
None

References XV_hcresampler_Config::BaseAddress, XV_hcresampler::Config, and XV_hcresampler::IsReady.

void XV_hcresampler_InterruptGlobalEnable ( XV_hcresampler InstancePtr)

Enables global interrupts for the HC Resampler hardware core.

This function sets the global interrupt enable bit in the control register of the HC Resampler hardware core, allowing it to generate interrupts.

Parameters
InstancePtrPointer to the XV_hcresampler instance.
Returns
None

References XV_hcresampler_Config::BaseAddress, XV_hcresampler::Config, and XV_hcresampler::IsReady.

u32 XV_hcresampler_IsDone ( XV_hcresampler InstancePtr)

Checks if the HC Resampler hardware core has completed its operation.

This function reads the control register of the HC Resampler hardware core to determine if the current operation is done. It asserts that the provided instance pointer is not NULL and that the core is ready before accessing the hardware register.

Parameters
InstancePtris a pointer to the XV_hcresampler instance.
Returns
1 if the operation is done, 0 otherwise.

References XV_hcresampler_Config::BaseAddress, XV_hcresampler::Config, XV_hcresampler::IsReady, and XV_HCRESAMPLER_CTRL_ADDR_AP_CTRL.

Referenced by XV_HCrsmplDbgReportStatus().

u32 XV_hcresampler_IsIdle ( XV_hcresampler InstancePtr)

Checks if the HC Resampler hardware core is idle.

This function reads the control register of the HC Resampler hardware core to determine if it is idle. It asserts that the provided instance pointer is not NULL and that the core is ready before accessing the hardware register.

Parameters
InstancePtris a pointer to the XV_hcresampler instance.
Returns
1 if the core is idle, 0 otherwise.

References XV_hcresampler_Config::BaseAddress, XV_hcresampler::Config, XV_hcresampler::IsReady, and XV_HCRESAMPLER_CTRL_ADDR_AP_CTRL.

Referenced by XV_HCrsmplDbgReportStatus().

u32 XV_hcresampler_IsReady ( XV_hcresampler InstancePtr)

Checks if the HC Resampler hardware core is ready for the next input.

This function reads the control register of the HC Resampler hardware core to determine if it is ready for the next input. It asserts that the provided instance pointer is not NULL and that the core is ready before accessing the hardware register.

Parameters
InstancePtris a pointer to the XV_hcresampler instance.
Returns
1 if the core is ready, 0 otherwise.

References XV_hcresampler_Config::BaseAddress, XV_hcresampler::Config, XV_hcresampler::IsReady, and XV_HCRESAMPLER_CTRL_ADDR_AP_CTRL.

Referenced by XV_HCrsmplDbgReportStatus().

void XV_hcresampler_Set_HwReg_coefs_0_0 ( XV_hcresampler InstancePtr,
u32  Data 
)

Sets the hardware register coefficients for the HC resampler instance.

This function writes the specified coefficient data to the hardware register associated with the given HC resampler instance. It is used to configure the resampling filter coefficients.

Parameters
InstancePtrPointer to the XV_hcresampler instance.
DataValue to be written to the coefficient hardware register.
Returns
None.

References XV_hcresampler_Config::BaseAddress, XV_hcresampler::Config, and XV_hcresampler::IsReady.

void XV_hcresampler_Set_HwReg_height ( XV_hcresampler InstancePtr,
u32  Data 
)

Sets the hardware register value for the 'height' parameter of the HC resampler instance.

This function writes the specified height value to the corresponding hardware register of the given XV_hcresampler instance. It first asserts that the instance pointer is not NULL and that the instance is ready before performing the register write.

Parameters
InstancePtrPointer to the XV_hcresampler instance.
DataThe height value to be written to the hardware register.
Returns
None

References XV_hcresampler_Config::BaseAddress, XV_hcresampler::Config, and XV_hcresampler::IsReady.

Referenced by XV_HCrsmplSetActiveSize().

void XV_hcresampler_Set_HwReg_input_video_format ( XV_hcresampler InstancePtr,
u32  Data 
)

Sets the input video format hardware register for the HC resampler instance.

This function writes the specified input video format data to the hardware register associated with the given HC resampler instance.

Parameters
InstancePtrPointer to the XV_hcresampler instance.
DataValue to be written to the input video format hardware register.
Returns
None.

References XV_hcresampler_Config::BaseAddress, XV_hcresampler::Config, and XV_hcresampler::IsReady.

Referenced by XV_HCrsmplSetFormat().

void XV_hcresampler_Set_HwReg_output_video_format ( XV_hcresampler InstancePtr,
u32  Data 
)

Sets the output video format hardware register for the HC resampler instance.

This function writes the specified output video format data to the hardware register associated with the given HC resampler instance.

Parameters
InstancePtrPointer to the XV_hcresampler instance.
DataValue to be written to the output video format hardware register.
Returns
None.

References XV_hcresampler_Config::BaseAddress, XV_hcresampler::Config, and XV_hcresampler::IsReady.

Referenced by XV_HCrsmplSetFormat().

void XV_hcresampler_Set_HwReg_width ( XV_hcresampler InstancePtr,
u32  Data 
)

Sets the hardware register width for the HC resampler instance.

This function writes the specified width value to the hardware register associated with the HC resampler. It first asserts that the instance pointer is not NULL and that the instance is ready before performing the register write.

Parameters
InstancePtrPointer to the XV_hcresampler instance.
DataThe width value to be written to the hardware register.
Returns
None

References XV_hcresampler_Config::BaseAddress, XV_hcresampler::Config, and XV_hcresampler::IsReady.

Referenced by XV_HCrsmplSetActiveSize().

void XV_hcresampler_Start ( XV_hcresampler InstancePtr)

This Function Starts the HC Resampler hardware core.

This function initiates the operation of the HC Resampler by writing to the control register. It first asserts that the provided instance pointer is valid and that the core is ready. Then, it reads the current value of the control register, preserves the auto-restart bit (bit 7), and sets the start bit (bit 0) to begin processing.

Parameters
InstancePtrPointer to the XV_hcresampler instance.
Note
The function assumes that the hardware core has been properly initialized and is ready to start.

References XV_hcresampler_Config::BaseAddress, XV_hcresampler::Config, XV_hcresampler::IsReady, and XV_HCRESAMPLER_CTRL_ADDR_AP_CTRL.

Referenced by XV_HCrsmplStart().