/** ****************************************************************************** * @file ymodem.h * @author MCD Application Team * @brief This file contains definitions for Ymodem functionalities. ****************************************************************************** * @attention * * Copyright (c) 2020 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. * ****************************************************************************** */ /* Define to prevent recursive inclusion -------------------------------------*/ #ifndef YMODEM_H_ #define YMODEM_H_ /** @addtogroup USER_APP User App Example * @{ */ /** @addtogroup FW_UPDATE Firmware Update Example * @{ */ /* Includes ------------------------------------------------------------------*/ /* Exported types ------------------------------------------------------------*/ typedef enum { COM_OK = 0x00U, /*!< OK */ COM_ERROR = 0x01U, /*!< Error */ COM_ABORT = 0x02U, /*!< Abort */ COM_TIMEOUT = 0x03U, /*!< Timeout */ COM_DATA = 0x04U, /*!< Data */ COM_LIMIT = 0x05U /*!< Limit*/ } COM_StatusTypeDef; /*!< Comm status structures definition */ typedef struct { HAL_StatusTypeDef(* Ymodem_HeaderPktRxCpltCallback)(uint32_t uFileSize); HAL_StatusTypeDef(* Ymodem_DataPktRxCpltCallback)(uint8_t *pData, uint32_t uFlashDestination, uint32_t uSize); } YMODEM_CallbacksTypeDef; /* Exported constants --------------------------------------------------------*/ /* Packet structure defines */ #define PACKET_HEADER_SIZE ((uint32_t)3U) /*!