79 lines
2.6 KiB
C
79 lines
2.6 KiB
C
/****************************************************************************
|
|
*
|
|
* Copyright(c) 2019 by Aerospace C.Power (Chongqing) Microelectronics. ALL RIGHTS RESERVED.
|
|
*
|
|
* This Information is proprietary to Aerospace C.Power (Chongqing) Microelectronics and MAY NOT
|
|
* be copied by any method or incorporated into another program without
|
|
* the express written consent of Aerospace C.Power. This Information or any portion
|
|
* thereof remains the property of Aerospace C.Power. The Information contained herein
|
|
* is believed to be accurate and Aerospace C.Power assumes no responsibility or
|
|
* liability for its use in any way and conveys no license or title under
|
|
* any patent or copyright and makes no representation or warranty that this
|
|
* Information is free from patent or copyright infringement.
|
|
*
|
|
* ****************************************************************************/
|
|
|
|
#ifndef _IOT_BRM_BRK_UPGRADE_IMG_H_
|
|
#define _IOT_BRM_BRK_UPGRADE_IMG_H_
|
|
|
|
/* iot common header files */
|
|
#include "iot_config_api.h"
|
|
#include "iot_brm_config.h"
|
|
|
|
#if (IOT_BRM_ENABLE)
|
|
|
|
/**
|
|
* @brief iot_brm_brk_fw_version() - get brk switch version.
|
|
* @param elc_ctl: electric control BRK flag.
|
|
* @retval brk switch version.
|
|
*/
|
|
uint16_t iot_brm_brk_fw_version(uint8_t elc_ctl);
|
|
|
|
/**
|
|
* @brief iot_brm_packet_xmode_data() - packet switch fw data in xmode proto.
|
|
* @param index: switch fw data index.
|
|
* @param elc_ctl: electric control BRK flag.
|
|
* @retval switch fw xmode data - for index invalid, pkt is NULL.
|
|
* othersie - success
|
|
*/
|
|
iot_pkt_t *iot_brm_packet_xmode_data(uint16_t index, uint8_t elc_ctl);
|
|
|
|
/**
|
|
* @brief iot_brm_packet_xmode_finish_cmd() - packet xmode data finish cmd.
|
|
* @retval switch fw xmode data - for fail case, pkt is NULL.
|
|
* othersie - success
|
|
*/
|
|
iot_pkt_t *iot_brm_packet_xmode_finish_cmd();
|
|
|
|
/**
|
|
* @brief iot_brm_rsp_xmode_ack_cmd() - is xmodem ack cmd.
|
|
* @retval ERR_OK - for ack cmd.
|
|
* othersie - not ack cmd.
|
|
*/
|
|
uint32_t iot_brm_rsp_xmode_ack_cmd(uint8_t *cmd);
|
|
|
|
/**
|
|
* @brief iot_brm_rsp_xmode_nak_cmd() - is xmodem nak cmd.
|
|
* @retval ERR_OK - for nak cmd.
|
|
* othersie - not nak cmd.
|
|
*/
|
|
uint32_t iot_brm_rsp_xmode_nak_cmd(uint8_t *cmd);
|
|
|
|
/**
|
|
* @brief iot_brm_brk_xmode_total_block() - app data total bolck.
|
|
* @param elc_ctl: electric control BRK flag.
|
|
* @retval xmodem total block.
|
|
*/
|
|
uint16_t iot_brm_brk_xmode_total_block(uint8_t elc_ctl);
|
|
|
|
/**
|
|
* @brief iot_brm_brk_xmode_crc16_ccitt() - app data crc16 ccitt value.
|
|
* @param elc_ctl: electric control BRK flag.
|
|
* @retval crc16 ccitt value.
|
|
*/
|
|
uint16_t iot_brm_brk_xmode_crc16_ccitt(uint8_t elc_ctl);
|
|
|
|
#endif /* IOT_BRM_ENABLE */
|
|
|
|
#endif /* _IOT_BRM_BRK_UPGRADE_IMG_H_ */
|