 /**
  ******************************************************************************
  * @file    hyperterminal.h
  * @version V1.0.0
  * @date    12-January-2018
  * @brief   This file provides all the headers of hyperterminal driver functions.
  ********************************************************************************
  * @attention
  *
  * <h2><center>&copy; COPYRIGHT 2018 STMicroelectronics</center></h2>
  *
  * Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
  * You may not use this file except in compliance with the License.
  * You may obtain a copy of the License at:
  *
  *        http://www.st.com/software_license_agreement_liberty_v2
  *
  * Unless required by applicable law or agreed to in writing, software 
  * distributed under the License is distributed on an "AS IS" BASIS, 
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
  *
  ******************************************************************************
  */

/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef _HYPERTERMINAL_H
 #define _HYPERTERMINAL_H
 /* Includes ------------------------------------------------------------------*/
 #include "stdio.h"
 #include "string.h"
 #include "stm8l15x.h"
 /* Exported types ------------------------------------------------------------*/
 typedef  void (*pFunction)(void);
 /* Exported constants --------------------------------------------------------*/
 /* Constants used by Serial Command Line Mode */
 #define CMD_STRING_SIZE     128
 /* Exported macro ------------------------------------------------------------*/
 #define IS_AF(c)   ((c >= 'A') && (c <= 'F'))
 #define IS_af(c)   ((c >= 'a') && (c <= 'f'))
 #define IS_09(c)   ((c >= '0') && (c <= '9'))
 #define ISVALIDHEX(c)  IS_AF(c) || IS_af(c) || IS_09(c)
 #define ISVALIDDEC(c)  IS_09(c)
 #define CONVERTDEC(c)  (c - '0')
 #define CONVERTHEX_alpha(c)    (IS_AF(c) ? (c - 'A'+10) : (c - 'a'+10))
 #define CONVERTHEX(c)   (IS_09(c) ? (c - '0') : CONVERTHEX_alpha(c))
 /* Exported functions ------------------------------------------------------- */
 void Int2Str(char *str ,u32 intnum);
 u8 Str2Int(char *inputstr,u32 *intnum);
 u8 GetIntegerInput(u32 *num);
 u8 SerialKeyPressed(char *key);
 char GetKey(void);
 void SerialPutChar(char c);
 void SerialPutString(char *s);
 void GetInputString(char * buffP);
 void Main_Menu(void);
#endif  /* _HYPERTERMINAL_H */

/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
