/*
 * uart.h
 *
 *  Created on: 2019. 5. 27.
 *      Author: parkyj
 */

#ifndef UART_H_
#define UART_H_

#include "main.h"

#define hTerminal    huart1
#define hWifi        huart2

#define QUEUE_BUFFER_LENGTH 1024

typedef struct
{
    int head, tail, data;
    uint8_t Buffer[QUEUE_BUFFER_LENGTH];
}UARTQUEUE, *pUARTQUEUE;

extern UART_HandleTypeDef huart1;
extern UART_HandleTypeDef huart2;
extern UART_HandleTypeDef huart3;


extern UARTQUEUE TerminalQueue;
void PutDataToUartQueue(UART_HandleTypeDef *huart, uint8_t data);
void InitUartQueue(pUARTQUEUE pQueue);
void GetDataFromUartQueue(UART_HandleTypeDef *huart);
bool Get_UartRcv(void);
void Set_UartRcv(bool);

#endif /* UART_H_ */
