| 1 | // ANALOGIX Company |
|---|
| 2 | // HDMI_TX Demo Firmware on SST |
|---|
| 3 | |
|---|
| 4 | #define USE_HDMI_RX 0 |
|---|
| 5 | |
|---|
| 6 | #include "HDMI_TX_DRV.h" |
|---|
| 7 | |
|---|
| 8 | //user interface define begins |
|---|
| 9 | |
|---|
| 10 | //select video hardware interface |
|---|
| 11 | #define HDMI_TX_VID_HW_INTERFACE 0x00//0x00:RGB and YcbCr 4:4:4 Formats with Separate Syncs (24-bpp mode) |
|---|
| 12 | //0x01:YCbCr 4:2:2 Formats with Separate Syncs(16-bbp) |
|---|
| 13 | //0x02:YCbCr 4:2:2 Formats with Embedded Syncs(No HS/VS/DE) |
|---|
| 14 | //0x03:YC Mux 4:2:2 Formats with Separate Sync Mode1(bit15:8 and bit 3:0 are used) |
|---|
| 15 | //0x04:YC Mux 4:2:2 Formats with Separate Sync Mode2(bit11:0 are used) |
|---|
| 16 | //0x05:YC Mux 4:2:2 Formats with Embedded Sync Mode1(bit15:8 and bit 3:0 are used) |
|---|
| 17 | //0x06:YC Mux 4:2:2 Formats with Embedded Sync Mode2(bit11:0 are used) |
|---|
| 18 | //0x07:RGB and YcbCr 4:4:4 DDR Formats with Separate Syncs |
|---|
| 19 | //0x08:RGB and YcbCr 4:4:4 DDR Formats with Embedded Syncs |
|---|
| 20 | //0x09:RGB and YcbCr 4:4:4 Formats with Separate Syncs but no DE |
|---|
| 21 | //0x0a:YCbCr 4:2:2 Formats with Separate Syncs but no DE |
|---|
| 22 | //select input color space |
|---|
| 23 | #define HDMI_TX_INPUT_COLORSPACE 0x00//0x00: input color space is RGB |
|---|
| 24 | //0x01: input color space is YCbCr422 |
|---|
| 25 | //0x02: input color space is YCbCr444 |
|---|
| 26 | //select input pixel clock edge for DDR mode |
|---|
| 27 | #define HDMI_TX_IDCK_EDGE_DDR 0x01 //0x00:use rising edge to latch even numbered pixel data |
|---|
| 28 | //0x01:use falling edge to latch even numbered pixel data |
|---|
| 29 | |
|---|
| 30 | //select audio hardware interface |
|---|
| 31 | #define HDMI_TX_AUD_HW_INTERFACE 0x02//0x01:audio input comes from I2S |
|---|
| 32 | //0x02:audio input comes from SPDIF |
|---|
| 33 | //0x04:audio input comes from one bit audio |
|---|
| 34 | //select MCLK and Fs relationship if audio HW interface is I2S |
|---|
| 35 | #define HDMI_TX_MCLK_Fs_RELATION 0x01//0x00:MCLK = 128 * Fs |
|---|
| 36 | //0x01:MCLK = 256 * Fs |
|---|
| 37 | //0x02:MCLK = 384 * Fs |
|---|
| 38 | //0x03:MCLK = 512 * Fs |
|---|
| 39 | //select I2S channel numbers if audio HW interface is I2S |
|---|
| 40 | #define HDMI_TX_I2S_CH0_ENABLE 0x01 //0x01:enable channel 0 input; 0x00: disable |
|---|
| 41 | #define HDMI_TX_I2S_CH1_ENABLE 0x00 //0x01:enable channel 0 input; 0x00: disable |
|---|
| 42 | #define HDMI_TX_I2S_CH2_ENABLE 0x00 //0x01:enable channel 0 input; 0x00: disable |
|---|
| 43 | #define HDMI_TX_I2S_CH3_ENABLE 0x00 //0x01:enable channel 0 input; 0x00: disable |
|---|
| 44 | //select I2S word length if audio HW interface is I2S |
|---|
| 45 | #define HDMI_TX_I2S_WORD_LENGTH 0x0b |
|---|
| 46 | //0x02 = 16bits; 0x04 = 18 bits; 0x08 = 19 bits; 0x0a = 20 bits(maximal word length is 20bits); 0x0c = 17 bits; |
|---|
| 47 | // 0x03 = 20bits(maximal word length is 24bits); 0x05 = 22 bits; 0x09 = 23 bits; 0x0b = 24 bits; 0x0d = 21 bits; |
|---|
| 48 | //select audio Fs |
|---|
| 49 | #define HDMI_TX_AUD_Fs 0x02 // 0x00 = 44.1 KHz |
|---|
| 50 | // 0x02 = 48 KHz |
|---|
| 51 | // 0x03 = 32 KHz |
|---|
| 52 | //select I2S format if audio HW interface is I2S |
|---|
| 53 | #define HDMI_TX_I2S_SHIFT_CTRL 0x00//0x00: fist bit shift(philips spec) |
|---|
| 54 | //0x01:no shift |
|---|
| 55 | #define HDMI_TX_I2S_DIR_CTRL 0x00//0x00:SD data MSB first |
|---|
| 56 | //0x01:LSB first |
|---|
| 57 | #define HDMI_TX_I2S_WS_POL 0x00//0x00:left polarity when word select is low |
|---|
| 58 | //0x01:left polarity when word select is high |
|---|
| 59 | #define HDMI_TX_I2S_JUST_CTRL 0x00//0x00:data is left justified |
|---|
| 60 | //0x01:data is right justified |
|---|
| 61 | |
|---|
| 62 | //user interface define ends |
|---|
| 63 | |
|---|
| 64 | extern BYTE hdmi_tx_new_HW_interface_parameter; |
|---|
| 65 | |
|---|
| 66 | void HDMI_TX_API_Video_Config(BYTE video_id,BYTE input_pixel_rpt_time); |
|---|
| 67 | void HDMI_TX_API_AUD_CHStatus_Config(BYTE MODE,BYTE PCM_MODE,BYTE SW_CPRGT,BYTE NON_PCM, |
|---|
| 68 | BYTE PROF_APP,BYTE CAT_CODE,BYTE CH_NUM,BYTE SOURCE_NUM,BYTE CLK_ACCUR,BYTE Fs); |
|---|
| 69 | BIT HDMI_TX_API_DetectDevice(void); |
|---|
| 70 | void HDMI_TX_API_HoldVideoConfig(BIT hold_video); |
|---|
| 71 | void HDMI_TX_API_HoldAudioConfig(BIT hold_audio); |
|---|
| 72 | void HDMI_TX_API_ShutDown(BIT bShutDown_HDMI_TX); |
|---|
| 73 | void HDMI_TX_API_HDCP_ONorOFF(BIT HDCP_ONorOFF); |
|---|
| 74 | void HDMI_TX_API_Packets_Config(BYTE pkt_sel); |
|---|
| 75 | void HDMI_TX_API_AVI_Config(BYTE pb1,BYTE pb2,BYTE pb3,BYTE pb4,BYTE pb5, |
|---|
| 76 | BYTE pb6,BYTE pb7,BYTE pb8,BYTE pb9,BYTE pb10,BYTE pb11,BYTE pb12,BYTE pb13); |
|---|
| 77 | void HDMI_TX_API_AUD_INFO_Config(BYTE pb1,BYTE pb2,BYTE pb3,BYTE pb4,BYTE pb5, |
|---|
| 78 | BYTE pb6,BYTE pb7,BYTE pb8,BYTE pb9,BYTE pb10); |
|---|
| 79 | void HDMI_TX_API_Audio_Config(BYTE aud_fs); |
|---|
| 80 | void HDMI_TX_API_SetGamutStatus(DS_BOOL on); |
|---|
| 81 | DS_BOOL HDMI_TX_API_GetGamutStatus(void); |
|---|
| 82 | void HDMI_TX_Config_Manual_Video_FormatEx(const struct Video_Timing *pVT); |
|---|