#ifndef _COM_USART_HAL_H_
	#define _COM_USART_HAL_H_
	#define tamRx 255
	#define tamTx 255
	#define baudioCom 115200
	//115200  57600
	
	#define rs485_PinTx GPIO_PIN_8
	#define rs485_Port 	GPIOA
	#define rs485_ON()		HAL_GPIO_WritePin(rs485_Port,rs485_PinTx,GPIO_PIN_SET)
	#define rs485_OFF()		HAL_GPIO_WritePin(rs485_Port,rs485_PinTx,GPIO_PIN_RESET)
	
	#include "stm32f1xx_hal.h"
	#include "cmsis_os.h"
	#include "rampabus_hal.h"
	
	extern UART_HandleTypeDef huart1;
	extern DMA_HandleTypeDef hdma_usart1_rx;
	extern DMA_HandleTypeDef hdma_usart1_tx;
	extern __IO ITStatus UartReady;
	
	extern uint8_t CAPA1;
	//extern uint8_t *DataRx;
	//extern uint8_t *DataTx;
	
	extern volatile uint8_t DataRx[];
	extern uint8_t DataTx[];
	
	extern osSemaphoreId Sem2_Rx;
	//extern osPoolId PoolTx,PoolRx;
	
	//extern Cap_Data cap_data;
	
	void UART_Init(void);
	void Escuchar_DMA_RX(uint16_t rx_tam);
	void Enviar_DMA_TX(uint8_t *buffer,uint16_t tx_tam);
	
	
	
	void 	UART_DMAReceiveCplt(DMA_HandleTypeDef *hdma);
#endif	


