///*
// * Common.c
// *
// *  Created on: Dec 9, 2023
// *      Author: lubi
// */
//

//

/**************INCLUDE BLOCK**************/

#include "Common.h"

/***********INCLUDE BLOCK END*************/


/***** Data Type, Constant, and Macro Definitions *****/

/* Global variables*/




char g_u1rxbyte = 0, g_u1_rxbuffer[15], g_u1_rxedFrame = 0;
char g_stage_level = 0, g_error_code = 0, g_stage_change = 0;


/* Extern Data Declarations */


/* Static Data Declarations */



/***** Data Type, Constant, and Macro Definitions END *****/



/***** Public Function Bodies *****/
/**
 * @brief Convert a hexadecimal digit to its ASCII representation.
 *
 * This function takes a hexadecimal digit as input and converts it to its corresponding ASCII representation.
 *
 * @param input The hexadecimal digit to be converted.
 * @return The ASCII representation of the input digit.
 *
 * @note The input digit should be in the range 0-15 (inclusive).
 *
 * @warning If the input digit is outside the range 0-15, the behavior is undefined.
 */
char Hex_ascii(char input)
{
	if(input <  0x0A && input >= 0 )
	{
		return (input + '0');
	}
	else if(input >= 0x0A && input <= 0x0F)
	{
		return ((input + 'A') - 10); //for eg input is 10 than 10+97=107-10 = 'a'
	}

	return 0;
}

/***** Public Function Bodies END *****/
