XilinxProcessorIPLib/drivers/dp14txss/examples/src/zcu_pt_dp14_hdcp/menus.c
u32 xil_gethex(u8 num_chars){
	u32 data;
	u32 i;
	u8 term_key;
	data = 0;

	for(i=0;i<num_chars;i++){
		term_key = xil_getc(0);
		xil_printf("%c",term_key);
		if(term_key >= 'a') {
			term_key = term_key - 'a' + 10;
		} else if(term_key >= 'A') {
				term_key = term_key - 'A' + 10;
		} else {
			term_key = term_key - '0';
		}
		data = (data << 4) + term_key;
	}
	return data;
}
/*****************************************************************************/
/**
*
* This function to convert integer to hex
*
* @param	timeout_ms
*
* @return
*		- received charactor
*
* @note		None.
*
******************************************************************************/
This function to convert integer to hex
This function to convert integer to hex
u32 xil_gethex(u8 num_chars){
	u32 data;
	u32 i;
	u8 term_key;
	data = 0;
	for(i=0;i<num_chars;i++){
		term_key = xil_getc(0);
		xil_printf("%c",term_key);
		if(term_key >= 'a') {
			term_key = term_key - 'a' + 10;
		} else if(term_key >= 'A') {
				term_key = term_key - 'A' + 10;
		} else {
			term_key = term_key - '0';
		}
		data = (data << 4) + term_key;
	}
	return data;
}
u32 xil_gethex ( u8 num_chars ) { u32 data ; u32 i ; u8 term_key ; data = 0 ; for ( i = 0 ; i < num_chars ; i ++ ) { term_key = xil_getc ( 0 ) ; xil_printf ( " " , term_key ) ; if ( term_key >= ' ' ) { term_key = term_key - ' ' + 10 ; } else if ( term_key >= ' ' ) { term_key = term_key - ' ' + 10 ; } else { term_key = term_key - ' ' ; } data = ( data << 4 ) + term_key ; } return data ; }
This function to convert integer to hex
This function to convert integer to hex