no-OS
cf_hdmi.h
Go to the documentation of this file.
1 /***************************************************************************/
35 #ifndef CF_HDMI_H_
36 #define CF_HDMI_H_
37 
38 /******************************************************************************/
39 /***************************** Include Files **********************************/
40 /******************************************************************************/
41 #include "xparameters.h"
42 #include "app_config.h"
43 #include "clk_axi_clkgen.h"
44 
45 /******************************************************************************/
46 /************************** Macros Definitions ********************************/
47 /******************************************************************************/
48 #ifdef XPAR_AXI_HDMI_TX_0_BASEADDR
49 #define CFV_BASEADDR XPAR_AXI_HDMI_TX_0_BASEADDR
50 #else
51 #define CFV_BASEADDR XPAR_AXI_HDMI_CORE_BASEADDR
52 #endif
53 #ifdef XPAR_AXI_SPDIF_TX_0_BASEADDR
54 #define CFA_BASEADDR XPAR_AXI_SPDIF_TX_0_BASEADDR
55 #else
56 #define CFA_BASEADDR XPAR_AXI_SPDIF_TX_CORE_BASEADDR
57 #endif
58 
59 #if defined(PLATFORM_KC705) || defined(PLATFORM_AC701) || \
60  defined(PLATFORM_VC707)
61 #ifdef XPAR_DDR3_SDRAM_S_AXI_BASEADDR
62 #define DDR_BASEADDR XPAR_DDR3_SDRAM_S_AXI_BASEADDR
63 #else
64 #define DDR_BASEADDR XPAR_AXI_DDR_CNTRL_BASEADDR
65 #endif
66 #elif defined(PLATFORM_ZC702) || defined(PLATFORM_ZC706) || \
67  defined(PLATFORM_ZED)
68 #define DDR_BASEADDR XPAR_DDR_MEM_BASEADDR
69 #endif
70 
71 #if defined(PLATFORM_KC705) || defined(PLATFORM_AC701) || \
72  defined(PLATFORM_VC707)
73 #ifdef XPAR_RS232_UART_1_BASEADDR
74 #define UART_BASEADDR XPAR_RS232_UART_1_BASEADDR
75 #else
76 #define UART_BASEADDR XPAR_AXI_UART_BASEADDR
77 #endif
78 #elif defined(PLATFORM_ZC702) || defined(PLATFORM_ZC706) || \
79  defined(PLATFORM_ZED)
80 #define UART_BASEADDR XPS_UART1_BASEADDR
81 #endif
82 
83 #ifdef XPAR_AXI_VDMA_0_BASEADDR
84 #define VDMA_BASEADDR XPAR_AXI_VDMA_0_BASEADDR
85 #else
86 #define VDMA_BASEADDR XPAR_AXI_HDMI_DMA_BASEADDR
87 #endif
88 
89 #ifdef XPAR_AXI_DMA_0_BASEADDR
90 #define ADMA_BASEADDR XPAR_AXI_DMA_0_BASEADDR
91 #else
92 #if defined(PLATFORM_AC701) || defined(PLATFORM_VC707)
93 #define ADMA_BASEADDR XPAR_AXIDMA_1_BASEADDR
94 #elif defined(PLATFORM_KC705)
95 #define ADMA_BASEADDR XPAR_AXIDMA_0_BASEADDR
96 #endif
97 #endif
98 #if defined(PLATFORM_ZC702) || defined(PLATFORM_ZC706) || \
99  defined(PLATFORM_ZED)
100 #define ADMA_DEVICE_ID XPAR_XDMAPS_1_DEVICE_ID
101 #endif
102 
103 #if defined(PLATFORM_KC705) || defined(PLATFORM_AC701) || \
104  defined(PLATFORM_VC707)
105 #define IIC_BASEADDR XPAR_AXI_IIC_0_BASEADDR
106 #elif defined(PLATFORM_ZC702) || defined(PLATFORM_ZC706) || \
107  defined(PLATFORM_ZED)
108 #define IIC_BASEADDR XPS_I2C0_BASEADDR
109 #endif
110 
111 #define VIDEO_BASEADDR DDR_BASEADDR + 0x2000000
112 #define AUDIO_BASEADDR DDR_BASEADDR + 0x1000000
113 #define A_SAMPLE_FREQ 48000
114 #define A_FREQ 1400
115 #define AUDIO_LENGTH (A_SAMPLE_FREQ/A_FREQ)
116 
117 #define AXI_HDMI_REG_RESET 0x040
118 #define AXI_HDMI_REG_CTRL 0x044
119 #define AXI_HDMI_REG_SOURCE_SEL 0x048
120 #define AXI_HDMI_REG_COLORPATTERN 0x04c
121 #define AXI_HDMI_REG_STATUS 0x05c
122 #define AXI_HDMI_REG_VDMA_STATUS 0x060
123 #define AXI_HDMI_REG_TPM_STATUS 0x064
124 #define AXI_HDMI_REG_HTIMING1 0x400
125 #define AXI_HDMI_REG_HTIMING2 0x404
126 #define AXI_HDMI_REG_HTIMING3 0x408
127 #define AXI_HDMI_REG_VTIMING1 0x440
128 #define AXI_HDMI_REG_VTIMING2 0x444
129 #define AXI_HDMI_REG_VTIMING3 0x448
130 
131 #define AXI_VDMA_REG_DMA_CTRL 0x00
132 #define AXI_VDMA_REG_V_SIZE 0x50
133 #define AXI_VDMA_REG_H_SIZE 0x54
134 #define AXI_VDMA_REG_FRMDLY_STRIDE 0x58
135 #define AXI_VDMA_REG_START_1 0x5C
136 #define AXI_VDMA_REG_START_2 0x60
137 #define AXI_VDMA_REG_START_3 0x64
138 
139 #define AXI_CLKGEN_V2_REG_RESET 0x40
140 #define AXI_CLKGEN_V2_REG_DRP_CNTRL 0x70
141 #define AXI_CLKGEN_V2_REG_DRP_STATUS 0x74
142 
143 #define AXI_CLKGEN_V2_RESET_MMCM_ENABLE (1 << 1)
144 #define AXI_CLKGEN_V2_RESET_ENABLE (1 << 0)
145 
146 #define AXI_CLKGEN_V2_DRP_CNTRL_SEL (1 << 29)
147 #define AXI_CLKGEN_V2_DRP_CNTRL_READ (1 << 28)
148 #define AXI_CLKGEN_V2_DRP_STATUS_BUSY (1 << 16)
149 
150 #define MMCM_REG_CLKOUT0_1 0x08
151 #define MMCM_REG_CLKOUT0_2 0x09
152 #define MMCM_REG_CLK_FB1 0x14
153 #define MMCM_REG_CLK_FB2 0x15
154 #define MMCM_REG_CLK_DIV 0x16
155 #define MMCM_REG_LOCK1 0x18
156 #define MMCM_REG_LOCK2 0x19
157 #define MMCM_REG_LOCK3 0x1a
158 #define MMCM_REG_FILTER1 0x4e
159 #define MMCM_REG_FILTER2 0x4f
160 
169 };
170 
171 /******************************************************************************/
172 /************************ Functions Declarations ******************************/
173 /******************************************************************************/
174 void InitHdmiVideoPcore(unsigned short horizontalActiveTime,
175  unsigned short horizontalBlankingTime,
176  unsigned short horizontalSyncOffset,
177  unsigned short horizontalSyncPulseWidth,
178  unsigned short verticalActiveTime,
179  unsigned short verticalBlankingTime,
180  unsigned short verticalSyncOffset,
181  unsigned short verticalSyncPulseWidth);
182 void SetVideoResolution(struct axi_clkgen *clkgen, unsigned char resolution);
183 void InitHdmiAudioPcore(void);
184 void AudioClick(void);
185 
186 #endif /* CF_HDMI_H_ */
AXI_DMAC_CTRL_ENABLE
#define AXI_DMAC_CTRL_ENABLE
Definition: axi_dmac.h:58
IMG_LENGTH
#define IMG_LENGTH
Definition: cf_hdmi_demo.h:35
no_os_gpio_init_param
Structure holding the parameters for GPIO initialization.
Definition: no_os_gpio.h:79
AXI_DMAC_REG_X_LENGTH
#define AXI_DMAC_REG_X_LENGTH
Definition: axi_dmac.h:69
V_SYNC_OFFSET
@ V_SYNC_OFFSET
Definition: cf_hdmi.c:67
AXI_HDMI_REG_SOURCE_SEL
#define AXI_HDMI_REG_SOURCE_SEL
Definition: cf_hdmi.h:119
cf_hdmi.h
InitHdmiVideoPcore
void InitHdmiVideoPcore(unsigned short horizontalActiveTime, unsigned short horizontalBlankingTime, unsigned short horizontalSyncOffset, unsigned short horizontalSyncPulseWidth, unsigned short verticalActiveTime, unsigned short verticalBlankingTime, unsigned short verticalSyncOffset, unsigned short verticalSyncPulseWidth)
InitHdmiVideoPcore.
Definition: cf_hdmi.c:161
AXI_HDMI_REG_HTIMING2
#define AXI_HDMI_REG_HTIMING2
Definition: cf_hdmi.h:125
AXI_DMAC_REG_SRC_ADDRESS
#define AXI_DMAC_REG_SRC_ADDRESS
Definition: axi_dmac.h:68
clk_axi_clkgen.h
Driver for the Analog Devices AXI CLKGEN.
no_os_gpio_get_value
int32_t no_os_gpio_get_value(struct no_os_gpio_desc *desc, uint8_t *value)
Get the value of the specified GPIO.
Definition: no_os_gpio.c:221
DDRVideoWr
void DDRVideoWr(unsigned short horizontalActiveTime, unsigned short verticalActiveTime)
DDRVideoWr.
Definition: cf_hdmi.c:84
CFV_BASEADDR
#define CFV_BASEADDR
Definition: cf_hdmi.h:51
toggle
void toggle(struct no_os_gpio_desc *led)
Definition: blinky_example.c:26
AXI_VDMA_REG_START_2
#define AXI_VDMA_REG_START_2
Definition: cf_hdmi.h:136
no_os_delay.h
Header file of Delay functions.
AXI_HDMI_REG_VTIMING2
#define AXI_HDMI_REG_VTIMING2
Definition: cf_hdmi.h:128
axi_clkgen_set_rate
int32_t axi_clkgen_set_rate(struct axi_clkgen *clkgen, uint32_t rate)
axi_clkgen_set_rate
Definition: clk_axi_clkgen.c:414
RESOLUTION_1360x768
@ RESOLUTION_1360x768
Definition: cf_hdmi.h:166
RESOLUTION_640x480
@ RESOLUTION_640x480
Definition: cf_hdmi.h:162
NO_OS_GPIO_HIGH
@ NO_OS_GPIO_HIGH
Definition: no_os_gpio.h:117
no_os_gpio_init_param::number
int32_t number
Definition: no_os_gpio.h:83
axi_clkgen
Definition: clk_axi_clkgen.h:44
V_SYNC_WIDTH_PULSE
@ V_SYNC_WIDTH_PULSE
Definition: cf_hdmi.c:68
videoResolution
videoResolution
Definition: cf_hdmi.h:161
RESOLUTION_800x600
@ RESOLUTION_800x600
Definition: cf_hdmi.h:163
AXI_DMAC_REG_SRC_STRIDE
#define AXI_DMAC_REG_SRC_STRIDE
Definition: axi_dmac.h:72
main
int main(int argc, char *argv[])
Definition: blinky_example.c:34
InitHdmiVideoPcore
void InitHdmiVideoPcore(unsigned short horizontalActiveTime, unsigned short horizontalBlankingTime, unsigned short horizontalSyncOffset, unsigned short horizontalSyncPulseWidth, unsigned short verticalActiveTime, unsigned short verticalBlankingTime, unsigned short verticalSyncOffset, unsigned short verticalSyncPulseWidth)
InitHdmiVideoPcore.
Definition: cf_hdmi.c:161
H_BLANKING_TIME
@ H_BLANKING_TIME
Definition: cf_hdmi.c:62
NO_OS_GPIO_LOW
@ NO_OS_GPIO_LOW
Definition: no_os_gpio.h:115
AXI_VDMA_REG_DMA_CTRL
#define AXI_VDMA_REG_DMA_CTRL
Definition: cf_hdmi.h:131
no_os_mdelay
void no_os_mdelay(uint32_t msecs)
Wait until msecs milliseconds passed.
Definition: aducm3029_delay.c:126
PIXEL_CLOCK
@ PIXEL_CLOCK
Definition: cf_hdmi.c:60
AXI_HDMI_REG_HTIMING3
#define AXI_HDMI_REG_HTIMING3
Definition: cf_hdmi.h:126
DDRAudioWr
void DDRAudioWr(void)
DDRAudioWr.
Definition: cf_hdmi.c:122
u32
unsigned long u32
Definition: wrapper.h:155
V_ACTIVE_TIME
@ V_ACTIVE_TIME
Definition: cf_hdmi.c:65
AudioClick
void AudioClick(void)
AudioClick.
Definition: cf_hdmi.c:295
detailedTimingElement
detailedTimingElement
Definition: cf_hdmi.c:59
AXI_DMAC_REG_TRANSFER_SUBMIT
#define AXI_DMAC_REG_TRANSFER_SUBMIT
Definition: axi_dmac.h:63
AUDIO_BASEADDR
#define AUDIO_BASEADDR
Definition: cf_hdmi.h:112
AudioClick
void AudioClick(void)
AudioClick.
Definition: cf_hdmi.c:295
SetVideoResolution
void SetVideoResolution(struct axi_clkgen *clkgen, unsigned char resolution)
SetVideoResolution.
Definition: cf_hdmi.c:257
axi_dmac.h
Driver for the Analog Devices AXI-DMAC core.
RESOLUTION_1280x720
@ RESOLUTION_1280x720
Definition: cf_hdmi.h:165
initPower
int initPower()
Definition: blinky_example.c:12
AXI_HDMI_REG_VTIMING1
#define AXI_HDMI_REG_VTIMING1
Definition: cf_hdmi.h:127
no_os_gpio_desc
Structure holding the GPIO descriptor.
Definition: no_os_gpio.h:96
RESOLUTION_1600x900
@ RESOLUTION_1600x900
Definition: cf_hdmi.h:167
V_BLANKING_TIME
@ V_BLANKING_TIME
Definition: cf_hdmi.c:66
app_config.h
Config file of ADV7511 no-OS project.
AXI_VDMA_REG_V_SIZE
#define AXI_VDMA_REG_V_SIZE
Definition: cf_hdmi.h:132
VIDEO_BASEADDR
#define VIDEO_BASEADDR
Definition: cf_hdmi.h:111
no_os_gpio_get
int32_t no_os_gpio_get(struct no_os_gpio_desc **desc, const struct no_os_gpio_init_param *param)
Obtain the GPIO decriptor.
Definition: no_os_gpio.c:49
H_SYNC_OFFSET
@ H_SYNC_OFFSET
Definition: cf_hdmi.c:63
AXI_HDMI_REG_HTIMING1
#define AXI_HDMI_REG_HTIMING1
Definition: cf_hdmi.h:124
AXI_VDMA_REG_FRMDLY_STRIDE
#define AXI_VDMA_REG_FRMDLY_STRIDE
Definition: cf_hdmi.h:134
AXI_DMAC_REG_FLAGS
#define AXI_DMAC_REG_FLAGS
Definition: axi_dmac.h:66
DMA_CYCLIC
@ DMA_CYCLIC
Definition: axi_dmac.h:91
aducm_gpio_ops
const struct no_os_gpio_platform_ops aducm_gpio_ops
ADuCM3029 platform specific GPIO platform ops structure.
Definition: aducm3029_gpio.c:289
AXI_HDMI_REG_RESET
#define AXI_HDMI_REG_RESET
Definition: cf_hdmi.h:117
NULL
#define NULL
Definition: wrapper.h:64
no_os_gpio_set_value
int32_t no_os_gpio_set_value(struct no_os_gpio_desc *desc, uint8_t value)
Set the value of the specified GPIO.
Definition: no_os_gpio.c:197
InitHdmiAudioPcore
void InitHdmiAudioPcore(void)
InitHdmiAudioPcore.
Definition: cf_hdmi.c:273
AUDIO_LENGTH
#define AUDIO_LENGTH
Definition: cf_hdmi.h:115
AXI_VDMA_REG_START_1
#define AXI_VDMA_REG_START_1
Definition: cf_hdmi.h:135
AXI_DMAC_REG_CTRL
#define AXI_DMAC_REG_CTRL
Definition: axi_dmac.h:57
no_os_gpio.h
Header file of GPIO Interface.
AXI_VDMA_REG_H_SIZE
#define AXI_VDMA_REG_H_SIZE
Definition: cf_hdmi.h:133
DMA_LAST
@ DMA_LAST
Definition: axi_dmac.h:92
VDMA_BASEADDR
#define VDMA_BASEADDR
Definition: cf_hdmi.h:86
RESOLUTION_1920x1080
@ RESOLUTION_1920x1080
Definition: cf_hdmi.h:168
SetVideoResolution
void SetVideoResolution(struct axi_clkgen *clkgen, unsigned char resolution)
SetVideoResolution.
Definition: cf_hdmi.c:257
AXI_HDMI_REG_VTIMING3
#define AXI_HDMI_REG_VTIMING3
Definition: cf_hdmi.h:129
aducm3029_gpio.h
InitHdmiAudioPcore
void InitHdmiAudioPcore(void)
InitHdmiAudioPcore.
Definition: cf_hdmi.c:273
no_os_gpio_direction_output
int32_t no_os_gpio_direction_output(struct no_os_gpio_desc *desc, uint8_t value)
Enable the output direction of the specified GPIO.
Definition: no_os_gpio.c:147
RESOLUTION_1024x768
@ RESOLUTION_1024x768
Definition: cf_hdmi.h:164
AXI_DMAC_REG_Y_LENGTH
#define AXI_DMAC_REG_Y_LENGTH
Definition: axi_dmac.h:70
AXI_VDMA_REG_START_3
#define AXI_VDMA_REG_START_3
Definition: cf_hdmi.h:137
H_SYNC_WIDTH_PULSE
@ H_SYNC_WIDTH_PULSE
Definition: cf_hdmi.c:64
H_ACTIVE_TIME
@ H_ACTIVE_TIME
Definition: cf_hdmi.c:61
CFA_BASEADDR
#define CFA_BASEADDR
Definition: cf_hdmi.h:56
cf_hdmi_demo.h