v_frmbuf_wr
Vitis Drivers API Documentation
xv_frmbufwr_example.c File Reference

Overview

This file demonstrates the example usage of Frame Buffer Read/Write IP available in catalogue.

Please refer v_frmbuf_wr example design guide for details on HW setup.

MODIFICATION HISTORY:
Ver   Who    Date     Changes


1.00 vyc 04/05/17 Initial Release 2.00 vyc 10/04/17 Add second buffer pointer for semi-planar formats Add new memory formats BGRX8 and UYVY8 3.00 vyc 04/04/18 Add support for ZCU102, ZCU104, ZCU106 Add new memory format BGR8 4.00 pv 11/10/18 Added flushing feature support in driver. flush bit should be set and held (until reset) by software to flush pending transactions.IP is expecting a hard reset, when flushing is done.(There is a flush status bit and is asserted when the flush is done). 4.10 vv 02/05/19 Added new pixel formats with 12 and 16 bpc. 4.50 kp 12/07/21 Added new 3 planar video format Y_U_V8 4.60 kp 12/03/21 Added new 3 planar video format Y_U_V10

Macros

#define XVMonitor_IsVideoLocked(GpioPtr)   (XGpio_DiscreteRead(GpioPtr, 1))
 These macros read GPIO to check video lock and overflow status. More...
 

Functions

void resetIp (void)
 Resets the HLS (High-Level Synthesis) IP core and stops the frame buffer write operation. More...
 
void * XVFrameBufferRdCallback (void *data)
 Callback function for Frame Buffer Read interrupt. More...
 
void * XVFrameBufferWrCallback (void *data)
 Callback function for Frame Buffer Write interrupt. More...
 
int main (void)
 Main application entry point for the Frame Buffer Example Design Test. More...
 

Macro Definition Documentation

#define XVMonitor_IsVideoLocked (   GpioPtr)    (XGpio_DiscreteRead(GpioPtr, 1))

These macros read GPIO to check video lock and overflow status.

Parameters
GpioPtris pointer to the gpio Instance
Returns
T/F

Referenced by main().

Function Documentation

int main ( void  )

Main application entry point for the Frame Buffer Example Design Test.

This function initializes the platform, configures hardware drivers (VTC, frame buffers, GPIO), sets up interrupts, and iterates through all supported video formats and test video modes. For each valid combination, it configures the VTC and frame buffer, checks for video lock and overflow, and tracks pass/fail results. At the end, it prints a summary of the test results.

Returns
0 on success, 1 on failure.

References XV_frmbufwr_Config::AXIMMDataWidth, XV_frmbufwr::Config, XV_FrmbufWr_l2::FrmbufWr, init_platform(), XV_frmbufwr_Config::MaxDataWidth, XV_frmbufwr_Config::PixPerClk, resetIp(), XVFrameBufferRdCallback(), XVFrameBufferWrCallback(), XVFRMBUFWR_HANDLER_DONE, XVFrmbufWr_SetCallback(), and XVMonitor_IsVideoLocked.

void resetIp ( void  )

Resets the HLS (High-Level Synthesis) IP core and stops the frame buffer write operation.

This function performs the following steps:

  1. Stops the frame buffer write core and waits for it to become idle.
  2. Prints a message indicating that the HLS IP is being reset.
  3. Asserts the reset line for the HLS IP by writing 0 to the reset GPIO.
  4. Waits for 1 millisecond to ensure the reset is asserted.
  5. Deasserts the reset line by writing 1 to the reset GPIO.
  6. Waits for another millisecond to allow the IP to come out of reset.

This ensures a proper reset sequence for the HLS IP and the frame buffer write core.

References XVFrmbufWr_Stop().

Referenced by main().

void* XVFrameBufferRdCallback ( void *  data)

Callback function for Frame Buffer Read interrupt.

This function is called when a Frame Buffer Read interrupt is received. It starts the frame buffer read operation by calling XVFrmbufRd_Start().

Parameters
dataPointer to user data (unused).
Returns
Always returns NULL.

Referenced by main().

void* XVFrameBufferWrCallback ( void *  data)

Callback function for Frame Buffer Write interrupt.

This function is called when a Frame Buffer Write interrupt is received. It starts the frame buffer write operation by invoking XVFrmbufWr_Start().

Parameters
dataPointer to user data (unused in this implementation).
Returns
Always returns NULL.

References XVFrmbufWr_Start().

Referenced by main().