Driver
The HDMI IP requires a processor to setup the core. This can be any processor. A HDMI driver (prt_hdmi_drv) is provided for this task.
API
This section provides information about the driver API.
prt_hdmi_set_base
- description: Sets the HDMI peripheral base address.
- syntax: void prt_hdmi_set_base (prt_hdmi_ds_struct *hdmi, uint32_t base);
- parameters:
- hdmipointer to HDMI peripheral
- basebase address
- returns: none
prt_hdmi_set_cb
- description: Sets the HDMI call back handlers.
- syntax: void prt_hdmi_set_cb (prt_hdmi_ds_struct *hdmi, prt_hdmi_cb_type cb_type, void *cb_handler);
- parameters:
- dppointer to HDMI peripheral
- cb_typecall back type
- PRT_HDMI_CB_HPDHot Plug Detect
- PRT_HDMI_CB_STAStatus
- PRT_HDMI_CB_PHY_RATELink rate change
- PRT_HDMI_CB_LNKLink
- PRT_HDMI_CB_VIDVideo
- PRT_HDMI_CB_DBGDebug
- cb_handlerpointer to call back handler
- returns: none
prt_hdmi_rom_init
- description: Loads the HDMI IP ROM code.
- syntax: void prt_hdmi_rom_init (prt_hdmi_ds_struct *hdmi, uint32_t len, uint8_t *rom);
- parameters:
- hdmipointer to HDMI peripheral
- lenlength of ROM code
- rompointer to ROM code
- returns: none
prt_hdmi_ram_init
- description: Loads the HDMI IP RAM code.
- syntax: void prt_hdmi_ram_init (prt_hdmi_ds_struct *hdmi, uint32_t len, uint8_t *ram);
- parameters:
- hdmipointer to HDMI peripheral
- lenlength of RAM code
- rampointer to RAM code
- returns: none
prt_hdmi_init
- description: Initialize the HDMI IP.
- syntax: void prt_hdmi_init (prt_hdmi_ds_struct *hdmi, uint8_t id);
- parameters:
- hdmipointer to HDMI peripheral
- idDP peripheral identifier
- returns: none
prt_hdmi_ping
- description: Checks if the HDMI IP is alive.
- syntax: uint8_t prt_hdmi_ping (prt_hdmi_ds_struct *hdmi);
- parameters:
- hdmipointer to HDMI peripheral
- returns: true when the peripheral is running.
prt_hdmi_sta
- description: Reads the HDMI IP status.
- syntax: void prt_hdmi_sta (prt_hdmi_ds_struct *hdmi);
- parameters:
- hdmipointer to HDMI peripheral
- returns: none
prt_hdmitx_vid_str
- description: Starts the video stream.
- syntax: prt_hdmi_vid_str (prt_hdmi_ds_struct *hdmi, uint32_t tmds_clk, uint8_t vic);
- parameters:
- hdmipointer to HDMI peripheral
- tmds_clkTMDS clock frequency (in kHz)
- vicVIC number
- returns: true when the video is started, else false.
prt_hdmitx_vid_stp
- description: Stops the video stream.
- syntax: uint8_t prt_hdmi_vid_stp (prt_hdmi_ds_struct *hdmi;
- parameters:
- hdmipointer to HDMI peripheral
- returns: true when the video is stopped, else false.
prt_hdmitx_is_hpd
- description: Gets HPD status.
- syntax: uint8_t prt_hdmi_hpd_get (prt_hdmi_ds_struct *hdmi);
- parameters:
- hdmipointer to HDMI peripheral
- returns:true when the hpd is asserted, else false.
prt_hdmi_lnk_tmds_clk_get
- description: Gets requested TMDS clock.
- syntax: uint32_t prt_hdmi_get_phy_rate (prt_hdmi_ds_struct *hdmi);
- parameters:
- hdmipointer to HDMI peripheral
- returns:true TMDS clock frequency in kHz.
prt_hdmi_is_lnk_up
- description: Check if the link is up.
- syntax: uint8_t prt_hdmi_is_lnk_up (prt_hdmi_ds_struct *hdmi);
- parameters:
- hdmipointer to HDMI peripheral
- returns: true when the link is up, else false.
prt_hdmi_is_vid_up
- description: Check if the video stream is up.
- syntax: uint8_t prt_hdmi_is_vid_up (prt_hdmi_ds_struct *hdmi);
- parameters:
- hdmipointer to HDMI peripheral
- returns: true when the video is up, else false.
prt_hdmirx_hpd
- description: Sets DPRX HPD.
- syntax: uint8_t prt_hdmirx_tp_get (prt_hdmi_ds_struct *hdmi);
- parameters:
- dppointer to HDMI peripheral
- hpdhot plug state
- PRT_HDMI_HPD_UNPLUGHPD deassert
- PRT_HDMI_HPD_PLUGHPD assert
- PRT_HDMI_HPD_IRQHPD interrupt
- returns: none
prt_hdmirx_vtp_get
- description: Gets HDMI RX video timing parameters.
- syntax: prt_hdmi_vtp_struct prt_hdmirx_vtp_get (prt_hdmi_ds_struct *hdmi);
- parameters:
- hdmipointer to HDMI peripheral
- returns: pointer to video timing parameters
prt_hdmitx_edid_rd
- description: Read EDID data from conencted HDMI sink.
- syntax: uint8_t prt_hdmitx_edid_rd (prt_hdmi_ds_struct *hdmi, uint16_t adr, uint16_t len, uint8_t *dat);
- parameters:
- hdmipointer to HDMI peripheral
- adrbase address
- lenlength
- datpointer to data buffer
- returns: true when successful, else false.
prt_hdmirx_edid_wr
- description: Write EDID data to HDMI peripheral.
- syntax: uint8_t prt_hdmirx_edid_wr (prt_hdmi_ds_struct *hdmi, uint16_t len, uint8_t *dat);
- parameters:
- hdmipointer to HDMI peripheral
- lenlength
- datpointer to data buffer
- returns: true when successful, else false.
prt_hdmitx_scdc_wr
- description: Write SCDC data.
- syntax: uint8_t prt_hdmitx_scdc_wr (prt_hdmi_ds_struct *hdmi, uint8_t adr, uint8_t dat);
- parameters:
- hdmipointer to HDMI peripheral
- adrSCDC address
- datSCDC data
- returns: true when successful, else false.
prt_hdmitx_scdc_rd
- description: Read SCDC data.
- syntax: uint8_t prt_hdmitx_scdc_rd (prt_hdmi_ds_struct *hdmi, uint8_t adr, uint8_t *dat);
- parameters:
- hdmipointer to HDMI peripheral
- adrSCDC address
- datpointer to SCDC data
- returns: true when successful, else false.
Callbacks
The callback functions are used by the driver to signal the application about an event. Functions are registered using the prt_hdmi_set_cb function. The diagram shows the HDMI states and the callbacks.
Figure 1: HDMI callbacks
hdmitx_hpd_cb
description: The function is called when a HDMITX HPD event occured.
hdmirx_cd_cb
description: The function is called when a HDMIRX cable detect event occured.
hdmi_phy_rate_cb
description: The function is called when the system controller is requesting a new line rate.
hdmi_lnk_cb
description: The function is called when the link status is updated.
hdmi_vid_cb
description: The function is called when the video status is updated.