XilinxProcessorIPLib/drivers/v_hdmitxss1/examples/xhdmi_example/xhdmi_hdcp_keys.c
static u8 EnterPassword(u8 *Password)
{
	u8 Data;
	u8 i;
	u8 *PasswordPtr;

	// Assign pointer
	PasswordPtr = Password;

	// Clear password
	memset(PasswordPtr, 0x00, 32);

	xil_printf("Enter Password ->");

	i = 0;
	while (1) {
		/* Check if the UART has any data */
#if defined (XPAR_XUARTPSV_NUM_INSTANCES)
		if (XUartPsv_IsReceiveData(XHDCP_UART_BASEADDR)) {
			/* Read data from uart */
			Data = XUartPsv_RecvByte(XHDCP_UART_BASEADDR);

			/* Send response to user */
			XUartPsv_SendByte(XHDCP_UART_BASEADDR, '.');
#elif defined (XPAR_XUARTLITE_NUM_INSTANCES)
		if (!XUartLite_IsReceiveEmpty(XHDCP_UART_BASEADDR)) {
			/* Read data from uart */
			Data = XUartLite_RecvByte(XHDCP_UART_BASEADDR);

			/* Send response to user */
			XUartLite_SendByte(XHDCP_UART_BASEADDR, '.');
#else
			if (XUartPs_IsReceiveData(XHDCP_UART_BASEADDR)) {
				/* Read data from uart */
				Data = XUartPs_RecvByte(XHDCP_UART_BASEADDR);

				/* Send response to user */
				XUartPs_SendByte(XHDCP_UART_BASEADDR, '.');
#endif

			/* Execute */
			if ((Data == '\n') || (Data == '\r')) {
				return TRUE;
			}

			/* Store Data */
			else {
				if (i >= 32)
					return TRUE;
				else {
					*(PasswordPtr + i) = Data;
					i++;
				}
			}
		}
	}
}
/*****************************************************************************/
/**
 *
 * This function gets the password from the uart
 *
 *
 * @return
 *  - XST_SUCCESS if action was successful
 *
 ******************************************************************************/
This function gets the password from the uart
@return
- XST_SUCCESS if action was successful
This function gets the password from the uart @return - XST_SUCCESS if action was successful
static u8 EnterPassword(u8 *Password)
{
	u8 Data;
	u8 i;
	u8 *PasswordPtr;
	PasswordPtr = Password;
	memset(PasswordPtr, 0x00, 32);
	xil_printf("Enter Password ->");
	i = 0;
	while (1) {
#if defined (XPAR_XUARTPSV_NUM_INSTANCES)
		if (XUartPsv_IsReceiveData(XHDCP_UART_BASEADDR)) {
			Data = XUartPsv_RecvByte(XHDCP_UART_BASEADDR);
			XUartPsv_SendByte(XHDCP_UART_BASEADDR, '.');
#elif defined (XPAR_XUARTLITE_NUM_INSTANCES)
		if (!XUartLite_IsReceiveEmpty(XHDCP_UART_BASEADDR)) {
			Data = XUartLite_RecvByte(XHDCP_UART_BASEADDR);
			XUartLite_SendByte(XHDCP_UART_BASEADDR, '.');
#else
			if (XUartPs_IsReceiveData(XHDCP_UART_BASEADDR)) {
				Data = XUartPs_RecvByte(XHDCP_UART_BASEADDR);
				XUartPs_SendByte(XHDCP_UART_BASEADDR, '.');
#endif
			if ((Data == '\n') || (Data == '\r')) {
				return TRUE;
			}
			else {
				if (i >= 32)
					return TRUE;
				else {
					*(PasswordPtr + i) = Data;
					i++;
				}
			}
		}
	}
}
static u8 EnterPassword ( u8 * Password ) { u8 Data ; u8 i ; u8 * PasswordPtr ; PasswordPtr = Password ; memset ( PasswordPtr , 0x00 , 32 ) ; xil_printf ( " " ) ; i = 0 ; while ( 1 ) { #if defined ( XPAR_XUARTPSV_NUM_INSTANCES ) if ( XUartPsv_IsReceiveData ( XHDCP_UART_BASEADDR ) ) { Data = XUartPsv_RecvByte ( XHDCP_UART_BASEADDR ) ; XUartPsv_SendByte ( XHDCP_UART_BASEADDR , ' ' ) ; #elif  defined (XPAR_XUARTLITE_NUM_INSTANCES) if ( ! XUartLite_IsReceiveEmpty ( XHDCP_UART_BASEADDR ) ) { Data = XUartLite_RecvByte ( XHDCP_UART_BASEADDR ) ; XUartLite_SendByte ( XHDCP_UART_BASEADDR , ' ' ) ; #else 
			if (XUartPs_IsReceiveData(XHDCP_UART_BASEADDR)) { Data = XUartPs_RecvByte ( XHDCP_UART_BASEADDR ) ; XUartPs_SendByte ( XHDCP_UART_BASEADDR , ' ' ) ; #endif 
			if ((Data == '\n') || (Data == '\r')) { return TRUE ; } else { if ( i >= 32 ) return TRUE ; else { * ( PasswordPtr + i ) = Data ; i ++ ; } } } } }
This function gets the password from the uart
 @return
  - XST_SUCCESS if action was successful
This function gets the password from the uart @return - XST_SUCCESS if action was successful
// Assign pointer // Clear password /* Check if the UART has any data */ /* Read data from uart */ /* Send response to user */ /* Read data from uart */ /* Send response to user */ /* Read data from uart */ /* Send response to user */ 

			/* Execute */ /* Store Data */