/*
 * key_codes.c
 *
 *  Created on: Mar 4, 2019
 *      Author: nxf47030
 */
#include"key_codes.h"


uint8_t cNumericToKey(char c)
{
	uint8_t retval = 0;
	switch(c)
   	{
    	case '1':
    		retval = KEY_1;
    		break;
    	case '2':
    		retval = KEY_2;
    		break;
    	case '3':
	   		retval = KEY_3;
       		break;
    	case '4':
       		retval = KEY_4;
       		break;
    	case '5':
       		retval = KEY_5;
      		break;
    	case '6':
       		retval = KEY_6;
       		break;
    	case '7':
       		retval = KEY_7;
       		break;
    	case '8':
       		retval = KEY_8;
       		break;
    	case '9':
       		retval = KEY_9;
       		break;
    	case '0':
       		retval = KEY_0;
       		break;
    	case '-':
       		retval = KEY_MINUS;
        	break;
    	case '.':
        	retval = KEY_DOT;
   	    	break;
    	case '\n':
    	    retval = KEY_ENTER;
    	   	break;
    	case '\t':
			retval = KEY_TAB;
			break;
    	case 150:
    		retval = KEY_LEFT;
    		break;
    	default:
    		retval = KEY_F;
    		break;
   	}
	return retval;
}
