update version to v2.0.4

This commit is contained in:
Artery-MCU
2022-04-11 19:32:28 +08:00
parent 07d7347ba4
commit ccd0f1e108
1470 changed files with 213761 additions and 13939 deletions

View File

@@ -1,17 +1,17 @@
/**
**************************************************************************
* @file at32f415_clock.h
* @version v2.0.3
* @date 2022-02-11
* @version v2.0.4
* @date 2022-04-02
* @brief header file of clock program
**************************************************************************
* Copyright notice & Disclaimer
*
* The software Board Support Package (BSP) that is made available to
* download from Artery official website is the copyrighted work of Artery.
* Artery authorizes customers to use, copy, and distribute the BSP
* software and its related documentation for the purpose of design and
* development in conjunction with Artery microcontrollers. Use of the
* The software Board Support Package (BSP) that is made available to
* download from Artery official website is the copyrighted work of Artery.
* Artery authorizes customers to use, copy, and distribute the BSP
* software and its related documentation for the purpose of design and
* development in conjunction with Artery microcontrollers. Use of the
* software is governed by this copyright notice and the following disclaimer.
*
* THIS SOFTWARE IS PROVIDED ON "AS IS" BASIS WITHOUT WARRANTIES,

View File

@@ -1,17 +1,17 @@
/**
**************************************************************************
* @file at32f415_conf.h
* @version v2.0.3
* @date 2022-02-11
* @version v2.0.4
* @date 2022-04-02
* @brief at32f415 config header file
**************************************************************************
* Copyright notice & Disclaimer
*
* The software Board Support Package (BSP) that is made available to
* download from Artery official website is the copyrighted work of Artery.
* Artery authorizes customers to use, copy, and distribute the BSP
* software and its related documentation for the purpose of design and
* development in conjunction with Artery microcontrollers. Use of the
* The software Board Support Package (BSP) that is made available to
* download from Artery official website is the copyrighted work of Artery.
* Artery authorizes customers to use, copy, and distribute the BSP
* software and its related documentation for the purpose of design and
* development in conjunction with Artery microcontrollers. Use of the
* software is governed by this copyright notice and the following disclaimer.
*
* THIS SOFTWARE IS PROVIDED ON "AS IS" BASIS WITHOUT WARRANTIES,

View File

@@ -1,17 +1,17 @@
/**
**************************************************************************
* @file at32f415_int.h
* @version v2.0.3
* @date 2022-02-11
* @version v2.0.4
* @date 2022-04-02
* @brief header file of main interrupt service routines.
**************************************************************************
* Copyright notice & Disclaimer
*
* The software Board Support Package (BSP) that is made available to
* download from Artery official website is the copyrighted work of Artery.
* Artery authorizes customers to use, copy, and distribute the BSP
* software and its related documentation for the purpose of design and
* development in conjunction with Artery microcontrollers. Use of the
* The software Board Support Package (BSP) that is made available to
* download from Artery official website is the copyrighted work of Artery.
* Artery authorizes customers to use, copy, and distribute the BSP
* software and its related documentation for the purpose of design and
* development in conjunction with Artery microcontrollers. Use of the
* software is governed by this copyright notice and the following disclaimer.
*
* THIS SOFTWARE IS PROVIDED ON "AS IS" BASIS WITHOUT WARRANTIES,

View File

@@ -1,17 +1,17 @@
/**
**************************************************************************
* @file hid_iap_user.h
* @version v2.0.3
* @date 2022-02-11
* @version v2.0.4
* @date 2022-04-02
* @brief usb config header file
**************************************************************************
* Copyright notice & Disclaimer
*
* The software Board Support Package (BSP) that is made available to
* download from Artery official website is the copyrighted work of Artery.
* Artery authorizes customers to use, copy, and distribute the BSP
* software and its related documentation for the purpose of design and
* development in conjunction with Artery microcontrollers. Use of the
* The software Board Support Package (BSP) that is made available to
* download from Artery official website is the copyrighted work of Artery.
* Artery authorizes customers to use, copy, and distribute the BSP
* software and its related documentation for the purpose of design and
* development in conjunction with Artery microcontrollers. Use of the
* software is governed by this copyright notice and the following disclaimer.
*
* THIS SOFTWARE IS PROVIDED ON "AS IS" BASIS WITHOUT WARRANTIES,
@@ -23,7 +23,7 @@
*
**************************************************************************
*/
/* define to prevent recursive inclusion -------------------------------------*/
#ifndef __HID_IAP_USER_H
#define __HID_IAP_USER_H
@@ -31,7 +31,7 @@
#ifdef __cplusplus
extern "C" {
#endif
#include "hid_iap_class.h"
/** @addtogroup UTILITIES_examples
@@ -55,7 +55,7 @@ extern "C" {
/** @defgroup app_led3_toggle_exported_functions
* @{
*/
void iap_init(void);
iap_result_type iap_get_upgrade_flag(void);
void app_loop(void);

View File

@@ -1,17 +1,17 @@
/**
**************************************************************************
* @file usb_conf.h
* @version v2.0.3
* @date 2022-02-11
* @version v2.0.4
* @date 2022-04-02
* @brief usb config header file
**************************************************************************
* Copyright notice & Disclaimer
*
* The software Board Support Package (BSP) that is made available to
* download from Artery official website is the copyrighted work of Artery.
* Artery authorizes customers to use, copy, and distribute the BSP
* software and its related documentation for the purpose of design and
* development in conjunction with Artery microcontrollers. Use of the
* The software Board Support Package (BSP) that is made available to
* download from Artery official website is the copyrighted work of Artery.
* Artery authorizes customers to use, copy, and distribute the BSP
* software and its related documentation for the purpose of design and
* development in conjunction with Artery microcontrollers. Use of the
* software is governed by this copyright notice and the following disclaimer.
*
* THIS SOFTWARE IS PROVIDED ON "AS IS" BASIS WITHOUT WARRANTIES,
@@ -23,7 +23,7 @@
*
**************************************************************************
*/
/* define to prevent recursive inclusion -------------------------------------*/
#ifndef __USB_CONF_H
#define __USB_CONF_H
@@ -31,7 +31,7 @@
#ifdef __cplusplus
extern "C" {
#endif
#include "at32f415_usb.h"
#include "at32f415.h"
#include "at32f415_board.h"
@@ -40,7 +40,7 @@ extern "C" {
/** @addtogroup AT32F415_periph_examples
* @{
*/
/** @addtogroup 415_USB_device_hid_app_led3
* @{
*/
@@ -139,11 +139,11 @@ void usb_delay_us(uint32_t us);
/**
* @}
*/
*/
/**
* @}
*/
*/
#ifdef __cplusplus
}
#endif

View File

@@ -1,8 +1,8 @@
/**
**************************************************************************
* @file readme.txt
* @version v2.0.3
* @date 2022-02-11
* @version v2.0.4
* @date 2022-04-02
* @brief readme
**************************************************************************
*/

View File

@@ -1,17 +1,17 @@
/**
**************************************************************************
* @file at32f415_clock.c
* @version v2.0.3
* @date 2022-02-11
* @version v2.0.4
* @date 2022-04-02
* @brief system clock config program
**************************************************************************
* Copyright notice & Disclaimer
*
* The software Board Support Package (BSP) that is made available to
* download from Artery official website is the copyrighted work of Artery.
* Artery authorizes customers to use, copy, and distribute the BSP
* software and its related documentation for the purpose of design and
* development in conjunction with Artery microcontrollers. Use of the
* The software Board Support Package (BSP) that is made available to
* download from Artery official website is the copyrighted work of Artery.
* Artery authorizes customers to use, copy, and distribute the BSP
* software and its related documentation for the purpose of design and
* development in conjunction with Artery microcontrollers. Use of the
* software is governed by this copyright notice and the following disclaimer.
*
* THIS SOFTWARE IS PROVIDED ON "AS IS" BASIS WITHOUT WARRANTIES,
@@ -48,8 +48,8 @@
void system_clock_config(void)
{
/* config flash psr register */
flash_psr_set(FLASH_WAIT_CYCLE_4);
flash_psr_set(FLASH_WAIT_CYCLE_4);
/* reset crm */
crm_reset();

View File

@@ -1,17 +1,17 @@
/**
**************************************************************************
* @file at32f415_int.c
* @version v2.0.3
* @date 2022-02-11
* @version v2.0.4
* @date 2022-04-02
* @brief main interrupt service routines.
**************************************************************************
* Copyright notice & Disclaimer
*
* The software Board Support Package (BSP) that is made available to
* download from Artery official website is the copyrighted work of Artery.
* Artery authorizes customers to use, copy, and distribute the BSP
* software and its related documentation for the purpose of design and
* development in conjunction with Artery microcontrollers. Use of the
* The software Board Support Package (BSP) that is made available to
* download from Artery official website is the copyrighted work of Artery.
* Artery authorizes customers to use, copy, and distribute the BSP
* software and its related documentation for the purpose of design and
* development in conjunction with Artery microcontrollers. Use of the
* software is governed by this copyright notice and the following disclaimer.
*
* THIS SOFTWARE IS PROVIDED ON "AS IS" BASIS WITHOUT WARRANTIES,
@@ -134,8 +134,8 @@ void SysTick_Handler(void)
/**
* @}
*/
*/
/**
* @}
*/
*/

View File

@@ -1,17 +1,17 @@
/**
**************************************************************************
* @file hid_iap_user.c
* @version v2.0.3
* @date 2022-02-11
* @version v2.0.4
* @date 2022-04-02
* @brief usb hid iap user file
**************************************************************************
* Copyright notice & Disclaimer
*
* The software Board Support Package (BSP) that is made available to
* download from Artery official website is the copyrighted work of Artery.
* Artery authorizes customers to use, copy, and distribute the BSP
* software and its related documentation for the purpose of design and
* development in conjunction with Artery microcontrollers. Use of the
* The software Board Support Package (BSP) that is made available to
* download from Artery official website is the copyrighted work of Artery.
* Artery authorizes customers to use, copy, and distribute the BSP
* software and its related documentation for the purpose of design and
* development in conjunction with Artery microcontrollers. Use of the
* software is governed by this copyright notice and the following disclaimer.
*
* THIS SOFTWARE IS PROVIDED ON "AS IS" BASIS WITHOUT WARRANTIES,
@@ -50,31 +50,31 @@ void iap_respond(uint8_t *res_buf, uint16_t iap_cmd, uint16_t result);
/**
* @brief clear iap upgrade flag
* @param none
* @retval none
* @retval none
*/
void iap_clear_upgrade_flag(void)
{
flash_unlock();
flash_sector_erase(iap_info.flag_address);
flash_lock();
flash_lock();
}
/**
* @brief set iap upgrade complete flag
* @param none
* @retval none
* @retval none
*/
void iap_set_upgrade_flag(void)
{
flash_unlock();
flash_word_program(iap_info.flag_address, IAP_UPGRADE_COMPLETE_FLAG);
flash_lock();
flash_lock();
}
/**
* @brief get iap upgrade complete flag
* @param none
* @retval the status of the iap flag
* @retval the status of the iap flag
*/
iap_result_type iap_get_upgrade_flag(void)
{
@@ -92,7 +92,7 @@ iap_result_type iap_get_upgrade_flag(void)
/**
* @brief iap init
* @param none
* @retval none
* @retval none
*/
void iap_init(void)
{
@@ -105,13 +105,13 @@ void iap_init(void)
{
iap_info.sector_size = SECTOR_SIZE_2K;
}
iap_info.flash_start_address = FLASH_BASE;
iap_info.flash_end_address = iap_info.flash_start_address + iap_info.flash_size;
iap_info.app_address = FLASH_APP_ADDRESS;
iap_info.flag_address = iap_info.app_address - iap_info.sector_size;
iap_info.fifo_length = 0;
iap_info.iap_address = 0;
}
@@ -119,7 +119,7 @@ void iap_init(void)
/**
* @brief iap idle function
* @param none
* @retval none
* @retval none
*/
void iap_idle(void)
{
@@ -131,7 +131,7 @@ void iap_idle(void)
/**
* @brief iap start function
* @param none
* @retval none
* @retval none
*/
void iap_start(void)
{
@@ -143,22 +143,22 @@ void iap_start(void)
/*
* @brief iap jump
* @param none
* @retval none
* @retval none
*/
void iap_jump()
{
iap_info.state = IAP_STS_JMP_WAIT;
iap_respond(iap_info.iap_tx, IAP_CMD_JMP, IAP_ACK);
iap_respond(iap_info.iap_tx, IAP_CMD_JMP, IAP_ACK);
}
/*
* @brief iap get
* @param none
* @retval none
* @retval none
*/
void iap_get()
{
iap_respond(iap_info.iap_tx, IAP_CMD_GET, IAP_ACK);
iap_respond(iap_info.iap_tx, IAP_CMD_GET, IAP_ACK);
iap_info.iap_tx[4] = (uint8_t)((iap_info.app_address >> 24) & 0xFF);
iap_info.iap_tx[5] = (uint8_t)((iap_info.app_address >> 16) & 0xFF);
iap_info.iap_tx[6] = (uint8_t)((iap_info.app_address >> 8) & 0xFF);
@@ -172,7 +172,7 @@ void iap_get()
* @param res_buf: data buffer pointer.
* @param iap_cmd: iap command
* @param result: iap result
* @retval the result of the address parse
* @retval the result of the address parse
*/
void iap_respond(uint8_t *res_buf, uint16_t iap_cmd, uint16_t result)
{
@@ -180,7 +180,7 @@ void iap_respond(uint8_t *res_buf, uint16_t iap_cmd, uint16_t result)
res_buf[1] = (uint8_t)((iap_cmd) & 0xFF);
res_buf[2] = (uint8_t)((result >> 8) & 0xFF);
res_buf[3] = (uint8_t)((result) & 0xFF);
iap_info.respond_flag = 1;
}
@@ -189,22 +189,22 @@ void iap_respond(uint8_t *res_buf, uint16_t iap_cmd, uint16_t result)
* @param udev: to the structure of usbd_core_type
* @param pdata: data buffer point
* @param len: data length
* @retval iap_result_type
* @retval iap_result_type
*/
iap_result_type usbd_hid_iap_process(void *udev, uint8_t *pdata, uint16_t len)
{
iap_result_type status = IAP_SUCCESS;
uint16_t iap_cmd;
if(len < 2)
{
return IAP_FAILED;
}
iap_info.respond_flag = 0;
iap_cmd = (pdata[0] << 8) | pdata[1];
switch(iap_cmd)
{
case IAP_CMD_IDLE:
@@ -221,21 +221,21 @@ iap_result_type usbd_hid_iap_process(void *udev, uint8_t *pdata, uint16_t len)
break;
default:
status = IAP_FAILED;
break;
break;
}
if(iap_info.respond_flag)
{
usb_iap_class_send_report(udev, iap_info.iap_tx, 64);
}
return status;
}
/**
* @brief usb device in transfer complete function
* @param udev: to the structure of usbd_core_type
* @retval none
* @retval none
*/
void usbd_hid_iap_in_complete(void *udev)
{
@@ -248,7 +248,7 @@ void usbd_hid_iap_in_complete(void *udev)
/**
* @brief iap loop
* @param none
* @retval none
* @retval none
*/
void app_loop(void)
{
@@ -261,8 +261,8 @@ void app_loop(void)
/**
* @}
*/
*/
/**
* @}
*/
*/

View File

@@ -1,8 +1,8 @@
/**
**************************************************************************
* @file main.c
* @version v2.0.3
* @date 2022-02-11
* @version v2.0.4
* @date 2022-04-02
* @brief main program
**************************************************************************
* Copyright notice & Disclaimer

View File

@@ -1,17 +1,17 @@
/**
**************************************************************************
* @file at32f415_clock.h
* @version v2.0.3
* @date 2022-02-11
* @version v2.0.4
* @date 2022-04-02
* @brief header file of clock program
**************************************************************************
* Copyright notice & Disclaimer
*
* The software Board Support Package (BSP) that is made available to
* download from Artery official website is the copyrighted work of Artery.
* Artery authorizes customers to use, copy, and distribute the BSP
* software and its related documentation for the purpose of design and
* development in conjunction with Artery microcontrollers. Use of the
* The software Board Support Package (BSP) that is made available to
* download from Artery official website is the copyrighted work of Artery.
* Artery authorizes customers to use, copy, and distribute the BSP
* software and its related documentation for the purpose of design and
* development in conjunction with Artery microcontrollers. Use of the
* software is governed by this copyright notice and the following disclaimer.
*
* THIS SOFTWARE IS PROVIDED ON "AS IS" BASIS WITHOUT WARRANTIES,

View File

@@ -1,17 +1,17 @@
/**
**************************************************************************
* @file at32f415_conf.h
* @version v2.0.3
* @date 2022-02-11
* @version v2.0.4
* @date 2022-04-02
* @brief at32f415 config header file
**************************************************************************
* Copyright notice & Disclaimer
*
* The software Board Support Package (BSP) that is made available to
* download from Artery official website is the copyrighted work of Artery.
* Artery authorizes customers to use, copy, and distribute the BSP
* software and its related documentation for the purpose of design and
* development in conjunction with Artery microcontrollers. Use of the
* The software Board Support Package (BSP) that is made available to
* download from Artery official website is the copyrighted work of Artery.
* Artery authorizes customers to use, copy, and distribute the BSP
* software and its related documentation for the purpose of design and
* development in conjunction with Artery microcontrollers. Use of the
* software is governed by this copyright notice and the following disclaimer.
*
* THIS SOFTWARE IS PROVIDED ON "AS IS" BASIS WITHOUT WARRANTIES,

View File

@@ -1,17 +1,17 @@
/**
**************************************************************************
* @file at32f415_int.h
* @version v2.0.3
* @date 2022-02-11
* @version v2.0.4
* @date 2022-04-02
* @brief header file of main interrupt service routines.
**************************************************************************
* Copyright notice & Disclaimer
*
* The software Board Support Package (BSP) that is made available to
* download from Artery official website is the copyrighted work of Artery.
* Artery authorizes customers to use, copy, and distribute the BSP
* software and its related documentation for the purpose of design and
* development in conjunction with Artery microcontrollers. Use of the
* The software Board Support Package (BSP) that is made available to
* download from Artery official website is the copyrighted work of Artery.
* Artery authorizes customers to use, copy, and distribute the BSP
* software and its related documentation for the purpose of design and
* development in conjunction with Artery microcontrollers. Use of the
* software is governed by this copyright notice and the following disclaimer.
*
* THIS SOFTWARE IS PROVIDED ON "AS IS" BASIS WITHOUT WARRANTIES,

View File

@@ -1,17 +1,17 @@
/**
**************************************************************************
* @file hid_iap_user.h
* @version v2.0.3
* @date 2022-02-11
* @version v2.0.4
* @date 2022-04-02
* @brief usb config header file
**************************************************************************
* Copyright notice & Disclaimer
*
* The software Board Support Package (BSP) that is made available to
* download from Artery official website is the copyrighted work of Artery.
* Artery authorizes customers to use, copy, and distribute the BSP
* software and its related documentation for the purpose of design and
* development in conjunction with Artery microcontrollers. Use of the
* The software Board Support Package (BSP) that is made available to
* download from Artery official website is the copyrighted work of Artery.
* Artery authorizes customers to use, copy, and distribute the BSP
* software and its related documentation for the purpose of design and
* development in conjunction with Artery microcontrollers. Use of the
* software is governed by this copyright notice and the following disclaimer.
*
* THIS SOFTWARE IS PROVIDED ON "AS IS" BASIS WITHOUT WARRANTIES,
@@ -23,7 +23,7 @@
*
**************************************************************************
*/
/* define to prevent recursive inclusion -------------------------------------*/
#ifndef __HID_IAP_USER_H
#define __HID_IAP_USER_H
@@ -31,7 +31,7 @@
#ifdef __cplusplus
extern "C" {
#endif
#include "hid_iap_class.h"
/** @addtogroup UTILITIES_examples
@@ -55,7 +55,7 @@ extern "C" {
/** @defgroup app_led4_toggle_exported_functions
* @{
*/
void iap_init(void);
iap_result_type iap_get_upgrade_flag(void);
void app_loop(void);

View File

@@ -1,17 +1,17 @@
/**
**************************************************************************
* @file usb_conf.h
* @version v2.0.3
* @date 2022-02-11
* @version v2.0.4
* @date 2022-04-02
* @brief usb config header file
**************************************************************************
* Copyright notice & Disclaimer
*
* The software Board Support Package (BSP) that is made available to
* download from Artery official website is the copyrighted work of Artery.
* Artery authorizes customers to use, copy, and distribute the BSP
* software and its related documentation for the purpose of design and
* development in conjunction with Artery microcontrollers. Use of the
* The software Board Support Package (BSP) that is made available to
* download from Artery official website is the copyrighted work of Artery.
* Artery authorizes customers to use, copy, and distribute the BSP
* software and its related documentation for the purpose of design and
* development in conjunction with Artery microcontrollers. Use of the
* software is governed by this copyright notice and the following disclaimer.
*
* THIS SOFTWARE IS PROVIDED ON "AS IS" BASIS WITHOUT WARRANTIES,
@@ -23,7 +23,7 @@
*
**************************************************************************
*/
/* define to prevent recursive inclusion -------------------------------------*/
#ifndef __USB_CONF_H
#define __USB_CONF_H
@@ -31,7 +31,7 @@
#ifdef __cplusplus
extern "C" {
#endif
#include "at32f415_usb.h"
#include "at32f415.h"
#include "at32f415_board.h"
@@ -40,7 +40,7 @@ extern "C" {
/** @addtogroup AT32F415_periph_examples
* @{
*/
/** @addtogroup 415_USB_device_hid_app_led4
* @{
*/
@@ -139,11 +139,11 @@ void usb_delay_us(uint32_t us);
/**
* @}
*/
*/
/**
* @}
*/
*/
#ifdef __cplusplus
}
#endif

View File

@@ -1,8 +1,8 @@
/**
**************************************************************************
* @file readme.txt
* @version v2.0.3
* @date 2022-02-11
* @version v2.0.4
* @date 2022-04-02
* @brief readme
**************************************************************************
*/

View File

@@ -1,17 +1,17 @@
/**
**************************************************************************
* @file at32f415_clock.c
* @version v2.0.3
* @date 2022-02-11
* @version v2.0.4
* @date 2022-04-02
* @brief system clock config program
**************************************************************************
* Copyright notice & Disclaimer
*
* The software Board Support Package (BSP) that is made available to
* download from Artery official website is the copyrighted work of Artery.
* Artery authorizes customers to use, copy, and distribute the BSP
* software and its related documentation for the purpose of design and
* development in conjunction with Artery microcontrollers. Use of the
* The software Board Support Package (BSP) that is made available to
* download from Artery official website is the copyrighted work of Artery.
* Artery authorizes customers to use, copy, and distribute the BSP
* software and its related documentation for the purpose of design and
* development in conjunction with Artery microcontrollers. Use of the
* software is governed by this copyright notice and the following disclaimer.
*
* THIS SOFTWARE IS PROVIDED ON "AS IS" BASIS WITHOUT WARRANTIES,
@@ -48,8 +48,8 @@
void system_clock_config(void)
{
/* config flash psr register */
flash_psr_set(FLASH_WAIT_CYCLE_4);
flash_psr_set(FLASH_WAIT_CYCLE_4);
/* reset crm */
crm_reset();

View File

@@ -1,17 +1,17 @@
/**
**************************************************************************
* @file at32f415_int.c
* @version v2.0.3
* @date 2022-02-11
* @version v2.0.4
* @date 2022-04-02
* @brief main interrupt service routines.
**************************************************************************
* Copyright notice & Disclaimer
*
* The software Board Support Package (BSP) that is made available to
* download from Artery official website is the copyrighted work of Artery.
* Artery authorizes customers to use, copy, and distribute the BSP
* software and its related documentation for the purpose of design and
* development in conjunction with Artery microcontrollers. Use of the
* The software Board Support Package (BSP) that is made available to
* download from Artery official website is the copyrighted work of Artery.
* Artery authorizes customers to use, copy, and distribute the BSP
* software and its related documentation for the purpose of design and
* development in conjunction with Artery microcontrollers. Use of the
* software is governed by this copyright notice and the following disclaimer.
*
* THIS SOFTWARE IS PROVIDED ON "AS IS" BASIS WITHOUT WARRANTIES,
@@ -134,8 +134,8 @@ void SysTick_Handler(void)
/**
* @}
*/
*/
/**
* @}
*/
*/

View File

@@ -1,17 +1,17 @@
/**
**************************************************************************
* @file hid_iap_user.c
* @version v2.0.3
* @date 2022-02-11
* @version v2.0.4
* @date 2022-04-02
* @brief usb hid iap user file
**************************************************************************
* Copyright notice & Disclaimer
*
* The software Board Support Package (BSP) that is made available to
* download from Artery official website is the copyrighted work of Artery.
* Artery authorizes customers to use, copy, and distribute the BSP
* software and its related documentation for the purpose of design and
* development in conjunction with Artery microcontrollers. Use of the
* The software Board Support Package (BSP) that is made available to
* download from Artery official website is the copyrighted work of Artery.
* Artery authorizes customers to use, copy, and distribute the BSP
* software and its related documentation for the purpose of design and
* development in conjunction with Artery microcontrollers. Use of the
* software is governed by this copyright notice and the following disclaimer.
*
* THIS SOFTWARE IS PROVIDED ON "AS IS" BASIS WITHOUT WARRANTIES,
@@ -50,31 +50,31 @@ void iap_respond(uint8_t *res_buf, uint16_t iap_cmd, uint16_t result);
/**
* @brief clear iap upgrade flag
* @param none
* @retval none
* @retval none
*/
void iap_clear_upgrade_flag(void)
{
flash_unlock();
flash_sector_erase(iap_info.flag_address);
flash_lock();
flash_lock();
}
/**
* @brief set iap upgrade complete flag
* @param none
* @retval none
* @retval none
*/
void iap_set_upgrade_flag(void)
{
flash_unlock();
flash_word_program(iap_info.flag_address, IAP_UPGRADE_COMPLETE_FLAG);
flash_lock();
flash_lock();
}
/**
* @brief get iap upgrade complete flag
* @param none
* @retval the status of the iap flag
* @retval the status of the iap flag
*/
iap_result_type iap_get_upgrade_flag(void)
{
@@ -92,7 +92,7 @@ iap_result_type iap_get_upgrade_flag(void)
/**
* @brief iap init
* @param none
* @retval none
* @retval none
*/
void iap_init(void)
{
@@ -105,13 +105,13 @@ void iap_init(void)
{
iap_info.sector_size = SECTOR_SIZE_2K;
}
iap_info.flash_start_address = FLASH_BASE;
iap_info.flash_end_address = iap_info.flash_start_address + iap_info.flash_size;
iap_info.app_address = FLASH_APP_ADDRESS;
iap_info.flag_address = iap_info.app_address - iap_info.sector_size;
iap_info.fifo_length = 0;
iap_info.iap_address = 0;
}
@@ -119,7 +119,7 @@ void iap_init(void)
/**
* @brief iap idle function
* @param none
* @retval none
* @retval none
*/
void iap_idle(void)
{
@@ -131,7 +131,7 @@ void iap_idle(void)
/**
* @brief iap start function
* @param none
* @retval none
* @retval none
*/
void iap_start(void)
{
@@ -143,22 +143,22 @@ void iap_start(void)
/*
* @brief iap jump
* @param none
* @retval none
* @retval none
*/
void iap_jump()
{
iap_info.state = IAP_STS_JMP_WAIT;
iap_respond(iap_info.iap_tx, IAP_CMD_JMP, IAP_ACK);
iap_respond(iap_info.iap_tx, IAP_CMD_JMP, IAP_ACK);
}
/*
* @brief iap get
* @param none
* @retval none
* @retval none
*/
void iap_get()
{
iap_respond(iap_info.iap_tx, IAP_CMD_GET, IAP_ACK);
iap_respond(iap_info.iap_tx, IAP_CMD_GET, IAP_ACK);
iap_info.iap_tx[4] = (uint8_t)((iap_info.app_address >> 24) & 0xFF);
iap_info.iap_tx[5] = (uint8_t)((iap_info.app_address >> 16) & 0xFF);
iap_info.iap_tx[6] = (uint8_t)((iap_info.app_address >> 8) & 0xFF);
@@ -172,7 +172,7 @@ void iap_get()
* @param res_buf: data buffer pointer.
* @param iap_cmd: iap command
* @param result: iap result
* @retval the result of the address parse
* @retval the result of the address parse
*/
void iap_respond(uint8_t *res_buf, uint16_t iap_cmd, uint16_t result)
{
@@ -180,7 +180,7 @@ void iap_respond(uint8_t *res_buf, uint16_t iap_cmd, uint16_t result)
res_buf[1] = (uint8_t)((iap_cmd) & 0xFF);
res_buf[2] = (uint8_t)((result >> 8) & 0xFF);
res_buf[3] = (uint8_t)((result) & 0xFF);
iap_info.respond_flag = 1;
}
@@ -189,22 +189,22 @@ void iap_respond(uint8_t *res_buf, uint16_t iap_cmd, uint16_t result)
* @param udev: to the structure of usbd_core_type
* @param pdata: data buffer point
* @param len: data length
* @retval iap_result_type
* @retval iap_result_type
*/
iap_result_type usbd_hid_iap_process(void *udev, uint8_t *pdata, uint16_t len)
{
iap_result_type status = IAP_SUCCESS;
uint16_t iap_cmd;
if(len < 2)
{
return IAP_FAILED;
}
iap_info.respond_flag = 0;
iap_cmd = (pdata[0] << 8) | pdata[1];
switch(iap_cmd)
{
case IAP_CMD_IDLE:
@@ -221,21 +221,21 @@ iap_result_type usbd_hid_iap_process(void *udev, uint8_t *pdata, uint16_t len)
break;
default:
status = IAP_FAILED;
break;
break;
}
if(iap_info.respond_flag)
{
usb_iap_class_send_report(udev, iap_info.iap_tx, 64);
}
return status;
}
/**
* @brief usb device in transfer complete function
* @param udev: to the structure of usbd_core_type
* @retval none
* @retval none
*/
void usbd_hid_iap_in_complete(void *udev)
{
@@ -248,7 +248,7 @@ void usbd_hid_iap_in_complete(void *udev)
/**
* @brief iap loop
* @param none
* @retval none
* @retval none
*/
void app_loop(void)
{
@@ -261,8 +261,8 @@ void app_loop(void)
/**
* @}
*/
*/
/**
* @}
*/
*/

View File

@@ -1,8 +1,8 @@
/**
**************************************************************************
* @file main.c
* @version v2.0.3
* @date 2022-02-11
* @version v2.0.4
* @date 2022-04-02
* @brief main program
**************************************************************************
* Copyright notice & Disclaimer

View File

@@ -1,17 +1,17 @@
/**
**************************************************************************
* @file at32f415_clock.h
* @version v2.0.3
* @date 2022-02-11
* @version v2.0.4
* @date 2022-04-02
* @brief header file of clock program
**************************************************************************
* Copyright notice & Disclaimer
*
* The software Board Support Package (BSP) that is made available to
* download from Artery official website is the copyrighted work of Artery.
* Artery authorizes customers to use, copy, and distribute the BSP
* software and its related documentation for the purpose of design and
* development in conjunction with Artery microcontrollers. Use of the
* The software Board Support Package (BSP) that is made available to
* download from Artery official website is the copyrighted work of Artery.
* Artery authorizes customers to use, copy, and distribute the BSP
* software and its related documentation for the purpose of design and
* development in conjunction with Artery microcontrollers. Use of the
* software is governed by this copyright notice and the following disclaimer.
*
* THIS SOFTWARE IS PROVIDED ON "AS IS" BASIS WITHOUT WARRANTIES,

View File

@@ -1,17 +1,17 @@
/**
**************************************************************************
* @file at32f415_conf.h
* @version v2.0.3
* @date 2022-02-11
* @version v2.0.4
* @date 2022-04-02
* @brief at32f415 config header file
**************************************************************************
* Copyright notice & Disclaimer
*
* The software Board Support Package (BSP) that is made available to
* download from Artery official website is the copyrighted work of Artery.
* Artery authorizes customers to use, copy, and distribute the BSP
* software and its related documentation for the purpose of design and
* development in conjunction with Artery microcontrollers. Use of the
* The software Board Support Package (BSP) that is made available to
* download from Artery official website is the copyrighted work of Artery.
* Artery authorizes customers to use, copy, and distribute the BSP
* software and its related documentation for the purpose of design and
* development in conjunction with Artery microcontrollers. Use of the
* software is governed by this copyright notice and the following disclaimer.
*
* THIS SOFTWARE IS PROVIDED ON "AS IS" BASIS WITHOUT WARRANTIES,

View File

@@ -1,17 +1,17 @@
/**
**************************************************************************
* @file at32f415_int.h
* @version v2.0.3
* @date 2022-02-11
* @version v2.0.4
* @date 2022-04-02
* @brief header file of main interrupt service routines.
**************************************************************************
* Copyright notice & Disclaimer
*
* The software Board Support Package (BSP) that is made available to
* download from Artery official website is the copyrighted work of Artery.
* Artery authorizes customers to use, copy, and distribute the BSP
* software and its related documentation for the purpose of design and
* development in conjunction with Artery microcontrollers. Use of the
* The software Board Support Package (BSP) that is made available to
* download from Artery official website is the copyrighted work of Artery.
* Artery authorizes customers to use, copy, and distribute the BSP
* software and its related documentation for the purpose of design and
* development in conjunction with Artery microcontrollers. Use of the
* software is governed by this copyright notice and the following disclaimer.
*
* THIS SOFTWARE IS PROVIDED ON "AS IS" BASIS WITHOUT WARRANTIES,

View File

@@ -1,17 +1,17 @@
/**
**************************************************************************
* @file hid_iap_user.h
* @version v2.0.3
* @date 2022-02-11
* @version v2.0.4
* @date 2022-04-02
* @brief usb config header file
**************************************************************************
* Copyright notice & Disclaimer
*
* The software Board Support Package (BSP) that is made available to
* download from Artery official website is the copyrighted work of Artery.
* Artery authorizes customers to use, copy, and distribute the BSP
* software and its related documentation for the purpose of design and
* development in conjunction with Artery microcontrollers. Use of the
* The software Board Support Package (BSP) that is made available to
* download from Artery official website is the copyrighted work of Artery.
* Artery authorizes customers to use, copy, and distribute the BSP
* software and its related documentation for the purpose of design and
* development in conjunction with Artery microcontrollers. Use of the
* software is governed by this copyright notice and the following disclaimer.
*
* THIS SOFTWARE IS PROVIDED ON "AS IS" BASIS WITHOUT WARRANTIES,
@@ -23,7 +23,7 @@
*
**************************************************************************
*/
/* define to prevent recursive inclusion -------------------------------------*/
#ifndef __HID_IAP_USER_H
#define __HID_IAP_USER_H
@@ -31,7 +31,7 @@
#ifdef __cplusplus
extern "C" {
#endif
#include "hid_iap_class.h"
/** @addtogroup UTILITIES_examples

View File

@@ -1,17 +1,17 @@
/**
**************************************************************************
* @file usb_conf.h
* @version v2.0.3
* @date 2022-02-11
* @version v2.0.4
* @date 2022-04-02
* @brief usb config header file
**************************************************************************
* Copyright notice & Disclaimer
*
* The software Board Support Package (BSP) that is made available to
* download from Artery official website is the copyrighted work of Artery.
* Artery authorizes customers to use, copy, and distribute the BSP
* software and its related documentation for the purpose of design and
* development in conjunction with Artery microcontrollers. Use of the
* The software Board Support Package (BSP) that is made available to
* download from Artery official website is the copyrighted work of Artery.
* Artery authorizes customers to use, copy, and distribute the BSP
* software and its related documentation for the purpose of design and
* development in conjunction with Artery microcontrollers. Use of the
* software is governed by this copyright notice and the following disclaimer.
*
* THIS SOFTWARE IS PROVIDED ON "AS IS" BASIS WITHOUT WARRANTIES,
@@ -23,7 +23,7 @@
*
**************************************************************************
*/
/* define to prevent recursive inclusion -------------------------------------*/
#ifndef __USB_CONF_H
#define __USB_CONF_H
@@ -31,7 +31,7 @@
#ifdef __cplusplus
extern "C" {
#endif
#include "at32f415_usb.h"
#include "at32f415.h"
#include "at32f415_board.h"
@@ -40,7 +40,7 @@ extern "C" {
/** @addtogroup AT32F415_periph_examples
* @{
*/
/** @addtogroup 415_USB_device_hid_iap
* @{
*/
@@ -140,11 +140,11 @@ void usb_delay_us(uint32_t us);
/**
* @}
*/
*/
/**
* @}
*/
*/
#ifdef __cplusplus
}
#endif

View File

@@ -1,8 +1,8 @@
/**
**************************************************************************
* @file readme.txt
* @version v2.0.3
* @date 2022-02-11
* @version v2.0.4
* @date 2022-04-02
* @brief readme
**************************************************************************
*/

View File

@@ -1,17 +1,17 @@
/**
**************************************************************************
* @file at32f415_clock.c
* @version v2.0.3
* @date 2022-02-11
* @version v2.0.4
* @date 2022-04-02
* @brief system clock config program
**************************************************************************
* Copyright notice & Disclaimer
*
* The software Board Support Package (BSP) that is made available to
* download from Artery official website is the copyrighted work of Artery.
* Artery authorizes customers to use, copy, and distribute the BSP
* software and its related documentation for the purpose of design and
* development in conjunction with Artery microcontrollers. Use of the
* The software Board Support Package (BSP) that is made available to
* download from Artery official website is the copyrighted work of Artery.
* Artery authorizes customers to use, copy, and distribute the BSP
* software and its related documentation for the purpose of design and
* development in conjunction with Artery microcontrollers. Use of the
* software is governed by this copyright notice and the following disclaimer.
*
* THIS SOFTWARE IS PROVIDED ON "AS IS" BASIS WITHOUT WARRANTIES,
@@ -48,8 +48,8 @@
void system_clock_config(void)
{
/* config flash psr register */
flash_psr_set(FLASH_WAIT_CYCLE_4);
flash_psr_set(FLASH_WAIT_CYCLE_4);
/* reset crm */
crm_reset();

View File

@@ -1,17 +1,17 @@
/**
**************************************************************************
* @file at32f415_int.c
* @version v2.0.3
* @date 2022-02-11
* @version v2.0.4
* @date 2022-04-02
* @brief main interrupt service routines.
**************************************************************************
* Copyright notice & Disclaimer
*
* The software Board Support Package (BSP) that is made available to
* download from Artery official website is the copyrighted work of Artery.
* Artery authorizes customers to use, copy, and distribute the BSP
* software and its related documentation for the purpose of design and
* development in conjunction with Artery microcontrollers. Use of the
* The software Board Support Package (BSP) that is made available to
* download from Artery official website is the copyrighted work of Artery.
* Artery authorizes customers to use, copy, and distribute the BSP
* software and its related documentation for the purpose of design and
* development in conjunction with Artery microcontrollers. Use of the
* software is governed by this copyright notice and the following disclaimer.
*
* THIS SOFTWARE IS PROVIDED ON "AS IS" BASIS WITHOUT WARRANTIES,
@@ -134,8 +134,8 @@ void SysTick_Handler(void)
/**
* @}
*/
*/
/**
* @}
*/
*/

View File

@@ -1,17 +1,17 @@
/**
**************************************************************************
* @file hid_iap_user.c
* @version v2.0.3
* @date 2022-02-11
* @version v2.0.4
* @date 2022-04-02
* @brief usb hid iap user file
**************************************************************************
* Copyright notice & Disclaimer
*
* The software Board Support Package (BSP) that is made available to
* download from Artery official website is the copyrighted work of Artery.
* Artery authorizes customers to use, copy, and distribute the BSP
* software and its related documentation for the purpose of design and
* development in conjunction with Artery microcontrollers. Use of the
* The software Board Support Package (BSP) that is made available to
* download from Artery official website is the copyrighted work of Artery.
* Artery authorizes customers to use, copy, and distribute the BSP
* software and its related documentation for the purpose of design and
* development in conjunction with Artery microcontrollers. Use of the
* software is governed by this copyright notice and the following disclaimer.
*
* THIS SOFTWARE IS PROVIDED ON "AS IS" BASIS WITHOUT WARRANTIES,
@@ -35,7 +35,7 @@
/** @addtogroup USB_IAP_bootloader
* @{
*/
void (*pftarget)(void);
void iap_clear_upgrade_flag(void);
void iap_set_upgrade_flag(void);
@@ -52,7 +52,7 @@ void iap_respond(uint8_t *res_buf, uint16_t iap_cmd, uint16_t result);
/**
* @brief jump to app
* @param none
* @retval none
* @retval none
*/
void jump_to_app(uint32_t address)
{
@@ -79,31 +79,31 @@ void jump_to_app(uint32_t address)
/**
* @brief clear iap upgrade flag
* @param none
* @retval none
* @retval none
*/
void iap_clear_upgrade_flag(void)
{
flash_unlock();
flash_sector_erase(iap_info.flag_address);
flash_lock();
flash_lock();
}
/**
* @brief set iap upgrade complete flag
* @param none
* @retval none
* @retval none
*/
void iap_set_upgrade_flag(void)
{
flash_unlock();
flash_word_program(iap_info.flag_address, IAP_UPGRADE_COMPLETE_FLAG);
flash_lock();
flash_lock();
}
/**
* @brief get iap upgrade complete flag
* @param none
* @retval the status of the iap flag
* @retval the status of the iap flag
*/
iap_result_type iap_get_upgrade_flag(void)
{
@@ -121,7 +121,7 @@ iap_result_type iap_get_upgrade_flag(void)
/**
* @brief set iap upgrade complete flag
* @param none
* @retval none
* @retval none
*/
void iap_erase_sector(uint32_t address)
{
@@ -152,7 +152,7 @@ void iap_erase_sector(uint32_t address)
* @brief crc cal
* @param addr: start address
* @param nk: nk byte
* @retval crc value
* @retval crc value
*/
uint32_t crc_cal(uint32_t addr, uint16_t nk)
{
@@ -161,7 +161,7 @@ uint32_t crc_cal(uint32_t addr, uint16_t nk)
uint32_t value, i_index = 0;
crm_periph_clock_enable(CRM_CRC_PERIPH_CLOCK, TRUE);
crc_data_reset();
for(i_index = 0; i_index < wlen; i_index ++)
{
value = *paddr;
@@ -175,7 +175,7 @@ uint32_t crc_cal(uint32_t addr, uint16_t nk)
/**
* @brief iap init
* @param none
* @retval none
* @retval none
*/
void iap_init(void)
{
@@ -188,13 +188,13 @@ void iap_init(void)
{
iap_info.sector_size = SECTOR_SIZE_2K;
}
iap_info.flash_start_address = FLASH_BASE;
iap_info.flash_end_address = iap_info.flash_start_address + iap_info.flash_size;
iap_info.app_address = FLASH_APP_ADDRESS;
iap_info.flag_address = iap_info.app_address - iap_info.sector_size;
iap_info.fifo_length = 0;
iap_info.iap_address = 0;
}
@@ -202,7 +202,7 @@ void iap_init(void)
/**
* @brief iap idle function
* @param none
* @retval none
* @retval none
*/
void iap_idle(void)
{
@@ -214,7 +214,7 @@ void iap_idle(void)
/**
* @brief iap start function
* @param none
* @retval none
* @retval none
*/
void iap_start(void)
{
@@ -227,7 +227,7 @@ void iap_start(void)
* @brief iap parse address
* @param pdata: data buffer pointer.
* @param len: data length
* @retval the result of the address parse
* @retval the result of the address parse
*/
iap_result_type iap_address(uint8_t *pdata, uint32_t len)
{
@@ -235,12 +235,12 @@ iap_result_type iap_address(uint8_t *pdata, uint32_t len)
uint16_t result = IAP_ACK;
uint8_t *paddr = pdata + 2; /* skip iap cmd */
uint32_t address;
address = (paddr[0] << 24) |
(paddr[1] << 16) |
(paddr[2] << 8) |
address = (paddr[0] << 24) |
(paddr[1] << 16) |
(paddr[2] << 8) |
paddr[3];
/* check the address is valid */
if(address < iap_info.app_address || address > iap_info.flash_end_address)
{
@@ -250,25 +250,25 @@ iap_result_type iap_address(uint8_t *pdata, uint32_t len)
else
{
iap_info.iap_address = address;
if(iap_info.state == IAP_STS_START)
{
iap_clear_upgrade_flag();
}
iap_erase_sector(iap_info.iap_address);
}
iap_info.state = IAP_STS_ADDR;
iap_respond(iap_info.iap_tx, IAP_CMD_ADDR, result);
return status;
}
/*
* @brief iap data write
* @param pdata: data buffer pointer.
* @param len: buffer length
* @retval the result of the address parse
* @retval the result of the address parse
*/
iap_result_type iap_data_write(uint8_t *pdata, uint32_t len)
{
@@ -276,7 +276,7 @@ iap_result_type iap_data_write(uint8_t *pdata, uint32_t len)
uint8_t *valid_data = pdata + 4;
uint32_t *pbuf;
uint32_t i_index = 0;
if(iap_info.state == IAP_STS_ADDR)
{
if(data_len + iap_info.fifo_length <= HID_IAP_BUFFER_LEN)
@@ -297,15 +297,15 @@ iap_result_type iap_data_write(uint8_t *pdata, uint32_t len)
iap_info.iap_address += 4;
}
flash_lock();
iap_info.fifo_length = 0;
iap_info.iap_address = 0;
iap_respond(iap_info.iap_tx, IAP_CMD_DATA, IAP_ACK);
iap_respond(iap_info.iap_tx, IAP_CMD_DATA, IAP_ACK);
}
}
else
{
iap_respond(iap_info.iap_tx, IAP_CMD_ADDR, IAP_NACK);
iap_respond(iap_info.iap_tx, IAP_CMD_ADDR, IAP_NACK);
}
return IAP_SUCCESS;
}
@@ -313,63 +313,63 @@ iap_result_type iap_data_write(uint8_t *pdata, uint32_t len)
/*
* @brief iap finish
* @param none
* @retval none
* @retval none
*/
void iap_finish()
{
iap_info.state = IAP_STS_FINISH;
iap_set_upgrade_flag();
iap_respond(iap_info.iap_tx, IAP_CMD_FINISH, IAP_ACK);
iap_respond(iap_info.iap_tx, IAP_CMD_FINISH, IAP_ACK);
}
/*
* @brief iap crc
* @param pdata: data buffer pointer.
* @param len: buffer length
* @retval the result of the address parse
* @retval the result of the address parse
*/
void iap_crc(uint8_t *pdata, uint32_t len)
{
uint8_t *paddr = pdata + 2; /* skip iap cmd */
uint16_t crc_nk;
uint32_t crc_value;
uint32_t address = (paddr[0] << 24) |
(paddr[1] << 16) |
(paddr[2] << 8) |
uint32_t address = (paddr[0] << 24) |
(paddr[1] << 16) |
(paddr[2] << 8) |
paddr[3];
paddr = pdata + 6;
crc_nk = (paddr[0] << 16) | paddr[1];
crc_value = crc_cal(address, crc_nk);
iap_respond(iap_info.iap_tx, IAP_CMD_CRC, IAP_ACK);
iap_respond(iap_info.iap_tx, IAP_CMD_CRC, IAP_ACK);
iap_info.iap_tx[4] = (uint8_t)((crc_value >> 24) & 0xFF);
iap_info.iap_tx[5] = (uint8_t)((crc_value >> 16) & 0xFF);
iap_info.iap_tx[6] = (uint8_t)((crc_value >> 8) & 0xFF);
iap_info.iap_tx[7] = (uint8_t)((crc_value) & 0xFF);
}
/*
* @brief iap jump
* @param none
* @retval none
* @retval none
*/
void iap_jump()
{
iap_info.state = IAP_STS_JMP_WAIT;
iap_respond(iap_info.iap_tx, IAP_CMD_JMP, IAP_ACK);
iap_respond(iap_info.iap_tx, IAP_CMD_JMP, IAP_ACK);
}
/*
* @brief iap get
* @param none
* @retval none
* @retval none
*/
void iap_get()
{
iap_respond(iap_info.iap_tx, IAP_CMD_GET, IAP_ACK);
iap_respond(iap_info.iap_tx, IAP_CMD_GET, IAP_ACK);
iap_info.iap_tx[4] = (uint8_t)((iap_info.app_address >> 24) & 0xFF);
iap_info.iap_tx[5] = (uint8_t)((iap_info.app_address >> 16) & 0xFF);
iap_info.iap_tx[6] = (uint8_t)((iap_info.app_address >> 8) & 0xFF);
@@ -383,7 +383,7 @@ void iap_get()
* @param res_buf: data buffer pointer.
* @param iap_cmd: iap command
* @param result: iap result
* @retval the result of the address parse
* @retval the result of the address parse
*/
void iap_respond(uint8_t *res_buf, uint16_t iap_cmd, uint16_t result)
{
@@ -391,7 +391,7 @@ void iap_respond(uint8_t *res_buf, uint16_t iap_cmd, uint16_t result)
res_buf[1] = (uint8_t)((iap_cmd) & 0xFF);
res_buf[2] = (uint8_t)((result >> 8) & 0xFF);
res_buf[3] = (uint8_t)((result) & 0xFF);
iap_info.respond_flag = 1;
}
@@ -400,22 +400,22 @@ void iap_respond(uint8_t *res_buf, uint16_t iap_cmd, uint16_t result)
* @param udev: to the structure of usbd_core_type
* @param pdata: data buffer point
* @param len: data length
* @retval iap_result_type
* @retval iap_result_type
*/
iap_result_type usbd_hid_iap_process(void *udev, uint8_t *pdata, uint16_t len)
{
iap_result_type status = IAP_SUCCESS;
uint16_t iap_cmd;
if(len < 2)
{
return IAP_FAILED;
}
iap_info.respond_flag = 0;
iap_cmd = (pdata[0] << 8) | pdata[1];
switch(iap_cmd)
{
case IAP_CMD_IDLE:
@@ -444,21 +444,21 @@ iap_result_type usbd_hid_iap_process(void *udev, uint8_t *pdata, uint16_t len)
break;
default:
status = IAP_FAILED;
break;
break;
}
if(iap_info.respond_flag)
{
usb_iap_class_send_report(udev, iap_info.iap_tx, 64);
}
return status;
}
/**
* @brief usb device in transfer complete function
* @param udev: to the structure of usbd_core_type
* @retval none
* @retval none
*/
void usbd_hid_iap_in_complete(void *udev)
{
@@ -471,7 +471,7 @@ void usbd_hid_iap_in_complete(void *udev)
/**
* @brief iap loop
* @param none
* @retval none
* @retval none
*/
void iap_loop(void)
{
@@ -483,8 +483,8 @@ void iap_loop(void)
/**
* @}
*/
*/
/**
* @}
*/
*/

View File

@@ -1,8 +1,8 @@
/**
**************************************************************************
* @file main.c
* @version v2.0.3
* @date 2022-02-11
* @version v2.0.4
* @date 2022-04-02
* @brief main program
**************************************************************************
* Copyright notice & Disclaimer