piSmasher Configuration Libraries
piSmasher peripheral device configuration libraries

Functions

static int request_edid_block (struct tda998x_dev *dev)
 
int tda998x_read_edid (struct tda998x_dev *dev, uint8_t *data)
 
int tda998x_edid_get_block (struct tda998x_dev *dev, uint8_t *block, int nblocks, int len)
 Get EDID Block Data. More...
 
static int clear_edid_request (struct tda998x_dev *dev)
 
int edid_block_available (struct tda998x_dev *dev, bool *pSendEDIDCallback)
 

Detailed Description

Function Documentation

◆ tda998x_edid_get_block()

int tda998x_edid_get_block ( struct tda998x_dev dev,
uint8_t *  block,
int  nblocks,
int  len 
)

#include <projects/lib/tda998x.c>

Get EDID Block Data.

Parameters
devTDA998x device structure pointer
Returns
0 on success, non-zero error status otherwise
2751 {
2752  int ret;
2753  struct tda998x_edid *edid;
2754 
2755  if ((dev == NULL) || (dev->edid == NULL))
2756  return ERR_NULL_PARAM;
2757 
2758  /* Enable EDID read */
2759  ret = write_reg(dev, INT_FLAGS_2, INT_FLAGS_2_EDID_BLK_RD);
2760  if (ret < 0)
2761  return ret;
2762 
2763  edid = dev->edid;
2764 
2765  if (!edid->read_started) {
2766  /* Reset the EdidStatus in the Device Instance Structure */
2767  edid->state = EDID_NOT_READ;
2768 
2769  edid->read_started = true;
2770 
2771  /* Reset stored parameters from EDID in the Device Instance Structure */
2772  dev->sink = SINK_DVI;
2773 
2774  /* Enable the T0 interrupt for detecting the Read_EDID failure */
2775  ret = write_reg(dev, INT_FLAGS_0, INT_FLAGS_0_T0);
2776  if (ret < 0)
2777  return ret;
2778 
2779  /* Launch the read of first EDID block into Device Instance workspace */
2780  edid->req_id = 0;
2781  ret = request_edid_block(dev);
2782  if (ret < 0)
2783  return ret;
2784  } else {
2785  /* Not allowed if read edid is on going */
2786  return ERR_RESOURCE_NOT_AVAILABLE;
2787  }
2788 
2789  return 0;
2790 }
static int write_reg(struct tda998x_dev *dev, enum tda998x_hdmi_reg reg, uint8_t data)
Write Register.
Definition: tda998x.c:1283
int req_id
Definition: tda998x.h:317
Definition: tda998x.h:64
Definition: tda998x.h:313