/* USER CODE BEGIN Header */
/**
  ******************************************************************************
  * @file    usart.h
  * @brief   This file contains all the function prototypes for
  *          the usart.c file
  ******************************************************************************
  * @attention
  *
  * Copyright (c) 2023 STMicroelectronics.
  * All rights reserved.
  *
  * This software is licensed under terms that can be found in the LICENSE file
  * in the root directory of this software component.
  * If no LICENSE file comes with this software, it is provided AS-IS.
  *
  ******************************************************************************
  */
/* USER CODE END Header */
/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __USART_H__
#define __USART_H__

#ifdef __cplusplus
extern "C" {
#endif

/* Includes ------------------------------------------------------------------*/
#include "main.h"

/* USER CODE BEGIN Includes */

/* USER CODE END Includes */

extern UART_HandleTypeDef huart1;

extern UART_HandleTypeDef huart3;

/* USER CODE BEGIN Private defines */
#define BUF_SIZE 500
#define Uart1_BUF_SIZE  256
#define Uart2_BUF_SIZE  1024      /*为UART2、3专门开一个DMA接收存储区 2021-4-12 by Daiyf*/
#define Uart3_BUF_SIZE  256
	 
extern uint8_t usart1_rx_flag;
extern uint8_t usart3_rx_flag;
extern uint16_t rx1_len;
extern uint16_t rx3_len;

extern uint8_t USART_RX_BUF[Uart1_BUF_SIZE];
extern uint16_t LIB_CRC_MODBUS(uint8_t* Buf, uint16_t srLen);
extern uint8_t USART2_RX_BUF[Uart2_BUF_SIZE];
extern uint8_t USART2_RX_BUF002[Uart2_BUF_SIZE];
/* USER CODE END Private defines */

void MX_USART1_UART_Init(void);
void MX_USART3_UART_Init(void);

/* USER CODE BEGIN Prototypes */
void update_baudrate(uint16_t temp);

/* USER CODE END Prototypes */

#ifdef __cplusplus
}
#endif

#endif /* __USART_H__ */

