/* 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 */
#include "dataHandling.h"

/* USER CODE END Includes */

extern UART_HandleTypeDef huart1;

extern UART_HandleTypeDef huart3;

/* USER CODE BEGIN Private defines */
#define RX_BUF_SIZE 1024
	 
extern uint8_t USART_IAP_RX[RX_BUF_SIZE];
extern uint8_t USART_PUB_RX[RX_BUF_SIZE];
extern uint8_t USART_MODBUS_RX[RX_BUF_SIZE];
extern uint8_t USART_IAP_FLAG;
extern uint8_t USART_MODBUS_FLAG;
extern uint16_t USART_PUB_LENGTH;
extern uint16_t package_num;
extern uint16_t app_Cache_buf[RX_BUF_SIZE] ;
extern uint8_t destArray[128];
extern uint8_t nameArray[16];
extern uint16_t sizeArray[1] ;
extern uint8_t md5Array[16];

extern int count;
extern int nameIndex ;
extern int sizeIndex ;

extern uint16_t curpackage;
extern uint32_t curaddress;
/* 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);
void update_sysVersion(uint32_t addr);
void update_iaplength(uint32_t addr);
void updateiapMd5(uint32_t addr);
/* USER CODE END Prototypes */

#ifdef __cplusplus
}
#endif

#endif /* __USART_H__ */

