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

#ifndef UART_H_
#define UART_H_

#define hTerminal    huart1
#define hTpb22       huart2
#define hubx         huart3

#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;
extern UARTQUEUE UbxQueue;
void PutDataToUartQueue(UART_HandleTypeDef *huart, uint8_t data);
void InitUartQueue(pUARTQUEUE pQueue);
void GetDataFromUartQueue(UART_HandleTypeDef *huart);


#endif /* UART_H_ */
