dsitxss: xdsitxss_intr_example.c File Reference

| dsitxss Xilinx SDK Drivers API Documentation

- Overview
- Data Structures
- APIs
- File List
- Examples

Functions
xdsitxss_intr_example.c File Reference

## Overview

This file contains a design example using the XDsiTxSs driver with interrupts.

This will provide interrupts for pixel under run and undefined data type

    MODIFICATION HISTORY:

    Ver Who Date    Changes

    1.0 ram 11/2/16 Initial Release for MIPI DSI TX subsystem
    1.1 ms  01/23/17 Modified xil_printf statement in main function to
                     ensure that "Successfully ran" and "Failed" strings
                     are available in all examples. This is a fix for
                     CR-965028.
        ms  04/05/17 Added tabspace for return statements in functions for
                     proper documentation while generating doxygen.

## Functions
u32 | DsiTxSs_IntrExample (u32 DeviceId)
| This function is the main entry point for the interrupt example using the DsiTxSs driver. More...
void | XDsiTxSs_IntrHandler (void *InstancePtr)
| This function is the interrupt handler for the MIPI DSI Tx Subsystem. More...
u32 | XDsiTxSs_SetCallback (XDsiTxSs *InstancePtr, u32 HandlerType, void *CallbackFunc, void *CallbackRef)
| This routine installs an asynchronous callback function for the given HandlerType: More...
void | XDsiTxSs_SetGlobalInterrupt (void *InstancePtr)
| This function will enable the interrupts present in the interrupt mask passed onto the function. More...
void | XDsiTxSs_InterruptEnable (void *InstancePtr, u32 Mask)
| This function will enable the interrupts present in the interrupt mask passed onto the function. More...
void | DsiTxSs_PixelUnderrunEventHandler (void *CallbackRef, u32 Mask)
| This function is called when a Packet level error event is received by the MIPI DSI Tx Subsystem core. More...
void | DsiTxSs_UnSupportDataEventHandler (void *CallbackRef, u32 Mask)
| This function is called when a DPHY level error event is received by the MIPI DSI Rx Subsystem core. More...
void | DsiTxSs_CmdQFIFOFullEventHandler (void *CallbackRef, u32 Mask)
| This function is called when a Command Queue FIFO full error event is received by the MIPI DSI Tx Subsystem core. More...
s32 | main ()
| This is the main function for XDsiTxSs interrupt example. More...
void | Delay (u32 Seconds)
| For Microblaze we use an assembly loop that is roughly the same regardless of optimization level, although caches and memory access time can make the delay vary. More...
s32 | SetupInterruptSystem (XDsiTxSs *DsiTxSsPtr)
| This function setups the interrupt system such that interrupts can occur for the DSI device. More...

## Function Documentation

void Delay | ( | u32 | Seconds | ) |

For Microblaze we use an assembly loop that is roughly the same regardless of optimization level, although caches and memory access time can make the delay vary.

Just keep in mind that after resetting or updating the PHY modes, the PHY typically needs time to recover.

Parameters

  Number | of seconds to sleep

Returns
  None

Note
  None

Referenced by DsiTxSs_IntrExample().

void DsiTxSs_CmdQFIFOFullEventHandler | ( | void * | CallbackRef,
|  | u32 | Mask
| ) |  |

This function is called when a Command Queue FIFO full error event is received by the MIPI DSI Tx Subsystem core.

Parameters

  CallbackRef | is a pointer to the DsiTxSs instance.
  Mask | of interrupt which caused this event

Returns
  None.

Note
  Use the DsiTxSs_CmdQFIFOFullEventHandler driver function to set this function as the handler for Command Queue FIFO Full error event.

Referenced by SetupInterruptSystem().

u32 DsiTxSs_IntrExample | ( | u32 | DeviceId | ) |

This function is the main entry point for the interrupt example using the DsiTxSs driver.

This function will set up the system with interrupts handlers.

Parameters

  DeviceId | is the unique device ID of the MIPI DSI Subsystem core.

Returns
  - XST_FAILURE if the system setup failed.
  - XST_SUCCESS should never return since this function, if setup was successful, is blocking.

Note
  If system setup was successful, this function is blocking in order to illustrate interrupt handling taking place for HPD events.

References XDsiTxSs_Config::BaseAddr, Delay(), SetupInterruptSystem(), XDsiTxSs_CfgInitialize(), XDsiTxSs_InterruptEnable(), XDsiTxSs_LookupConfig(), and XDsiTxSs_SelfTest().

Referenced by main().

void DsiTxSs_PixelUnderrunEventHandler | ( | void * | CallbackRef,
|  | u32 | Mask
| ) |  |

This function is called when a Packet level error event is received by the MIPI DSI Tx Subsystem core.

Parameters

  CallbackRef | is a pointer to the DsiTxSs instance.
  Mask | of interrupt which caused this event

Returns
  None.

Note
  Use the DsiTxSs_PixelUnderrunEventHandler driver function to set this function as the handler for Packet level error event.

Referenced by SetupInterruptSystem().

void DsiTxSs_UnSupportDataEventHandler | ( | void * | CallbackRef,
|  | u32 | Mask
| ) |  |

This function is called when a DPHY level error event is received by the MIPI DSI Rx Subsystem core.

Parameters

  CallbackRef | is a pointer to the DsiTxSs instance.
  Mask | of interrupt which caused this event

Returns
  None.

Note
  Use the DsiTxSs_UnSupportDataEventHandler driver function to set this function as the handler for Unsupport data error event.

Referenced by SetupInterruptSystem().

s32 main | ( |  | ) |

This is the main function for XDsiTxSs interrupt example.

If the DsiTxSs_IntrExample function which sets up the system succeeds, this function will wait for the interrupts. Notify the events

Parameters

  None. |

Returns
  - XST_FAILURE if the interrupt example was unsuccessful.

Note
  Unless setup failed, main will never return since DsiTxSs_IntrExample is blocking (it is waiting on interrupts for Hot-Plug-Detect (HPD) events.

References DsiTxSs_IntrExample().

s32 SetupInterruptSystem | ( | XDsiTxSs * | DsiTxSsPtr | ) |

This function setups the interrupt system such that interrupts can occur for the DSI device.

This function is application specific since the actual system may or may not have an interrupt controller. The DSI could be directly connected to a processor without an interrupt controller. The user should modify this function to fit the application.

Parameters

  DsiTxSsPtr | contains a pointer to the instance of the DSI component which is going to be connected to the interrupt controller.

Returns
  - XST_SUCCESS if successfully setup the interrupt
  - XST_FAILURE.failure to setup the interrupt

Note
  None.

References DsiTxSs_CmdQFIFOFullEventHandler(), DsiTxSs_PixelUnderrunEventHandler(), DsiTxSs_UnSupportDataEventHandler(), XDSITXSS_HANDLER_UNSUPPORT_DATATYPE, XDsiTxSs_IntrHandler(), XDsiTxSs_SetCallback(), and XDsiTxSs_SetGlobalInterrupt().

Referenced by DsiTxSs_IntrExample().