update version to v2.0.7

This commit is contained in:
Artery-MCU
2022-08-26 14:42:38 +08:00
parent 98a0ee73ef
commit caea1e6d25
1061 changed files with 10587 additions and 7355 deletions

View File

@@ -1,8 +1,8 @@
/** /**
************************************************************************** **************************************************************************
* @file at32f413.h * @file at32f413.h
* @version v2.0.6 * @version v2.0.7
* @date 2022-06-28 * @date 2022-08-16
* @brief at32f413 header file * @brief at32f413 header file
************************************************************************** **************************************************************************
* Copyright notice & Disclaimer * Copyright notice & Disclaimer
@@ -87,7 +87,7 @@ extern "C" {
*/ */
#define __AT32F413_LIBRARY_VERSION_MAJOR (0x02) /*!< [31:24] major version */ #define __AT32F413_LIBRARY_VERSION_MAJOR (0x02) /*!< [31:24] major version */
#define __AT32F413_LIBRARY_VERSION_MIDDLE (0x00) /*!< [23:16] middle version */ #define __AT32F413_LIBRARY_VERSION_MIDDLE (0x00) /*!< [23:16] middle version */
#define __AT32F413_LIBRARY_VERSION_MINOR (0x06) /*!< [15:8] minor version */ #define __AT32F413_LIBRARY_VERSION_MINOR (0x07) /*!< [15:8] minor version */
#define __AT32F413_LIBRARY_VERSION_RC (0x00) /*!< [7:0] release candidate */ #define __AT32F413_LIBRARY_VERSION_RC (0x00) /*!< [7:0] release candidate */
#define __AT32F413_LIBRARY_VERSION ((__AT32F413_LIBRARY_VERSION_MAJOR << 24) | \ #define __AT32F413_LIBRARY_VERSION ((__AT32F413_LIBRARY_VERSION_MAJOR << 24) | \
(__AT32F413_LIBRARY_VERSION_MIDDLE << 16) | \ (__AT32F413_LIBRARY_VERSION_MIDDLE << 16) | \

View File

@@ -1,8 +1,8 @@
/** /**
************************************************************************** **************************************************************************
* @file at32f413_conf.h * @file at32f413_conf.h
* @version v2.0.6 * @version v2.0.7
* @date 2022-06-28 * @date 2022-08-16
* @brief at32f413 config header file * @brief at32f413 config header file
************************************************************************** **************************************************************************
* Copyright notice & Disclaimer * Copyright notice & Disclaimer

View File

@@ -1,8 +1,8 @@
/** /**
****************************************************************************** ******************************************************************************
* @file startup_at32f413.s * @file startup_at32f413.s
* @version v2.0.6 * @version v2.0.7
* @date 2022-06-28 * @date 2022-08-16
* @brief at32f413xx devices vector table for gcc toolchain. * @brief at32f413xx devices vector table for gcc toolchain.
* this module performs: * this module performs:
* - set the initial sp * - set the initial sp

View File

@@ -1,7 +1,7 @@
;************************************************************************** ;**************************************************************************
;* @file startup_at32f413.s ;* @file startup_at32f413.s
;* @version v2.0.6 ;* @version v2.0.7
;* @date 2022-06-28 ;* @date 2022-08-16
;* @brief at32f413 startup file for IAR Systems ;* @brief at32f413 startup file for IAR Systems
;************************************************************************** ;**************************************************************************
; ;

View File

@@ -1,8 +1,9 @@
;************************************************************************** ;**************************************************************************
;* @file startup_at32f403a_407.s ;* @file startup_at32f403a_407.s
;* @version v2.0.6 ;* @version v2.0.7
;* @date 2022-06-28 ;* @date 2022-08-16
;* @brief at32f403a_407 startup file for keil ;* @brief at32f403a_407 startup file for keil
;* <<< Use Configuration Wizard in Context Menu >>>
;************************************************************************** ;**************************************************************************
; ;

View File

@@ -1,8 +1,8 @@
/** /**
************************************************************************** **************************************************************************
* @file system_at32f413.c * @file system_at32f413.c
* @version v2.0.6 * @version v2.0.7
* @date 2022-06-28 * @date 2022-08-16
* @brief contains all the functions for cmsis cortex-m4 system source file * @brief contains all the functions for cmsis cortex-m4 system source file
************************************************************************** **************************************************************************
* Copyright notice & Disclaimer * Copyright notice & Disclaimer

View File

@@ -1,8 +1,8 @@
/** /**
************************************************************************** **************************************************************************
* @file system_at32f413.h * @file system_at32f413.h
* @version v2.0.6 * @version v2.0.7
* @date 2022-06-28 * @date 2022-08-16
* @brief cmsis cortex-m4 system header file. * @brief cmsis cortex-m4 system header file.
************************************************************************** **************************************************************************
* Copyright notice & Disclaimer * Copyright notice & Disclaimer

View File

@@ -1,7 +1,7 @@
/****************************************************************************** /******************************************************************************
* @file arm_sorting.h * @file arm_sorting.h
* @version v2.0.6 * @version v2.0.7
* @date 2022-06-28 * @date 2022-08-16
* @brief Private header file for CMSIS DSP Library * @brief Private header file for CMSIS DSP Library
******************************************************************************/ ******************************************************************************/
/* /*

View File

@@ -1,7 +1,7 @@
/****************************************************************************** /******************************************************************************
* @file arm_vec_fft.h * @file arm_vec_fft.h
* @version v2.0.6 * @version v2.0.7
* @date 2022-06-28 * @date 2022-08-16
* @brief Private header file for CMSIS DSP Library * @brief Private header file for CMSIS DSP Library
******************************************************************************/ ******************************************************************************/
/* /*

View File

@@ -1,7 +1,7 @@
/****************************************************************************** /******************************************************************************
* @file arm_vec_filtering.h * @file arm_vec_filtering.h
* @version v2.0.6 * @version v2.0.7
* @date 2022-06-28 * @date 2022-08-16
* @brief Private header file for CMSIS DSP Library * @brief Private header file for CMSIS DSP Library
******************************************************************************/ ******************************************************************************/
/* /*

View File

@@ -1,7 +1,7 @@
/****************************************************************************** /******************************************************************************
* @file arm_math.h * @file arm_math.h
* @version v2.0.6 * @version v2.0.7
* @date 2022-06-28 * @date 2022-08-16
* @brief Public header file for CMSIS DSP Library * @brief Public header file for CMSIS DSP Library
******************************************************************************/ ******************************************************************************/
/* /*

View File

@@ -1,7 +1,7 @@
/****************************************************************************** /******************************************************************************
* @file arm_vec_math.h * @file arm_vec_math.h
* @version v2.0.6 * @version v2.0.7
* @date 2022-06-28 * @date 2022-08-16
* @brief Public header file for CMSIS DSP Library * @brief Public header file for CMSIS DSP Library
******************************************************************************/ ******************************************************************************/
/* /*

View File

@@ -1,8 +1,8 @@
/** /**
************************************************************************** **************************************************************************
* @file at32f413_acc.h * @file at32f413_acc.h
* @version v2.0.6 * @version v2.0.7
* @date 2022-06-28 * @date 2022-08-16
* @brief at32f413 acc header file * @brief at32f413 acc header file
************************************************************************** **************************************************************************
* Copyright notice & Disclaimer * Copyright notice & Disclaimer

View File

@@ -1,8 +1,8 @@
/** /**
************************************************************************** **************************************************************************
* @file at32f413_adc.h * @file at32f413_adc.h
* @version v2.0.6 * @version v2.0.7
* @date 2022-06-28 * @date 2022-08-16
* @brief at32f413 adc header file * @brief at32f413 adc header file
************************************************************************** **************************************************************************
* Copyright notice & Disclaimer * Copyright notice & Disclaimer

View File

@@ -1,8 +1,8 @@
/** /**
************************************************************************** **************************************************************************
* @file at32f413_bpr.h * @file at32f413_bpr.h
* @version v2.0.6 * @version v2.0.7
* @date 2022-06-28 * @date 2022-08-16
* @brief at32f413 bpr header file * @brief at32f413 bpr header file
************************************************************************** **************************************************************************
* Copyright notice & Disclaimer * Copyright notice & Disclaimer

View File

@@ -1,8 +1,8 @@
/** /**
************************************************************************** **************************************************************************
* @file at32f413_can.h * @file at32f413_can.h
* @version v2.0.6 * @version v2.0.7
* @date 2022-06-28 * @date 2022-08-16
* @brief at32f413 can header file * @brief at32f413 can header file
************************************************************************** **************************************************************************
* Copyright notice & Disclaimer * Copyright notice & Disclaimer

View File

@@ -1,8 +1,8 @@
/** /**
************************************************************************** **************************************************************************
* @file at32f413_crc.h * @file at32f413_crc.h
* @version v2.0.6 * @version v2.0.7
* @date 2022-06-28 * @date 2022-08-16
* @brief at32f413 crc header file * @brief at32f413 crc header file
************************************************************************** **************************************************************************
* Copyright notice & Disclaimer * Copyright notice & Disclaimer
@@ -148,7 +148,7 @@ uint32_t crc_one_word_calculate(uint32_t data);
uint32_t crc_block_calculate(uint32_t *pbuffer, uint32_t length); uint32_t crc_block_calculate(uint32_t *pbuffer, uint32_t length);
uint32_t crc_data_get(void); uint32_t crc_data_get(void);
void crc_common_data_set(uint8_t cdt_value); void crc_common_data_set(uint8_t cdt_value);
uint8_t crc_common_date_get(void); uint8_t crc_common_data_get(void);
void crc_init_data_set(uint32_t value); void crc_init_data_set(uint32_t value);
void crc_reverse_input_data_set(crc_reverse_input_type value); void crc_reverse_input_data_set(crc_reverse_input_type value);
void crc_reverse_output_data_set(crc_reverse_output_type value); void crc_reverse_output_data_set(crc_reverse_output_type value);

View File

@@ -1,8 +1,8 @@
/** /**
************************************************************************** **************************************************************************
* @file at32f413_crm.h * @file at32f413_crm.h
* @version v2.0.6 * @version v2.0.7
* @date 2022-06-28 * @date 2022-08-16
* @brief at32f413 crm header file * @brief at32f413 crm header file
************************************************************************** **************************************************************************
* Copyright notice & Disclaimer * Copyright notice & Disclaimer

View File

@@ -1,8 +1,8 @@
/** /**
************************************************************************** **************************************************************************
* @file at32f413_debug.h * @file at32f413_debug.h
* @version v2.0.6 * @version v2.0.7
* @date 2022-06-28 * @date 2022-08-16
* @brief at32f413 debug header file * @brief at32f413 debug header file
************************************************************************** **************************************************************************
* Copyright notice & Disclaimer * Copyright notice & Disclaimer

View File

@@ -1,8 +1,8 @@
/** /**
************************************************************************** **************************************************************************
* @file at32f413_def.h * @file at32f413_def.h
* @version v2.0.6 * @version v2.0.7
* @date 2022-06-28 * @date 2022-08-16
* @brief at32f413 macros header file * @brief at32f413 macros header file
************************************************************************** **************************************************************************
* Copyright notice & Disclaimer * Copyright notice & Disclaimer

View File

@@ -1,8 +1,8 @@
/** /**
************************************************************************** **************************************************************************
* @file at32f413_dma.h * @file at32f413_dma.h
* @version v2.0.6 * @version v2.0.7
* @date 2022-06-28 * @date 2022-08-16
* @brief at32f413 dma header file * @brief at32f413 dma header file
************************************************************************** **************************************************************************
* Copyright notice & Disclaimer * Copyright notice & Disclaimer

View File

@@ -1,8 +1,8 @@
/** /**
************************************************************************** **************************************************************************
* @file at32f413_exint.h * @file at32f413_exint.h
* @version v2.0.6 * @version v2.0.7
* @date 2022-06-28 * @date 2022-08-16
* @brief at32f413 exint header file * @brief at32f413 exint header file
************************************************************************** **************************************************************************
* Copyright notice & Disclaimer * Copyright notice & Disclaimer

View File

@@ -1,8 +1,8 @@
/** /**
************************************************************************** **************************************************************************
* @file at32f413_flash.h * @file at32f413_flash.h
* @version v2.0.6 * @version v2.0.7
* @date 2022-06-28 * @date 2022-08-16
* @brief at32f413 flash header file * @brief at32f413 flash header file
************************************************************************** **************************************************************************
* Copyright notice & Disclaimer * Copyright notice & Disclaimer

View File

@@ -1,8 +1,8 @@
/** /**
************************************************************************** **************************************************************************
* @file at32f413_gpio.h * @file at32f413_gpio.h
* @version v2.0.6 * @version v2.0.7
* @date 2022-06-28 * @date 2022-08-16
* @brief at32f413 gpio header file * @brief at32f413 gpio header file
************************************************************************** **************************************************************************
* Copyright notice & Disclaimer * Copyright notice & Disclaimer

View File

@@ -1,8 +1,8 @@
/** /**
************************************************************************** **************************************************************************
* @file at32f413_i2c.h * @file at32f413_i2c.h
* @version v2.0.6 * @version v2.0.7
* @date 2022-06-28 * @date 2022-08-16
* @brief at32f413 i2c header file * @brief at32f413 i2c header file
************************************************************************** **************************************************************************
* Copyright notice & Disclaimer * Copyright notice & Disclaimer

View File

@@ -1,8 +1,8 @@
/** /**
************************************************************************** **************************************************************************
* @file at32f413_misc.h * @file at32f413_misc.h
* @version v2.0.6 * @version v2.0.7
* @date 2022-06-28 * @date 2022-08-16
* @brief at32f413 misc header file * @brief at32f413 misc header file
************************************************************************** **************************************************************************
* Copyright notice & Disclaimer * Copyright notice & Disclaimer

View File

@@ -1,8 +1,8 @@
/** /**
************************************************************************** **************************************************************************
* @file at32f413_pwc.h * @file at32f413_pwc.h
* @version v2.0.6 * @version v2.0.7
* @date 2022-06-28 * @date 2022-08-16
* @brief at32f413 pwc header file * @brief at32f413 pwc header file
************************************************************************** **************************************************************************
* Copyright notice & Disclaimer * Copyright notice & Disclaimer

View File

@@ -1,8 +1,8 @@
/** /**
************************************************************************** **************************************************************************
* @file at32f413_rtc.h * @file at32f413_rtc.h
* @version v2.0.6 * @version v2.0.7
* @date 2022-06-28 * @date 2022-08-16
* @brief at32f413 rtc header file * @brief at32f413 rtc header file
************************************************************************** **************************************************************************
* Copyright notice & Disclaimer * Copyright notice & Disclaimer

View File

@@ -1,8 +1,8 @@
/** /**
************************************************************************** **************************************************************************
* @file at32f413_sdio.h * @file at32f413_sdio.h
* @version v2.0.6 * @version v2.0.7
* @date 2022-06-28 * @date 2022-08-16
* @brief at32f413 sdio header file * @brief at32f413 sdio header file
************************************************************************** **************************************************************************
* Copyright notice & Disclaimer * Copyright notice & Disclaimer

View File

@@ -1,8 +1,8 @@
/** /**
************************************************************************** **************************************************************************
* @file at32f413_spi.h * @file at32f413_spi.h
* @version v2.0.6 * @version v2.0.7
* @date 2022-06-28 * @date 2022-08-16
* @brief at32f413 spi header file * @brief at32f413 spi header file
************************************************************************** **************************************************************************
* Copyright notice & Disclaimer * Copyright notice & Disclaimer

View File

@@ -1,8 +1,8 @@
/** /**
************************************************************************** **************************************************************************
* @file at32f413_tmr.h * @file at32f413_tmr.h
* @version v2.0.6 * @version v2.0.7
* @date 2022-06-28 * @date 2022-08-16
* @brief at32f413 tmr header file * @brief at32f413 tmr header file
************************************************************************** **************************************************************************
* Copyright notice & Disclaimer * Copyright notice & Disclaimer

View File

@@ -1,8 +1,8 @@
/** /**
************************************************************************** **************************************************************************
* @file at32f413_usart.h * @file at32f413_usart.h
* @version v2.0.6 * @version v2.0.7
* @date 2022-06-28 * @date 2022-08-16
* @brief at32f413 usart header file * @brief at32f413 usart header file
************************************************************************** **************************************************************************
* Copyright notice & Disclaimer * Copyright notice & Disclaimer

View File

@@ -1,8 +1,8 @@
/** /**
************************************************************************** **************************************************************************
* @file at32f413_usb.h * @file at32f413_usb.h
* @version v2.0.6 * @version v2.0.7
* @date 2022-06-28 * @date 2022-08-16
* @brief at32f413 usb header file * @brief at32f413 usb header file
************************************************************************** **************************************************************************
* Copyright notice & Disclaimer * Copyright notice & Disclaimer

View File

@@ -1,8 +1,8 @@
/** /**
************************************************************************** **************************************************************************
* @file at32f413_wdt.h * @file at32f413_wdt.h
* @version v2.0.6 * @version v2.0.7
* @date 2022-06-28 * @date 2022-08-16
* @brief at32f413 wdt header file * @brief at32f413 wdt header file
************************************************************************** **************************************************************************
* Copyright notice & Disclaimer * Copyright notice & Disclaimer

View File

@@ -1,8 +1,8 @@
/** /**
************************************************************************** **************************************************************************
* @file at32f413_wwdt.h * @file at32f413_wwdt.h
* @version v2.0.6 * @version v2.0.7
* @date 2022-06-28 * @date 2022-08-16
* @brief at32f413 wwdt header file * @brief at32f413 wwdt header file
************************************************************************** **************************************************************************
* Copyright notice & Disclaimer * Copyright notice & Disclaimer

View File

@@ -1,8 +1,8 @@
/** /**
************************************************************************** **************************************************************************
* @file at32f413_acc.c * @file at32f413_acc.c
* @version v2.0.6 * @version v2.0.7
* @date 2022-06-28 * @date 2022-08-16
* @brief contains all the functions for the acc firmware library * @brief contains all the functions for the acc firmware library
************************************************************************** **************************************************************************
* Copyright notice & Disclaimer * Copyright notice & Disclaimer

View File

@@ -1,8 +1,8 @@
/** /**
************************************************************************** **************************************************************************
* @file at32f413_adc.c * @file at32f413_adc.c
* @version v2.0.6 * @version v2.0.7
* @date 2022-06-28 * @date 2022-08-16
* @brief contains all the functions for the adc firmware library * @brief contains all the functions for the adc firmware library
************************************************************************** **************************************************************************
* Copyright notice & Disclaimer * Copyright notice & Disclaimer

View File

@@ -1,8 +1,8 @@
/** /**
************************************************************************** **************************************************************************
* @file at32f413_bpr.c * @file at32f413_bpr.c
* @version v2.0.6 * @version v2.0.7
* @date 2022-06-28 * @date 2022-08-16
* @brief contains all the functions for the bpr firmware library * @brief contains all the functions for the bpr firmware library
************************************************************************** **************************************************************************
* Copyright notice & Disclaimer * Copyright notice & Disclaimer

View File

@@ -1,8 +1,8 @@
/** /**
************************************************************************** **************************************************************************
* @file at32f413_can.c * @file at32f413_can.c
* @version v2.0.6 * @version v2.0.7
* @date 2022-06-28 * @date 2022-08-16
* @brief contains all the functions for the can firmware library * @brief contains all the functions for the can firmware library
************************************************************************** **************************************************************************
* Copyright notice & Disclaimer * Copyright notice & Disclaimer

View File

@@ -1,8 +1,8 @@
/** /**
************************************************************************** **************************************************************************
* @file at32f413_crc.c * @file at32f413_crc.c
* @version v2.0.6 * @version v2.0.7
* @date 2022-06-28 * @date 2022-08-16
* @brief contains all the functions for the crc firmware library * @brief contains all the functions for the crc firmware library
************************************************************************** **************************************************************************
* Copyright notice & Disclaimer * Copyright notice & Disclaimer
@@ -106,7 +106,7 @@ void crc_common_data_set(uint8_t cdt_value)
* @param none * @param none
* @retval 8-bit value of the common data register * @retval 8-bit value of the common data register
*/ */
uint8_t crc_common_date_get(void) uint8_t crc_common_data_get(void)
{ {
return (CRC->cdt_bit.cdt); return (CRC->cdt_bit.cdt);
} }

View File

@@ -1,8 +1,8 @@
/** /**
************************************************************************** **************************************************************************
* @file at32f413_crm.c * @file at32f413_crm.c
* @version v2.0.6 * @version v2.0.7
* @date 2022-06-28 * @date 2022-08-16
* @brief contains all the functions for the crm firmware library * @brief contains all the functions for the crm firmware library
************************************************************************** **************************************************************************
* Copyright notice & Disclaimer * Copyright notice & Disclaimer

View File

@@ -1,8 +1,8 @@
/** /**
************************************************************************** **************************************************************************
* @file at32f413_debug.c * @file at32f413_debug.c
* @version v2.0.6 * @version v2.0.7
* @date 2022-06-28 * @date 2022-08-16
* @brief contains all the functions for the debug firmware library * @brief contains all the functions for the debug firmware library
************************************************************************** **************************************************************************
* Copyright notice & Disclaimer * Copyright notice & Disclaimer

View File

@@ -1,8 +1,8 @@
/** /**
************************************************************************** **************************************************************************
* @file at32f413_dma.c * @file at32f413_dma.c
* @version v2.0.6 * @version v2.0.7
* @date 2022-06-28 * @date 2022-08-16
* @brief contains all the functions for the dma firmware library * @brief contains all the functions for the dma firmware library
************************************************************************** **************************************************************************
* Copyright notice & Disclaimer * Copyright notice & Disclaimer

View File

@@ -1,8 +1,8 @@
/** /**
************************************************************************** **************************************************************************
* @file at32f413_exint.c * @file at32f413_exint.c
* @version v2.0.6 * @version v2.0.7
* @date 2022-06-28 * @date 2022-08-16
* @brief contains all the functions for the exint firmware library * @brief contains all the functions for the exint firmware library
************************************************************************** **************************************************************************
* Copyright notice & Disclaimer * Copyright notice & Disclaimer

View File

@@ -1,8 +1,8 @@
/** /**
************************************************************************** **************************************************************************
* @file at32f413_flash.c * @file at32f413_flash.c
* @version v2.0.6 * @version v2.0.7
* @date 2022-06-28 * @date 2022-08-16
* @brief contains all the functions for the flash firmware library * @brief contains all the functions for the flash firmware library
************************************************************************** **************************************************************************
* Copyright notice & Disclaimer * Copyright notice & Disclaimer

View File

@@ -1,8 +1,8 @@
/** /**
************************************************************************** **************************************************************************
* @file at32f413_gpio.c * @file at32f413_gpio.c
* @version v2.0.6 * @version v2.0.7
* @date 2022-06-28 * @date 2022-08-16
* @brief contains all the functions for the gpio firmware library * @brief contains all the functions for the gpio firmware library
************************************************************************** **************************************************************************
* Copyright notice & Disclaimer * Copyright notice & Disclaimer

View File

@@ -1,8 +1,8 @@
/** /**
************************************************************************** **************************************************************************
* @file at32f413_i2c.c * @file at32f413_i2c.c
* @version v2.0.6 * @version v2.0.7
* @date 2022-06-28 * @date 2022-08-16
* @brief contains all the functions for the i2c firmware library * @brief contains all the functions for the i2c firmware library
************************************************************************** **************************************************************************
* Copyright notice & Disclaimer * Copyright notice & Disclaimer

View File

@@ -1,8 +1,8 @@
/** /**
************************************************************************** **************************************************************************
* @file at32f413_misc.c * @file at32f413_misc.c
* @version v2.0.6 * @version v2.0.7
* @date 2022-06-28 * @date 2022-08-16
* @brief contains all the functions for the misc firmware library * @brief contains all the functions for the misc firmware library
************************************************************************** **************************************************************************
* Copyright notice & Disclaimer * Copyright notice & Disclaimer

View File

@@ -1,8 +1,8 @@
/** /**
************************************************************************** **************************************************************************
* @file at32f413_pwc.c * @file at32f413_pwc.c
* @version v2.0.6 * @version v2.0.7
* @date 2022-06-28 * @date 2022-08-16
* @brief contains all the functions for the pwc firmware library * @brief contains all the functions for the pwc firmware library
************************************************************************** **************************************************************************
* Copyright notice & Disclaimer * Copyright notice & Disclaimer
@@ -215,7 +215,10 @@ void pwc_standby_mode_enter(void)
#if defined (__CC_ARM) #if defined (__CC_ARM)
__force_stores(); __force_stores();
#endif #endif
__WFI(); while(1)
{
__WFI();
}
} }
/** /**

View File

@@ -1,8 +1,8 @@
/** /**
************************************************************************** **************************************************************************
* @file at32f413_rtc.c * @file at32f413_rtc.c
* @version v2.0.6 * @version v2.0.7
* @date 2022-06-28 * @date 2022-08-16
* @brief contains all the functions for the rtc firmware library * @brief contains all the functions for the rtc firmware library
************************************************************************** **************************************************************************
* Copyright notice & Disclaimer * Copyright notice & Disclaimer

View File

@@ -1,8 +1,8 @@
/** /**
************************************************************************** **************************************************************************
* @file at32f413_sdio.c * @file at32f413_sdio.c
* @version v2.0.6 * @version v2.0.7
* @date 2022-06-28 * @date 2022-08-16
* @brief contains all the functions for the sdio firmware library * @brief contains all the functions for the sdio firmware library
************************************************************************** **************************************************************************
* Copyright notice & Disclaimer * Copyright notice & Disclaimer

View File

@@ -1,8 +1,8 @@
/** /**
************************************************************************** **************************************************************************
* @file at32f413_spi.c * @file at32f413_spi.c
* @version v2.0.6 * @version v2.0.7
* @date 2022-06-28 * @date 2022-08-16
* @brief contains all the functions for the spi firmware library * @brief contains all the functions for the spi firmware library
************************************************************************** **************************************************************************
* Copyright notice & Disclaimer * Copyright notice & Disclaimer

View File

@@ -1,8 +1,8 @@
/** /**
************************************************************************** **************************************************************************
* @file at32f413_tmr.c * @file at32f413_tmr.c
* @version v2.0.6 * @version v2.0.7
* @date 2022-06-28 * @date 2022-08-16
* @brief contains all the functions for the tmr firmware library * @brief contains all the functions for the tmr firmware library
************************************************************************** **************************************************************************
* Copyright notice & Disclaimer * Copyright notice & Disclaimer
@@ -235,11 +235,7 @@ void tmr_cnt_dir_set(tmr_type *tmr_x, tmr_count_mode_type tmr_cnt_dir)
void tmr_repetition_counter_set(tmr_type *tmr_x, uint8_t tmr_rpr_value) void tmr_repetition_counter_set(tmr_type *tmr_x, uint8_t tmr_rpr_value)
{ {
/* set the repetition counter value */ /* set the repetition counter value */
if((tmr_x == TMR1) || (tmr_x == TMR8)) tmr_x->rpr_bit.rpr = tmr_rpr_value;
{
tmr_x->rpr_bit.rpr = tmr_rpr_value;
}
} }
/** /**
@@ -319,23 +315,23 @@ uint32_t tmr_div_value_get(tmr_type *tmr_x)
void tmr_output_channel_config(tmr_type *tmr_x, tmr_channel_select_type tmr_channel, void tmr_output_channel_config(tmr_type *tmr_x, tmr_channel_select_type tmr_channel,
tmr_output_config_type *tmr_output_struct) tmr_output_config_type *tmr_output_struct)
{ {
uint16_t channel_index = 0, channel_c_index = 0, channel = 0; uint16_t channel_index = 0, channel_c_index = 0, channel = 0, chx_offset, chcx_offset;
chx_offset = (8 + tmr_channel);
chcx_offset = (9 + tmr_channel);
/* get channel idle state bit position in ctrl2 register */ /* get channel idle state bit position in ctrl2 register */
channel_index = (uint16_t)(tmr_output_struct->oc_idle_state << (8 + tmr_channel)); channel_index = (uint16_t)(tmr_output_struct->oc_idle_state << chx_offset);
/* get channel complementary idle state bit position in ctrl2 register */ /* get channel complementary idle state bit position in ctrl2 register */
channel_c_index = (uint16_t)(tmr_output_struct->occ_idle_state << (9 + tmr_channel)); channel_c_index = (uint16_t)(tmr_output_struct->occ_idle_state << chcx_offset);
if((tmr_x == TMR1) || (tmr_x == TMR8)) /* set output channel complementary idle state */
{ tmr_x->ctrl2 &= ~(1<<chcx_offset);
/* set output channel complementary idle state */ tmr_x->ctrl2 |= channel_c_index;
tmr_x->ctrl2 &= ~channel_c_index;
tmr_x->ctrl2 |= channel_c_index;
}
/* set output channel idle state */ /* set output channel idle state */
tmr_x->ctrl2 &= ~channel_index; tmr_x->ctrl2 &= ~(1<<chx_offset);
tmr_x->ctrl2 |= channel_index; tmr_x->ctrl2 |= channel_index;
/* set channel output mode */ /* set channel output mode */
@@ -363,38 +359,38 @@ void tmr_output_channel_config(tmr_type *tmr_x, tmr_channel_select_type tmr_chan
break; break;
} }
chx_offset = ((tmr_channel * 2) + 1);
chcx_offset = ((tmr_channel * 2) + 3);
/* get channel polarity bit position in cctrl register */ /* get channel polarity bit position in cctrl register */
channel_index = (uint16_t)(tmr_output_struct->oc_polarity << ((tmr_channel * 2) + 1)); channel_index = (uint16_t)(tmr_output_struct->oc_polarity << chx_offset);
/* get channel complementary polarity bit position in cctrl register */ /* get channel complementary polarity bit position in cctrl register */
channel_c_index = (uint16_t)(tmr_output_struct->occ_polarity << ((tmr_channel * 2) + 3)); channel_c_index = (uint16_t)(tmr_output_struct->occ_polarity << chcx_offset);
if((tmr_x == TMR1) || (tmr_x == TMR8)) /* set output channel complementary polarity */
{ tmr_x->cctrl &= ~(1<<chcx_offset);
/* set output channel complementary polarity */ tmr_x->cctrl |= channel_c_index;
tmr_x->cctrl &= ~channel_c_index;
tmr_x->cctrl |= channel_c_index;
}
/* set output channel polarity */ /* set output channel polarity */
tmr_x->cctrl &= ~channel_index; tmr_x->cctrl &= ~(1<<chx_offset);
tmr_x->cctrl |= channel_index; tmr_x->cctrl |= channel_index;
chx_offset = (tmr_channel * 2);
chcx_offset = ((tmr_channel * 2) + 2);
/* get channel enable bit position in cctrl register */ /* get channel enable bit position in cctrl register */
channel_index = (uint16_t)(tmr_output_struct->oc_output_state << (tmr_channel * 2)); channel_index = (uint16_t)(tmr_output_struct->oc_output_state << (tmr_channel * 2));
/* get channel complementary enable bit position in cctrl register */ /* get channel complementary enable bit position in cctrl register */
channel_c_index = (uint16_t)(tmr_output_struct->occ_output_state << ((tmr_channel * 2) + 2)); channel_c_index = (uint16_t)(tmr_output_struct->occ_output_state << ((tmr_channel * 2) + 2));
if((tmr_x == TMR1) || (tmr_x == TMR8)) /* set output channel complementary enable bit */
{ tmr_x->cctrl &= ~(1<<chcx_offset);
/* set output channel complementary enable bit */ tmr_x->cctrl |= channel_c_index;
tmr_x->cctrl &= ~channel_c_index;
tmr_x->cctrl |= channel_c_index;
}
/* set output channel enable bit */ /* set output channel enable bit */
tmr_x->cctrl &= ~channel_index; tmr_x->cctrl &= ~(1<<chx_offset);
tmr_x->cctrl |= channel_index; tmr_x->cctrl |= channel_index;
} }
@@ -815,6 +811,7 @@ void tmr_input_channel_init(tmr_type *tmr_x, tmr_input_config_type *input_struct
switch(channel) switch(channel)
{ {
case TMR_SELECT_CHANNEL_1: case TMR_SELECT_CHANNEL_1:
tmr_x->cctrl_bit.c1en = FALSE;
tmr_x->cctrl_bit.c1p = (uint32_t)input_struct->input_polarity_select; tmr_x->cctrl_bit.c1p = (uint32_t)input_struct->input_polarity_select;
tmr_x->cctrl_bit.c1cp = (input_struct->input_polarity_select & 0x2) >> 1; tmr_x->cctrl_bit.c1cp = (input_struct->input_polarity_select & 0x2) >> 1;
tmr_x->cm1_input_bit.c1c = input_struct->input_mapped_select; tmr_x->cm1_input_bit.c1c = input_struct->input_mapped_select;
@@ -824,6 +821,7 @@ void tmr_input_channel_init(tmr_type *tmr_x, tmr_input_config_type *input_struct
break; break;
case TMR_SELECT_CHANNEL_2: case TMR_SELECT_CHANNEL_2:
tmr_x->cctrl_bit.c2en = FALSE;
tmr_x->cctrl_bit.c2p = (uint32_t)input_struct->input_polarity_select; tmr_x->cctrl_bit.c2p = (uint32_t)input_struct->input_polarity_select;
tmr_x->cctrl_bit.c2cp = (input_struct->input_polarity_select & 0x2) >> 1; tmr_x->cctrl_bit.c2cp = (input_struct->input_polarity_select & 0x2) >> 1;
tmr_x->cm1_input_bit.c2c = input_struct->input_mapped_select; tmr_x->cm1_input_bit.c2c = input_struct->input_mapped_select;
@@ -833,6 +831,7 @@ void tmr_input_channel_init(tmr_type *tmr_x, tmr_input_config_type *input_struct
break; break;
case TMR_SELECT_CHANNEL_3: case TMR_SELECT_CHANNEL_3:
tmr_x->cctrl_bit.c3en = FALSE;
tmr_x->cctrl_bit.c3p = (uint32_t)input_struct->input_polarity_select; tmr_x->cctrl_bit.c3p = (uint32_t)input_struct->input_polarity_select;
tmr_x->cctrl_bit.c3cp = (input_struct->input_polarity_select & 0x2) >> 1; tmr_x->cctrl_bit.c3cp = (input_struct->input_polarity_select & 0x2) >> 1;
tmr_x->cm2_input_bit.c3c = input_struct->input_mapped_select; tmr_x->cm2_input_bit.c3c = input_struct->input_mapped_select;
@@ -842,6 +841,7 @@ void tmr_input_channel_init(tmr_type *tmr_x, tmr_input_config_type *input_struct
break; break;
case TMR_SELECT_CHANNEL_4: case TMR_SELECT_CHANNEL_4:
tmr_x->cctrl_bit.c4en = FALSE;
tmr_x->cctrl_bit.c4p = (uint32_t)input_struct->input_polarity_select; tmr_x->cctrl_bit.c4p = (uint32_t)input_struct->input_polarity_select;
tmr_x->cm2_input_bit.c4c = input_struct->input_mapped_select; tmr_x->cm2_input_bit.c4c = input_struct->input_mapped_select;
tmr_x->cm2_input_bit.c4df = input_struct->input_filter_value; tmr_x->cm2_input_bit.c4df = input_struct->input_filter_value;

View File

@@ -1,8 +1,8 @@
/** /**
************************************************************************** **************************************************************************
* @file at32f413_usart.c * @file at32f413_usart.c
* @version v2.0.6 * @version v2.0.7
* @date 2022-06-28 * @date 2022-08-16
* @brief contains all the functions for the usart firmware library * @brief contains all the functions for the usart firmware library
************************************************************************** **************************************************************************
* Copyright notice & Disclaimer * Copyright notice & Disclaimer

View File

@@ -1,8 +1,8 @@
/** /**
************************************************************************** **************************************************************************
* @file at32f413_usb.c * @file at32f413_usb.c
* @version v2.0.6 * @version v2.0.7
* @date 2022-06-28 * @date 2022-08-16
* @brief contains the functions for the usb firmware library * @brief contains the functions for the usb firmware library
************************************************************************** **************************************************************************
* Copyright notice & Disclaimer * Copyright notice & Disclaimer

View File

@@ -1,8 +1,8 @@
/** /**
************************************************************************** **************************************************************************
* @file at32f413_wdt.c * @file at32f413_wdt.c
* @version v2.0.6 * @version v2.0.7
* @date 2022-06-28 * @date 2022-08-16
* @brief contains all the functions for the wdt firmware library * @brief contains all the functions for the wdt firmware library
************************************************************************** **************************************************************************
* Copyright notice & Disclaimer * Copyright notice & Disclaimer

View File

@@ -1,8 +1,8 @@
/** /**
************************************************************************** **************************************************************************
* @file at32f413_wwdt.c * @file at32f413_wwdt.c
* @version v2.0.6 * @version v2.0.7
* @date 2022-06-28 * @date 2022-08-16
* @brief contains all the functions for the wwdt firmware library * @brief contains all the functions for the wwdt firmware library
************************************************************************** **************************************************************************
* Copyright notice & Disclaimer * Copyright notice & Disclaimer

View File

@@ -1,8 +1,8 @@
/** /**
************************************************************************** **************************************************************************
* @file i2c_application.c * @file i2c_application.c
* @version v2.0.6 * @version v2.0.7
* @date 2022-06-28 * @date 2022-08-16
* @brief the driver library of the i2c peripheral * @brief the driver library of the i2c peripheral
************************************************************************** **************************************************************************
* Copyright notice & Disclaimer * Copyright notice & Disclaimer
@@ -1306,9 +1306,57 @@ i2c_status_type i2c_slave_transmit_dma(i2c_handle_type* hi2c, uint8_t* pdata, ui
return I2C_OK; return I2C_OK;
} }
/**
* @brief send memory address.
* @param hi2c: the handle points to the operation information.
* @param mem_address_width: memory address width.
* this parameter can be one of the following values:
* - I2C_MEM_ADDR_WIDIH_8: memory address is 8 bit
* - I2C_MEM_ADDR_WIDIH_16: memory address is 16 bit
* @param address: memory device address.
* @param mem_address: memory address.
* @param timeout: maximum waiting time.
* @retval i2c status.
*/
i2c_status_type i2c_memory_address_send(i2c_handle_type* hi2c, i2c_mem_address_width_type mem_address_width, uint16_t mem_address, int32_t timeout)
{
i2c_status_type err_code;
if(mem_address_width == I2C_MEM_ADDR_WIDIH_8)
{
/* send memory address */
i2c_data_send(hi2c->i2cx, mem_address & 0xFF);
}
else
{
/* send memory address */
i2c_data_send(hi2c->i2cx, (mem_address >> 8) & 0xFF);
/* wait for the tdbe flag to be set */
err_code = i2c_wait_flag(hi2c, I2C_TDBE_FLAG, I2C_EVENT_CHECK_ACKFAIL, timeout);
if(err_code != I2C_OK)
{
/* generate stop condtion */
i2c_stop_generate(hi2c->i2cx);
return err_code;
}
/* send memory address */
i2c_data_send(hi2c->i2cx, mem_address & 0xFF);
}
return I2C_OK;
}
/** /**
* @brief write data to the memory device through polling mode. * @brief write data to the memory device through polling mode.
* @param hi2c: the handle points to the operation information. * @param hi2c: the handle points to the operation information.
* @param mem_address_width: memory address width.
* this parameter can be one of the following values:
* - I2C_MEM_ADDR_WIDIH_8: memory address is 8 bit
* - I2C_MEM_ADDR_WIDIH_16: memory address is 16 bit
* @param address: memory device address. * @param address: memory device address.
* @param mem_address: memory address. * @param mem_address: memory address.
* @param pdata: data buffer. * @param pdata: data buffer.
@@ -1316,7 +1364,7 @@ i2c_status_type i2c_slave_transmit_dma(i2c_handle_type* hi2c, uint8_t* pdata, ui
* @param timeout: maximum waiting time. * @param timeout: maximum waiting time.
* @retval i2c status. * @retval i2c status.
*/ */
i2c_status_type i2c_memory_write(i2c_handle_type* hi2c, uint16_t address, uint16_t mem_address, uint8_t* pdata, uint16_t size, uint32_t timeout) i2c_status_type i2c_memory_write(i2c_handle_type* hi2c, i2c_mem_address_width_type mem_address_width, uint16_t address, uint16_t mem_address, uint8_t* pdata, uint16_t size, uint32_t timeout)
{ {
/* initialization parameters */ /* initialization parameters */
hi2c->pbuff = pdata; hi2c->pbuff = pdata;
@@ -1353,9 +1401,12 @@ i2c_status_type i2c_memory_write(i2c_handle_type* hi2c, uint16_t address, uint16
return I2C_ERR_STEP_3; return I2C_ERR_STEP_3;
} }
/* send memory address */ /* send memory address */
i2c_data_send(hi2c->i2cx, mem_address); if(i2c_memory_address_send(hi2c, mem_address_width, mem_address, timeout) != I2C_OK)
{
return I2C_ERR_STEP_4;
}
while(size > 0) while(size > 0)
{ {
@@ -1365,7 +1416,7 @@ i2c_status_type i2c_memory_write(i2c_handle_type* hi2c, uint16_t address, uint16
/* generate stop condtion */ /* generate stop condtion */
i2c_stop_generate(hi2c->i2cx); i2c_stop_generate(hi2c->i2cx);
return I2C_ERR_STEP_4; return I2C_ERR_STEP_5;
} }
/* write data */ /* write data */
@@ -1379,7 +1430,7 @@ i2c_status_type i2c_memory_write(i2c_handle_type* hi2c, uint16_t address, uint16
/* generate stop condtion */ /* generate stop condtion */
i2c_stop_generate(hi2c->i2cx); i2c_stop_generate(hi2c->i2cx);
return I2C_ERR_STEP_5; return I2C_ERR_STEP_6;
} }
/* generate stop condtion */ /* generate stop condtion */
@@ -1391,6 +1442,10 @@ i2c_status_type i2c_memory_write(i2c_handle_type* hi2c, uint16_t address, uint16
/** /**
* @brief read data from memory device through polling mode. * @brief read data from memory device through polling mode.
* @param hi2c: the handle points to the operation information. * @param hi2c: the handle points to the operation information.
* @param mem_address_width: memory address width.
* this parameter can be one of the following values:
* - I2C_MEM_ADDR_WIDIH_8: memory address is 8 bit
* - I2C_MEM_ADDR_WIDIH_16: memory address is 16 bit
* @param address: memory device address. * @param address: memory device address.
* @param mem_address: memory address. * @param mem_address: memory address.
* @param pdata: data buffer. * @param pdata: data buffer.
@@ -1398,7 +1453,7 @@ i2c_status_type i2c_memory_write(i2c_handle_type* hi2c, uint16_t address, uint16
* @param timeout: maximum waiting time. * @param timeout: maximum waiting time.
* @retval i2c status. * @retval i2c status.
*/ */
i2c_status_type i2c_memory_read(i2c_handle_type* hi2c, uint16_t address, uint16_t mem_address, uint8_t* pdata, uint16_t size, uint32_t timeout) i2c_status_type i2c_memory_read(i2c_handle_type* hi2c, i2c_mem_address_width_type mem_address_width, uint16_t address, uint16_t mem_address, uint8_t* pdata, uint16_t size, uint32_t timeout)
{ {
/* initialization parameters */ /* initialization parameters */
hi2c->pbuff = pdata; hi2c->pbuff = pdata;
@@ -1440,7 +1495,10 @@ i2c_status_type i2c_memory_read(i2c_handle_type* hi2c, uint16_t address, uint16_
} }
/* send memory address */ /* send memory address */
i2c_data_send(hi2c->i2cx, mem_address); if(i2c_memory_address_send(hi2c, mem_address_width, mem_address, timeout) != I2C_OK)
{
return I2C_ERR_STEP_4;
}
/* wait for the tdbe flag to be set */ /* wait for the tdbe flag to be set */
if(i2c_wait_flag(hi2c, I2C_TDBE_FLAG, I2C_EVENT_CHECK_ACKFAIL, timeout) != I2C_OK) if(i2c_wait_flag(hi2c, I2C_TDBE_FLAG, I2C_EVENT_CHECK_ACKFAIL, timeout) != I2C_OK)
@@ -1448,7 +1506,7 @@ i2c_status_type i2c_memory_read(i2c_handle_type* hi2c, uint16_t address, uint16_
/* generate stop condtion */ /* generate stop condtion */
i2c_stop_generate(hi2c->i2cx); i2c_stop_generate(hi2c->i2cx);
return I2C_ERR_STEP_4; return I2C_ERR_STEP_5;
} }
/* send slave address */ /* send slave address */
@@ -1457,7 +1515,7 @@ i2c_status_type i2c_memory_read(i2c_handle_type* hi2c, uint16_t address, uint16_
/* generate stop condtion */ /* generate stop condtion */
i2c_stop_generate(hi2c->i2cx); i2c_stop_generate(hi2c->i2cx);
return I2C_ERR_STEP_5; return I2C_ERR_STEP_6;
} }
if(size == 1) if(size == 1)
@@ -1504,7 +1562,7 @@ i2c_status_type i2c_memory_read(i2c_handle_type* hi2c, uint16_t address, uint16_
/* generate stop condtion */ /* generate stop condtion */
i2c_stop_generate(hi2c->i2cx); i2c_stop_generate(hi2c->i2cx);
return I2C_ERR_STEP_6; return I2C_ERR_STEP_7;
} }
/* read data */ /* read data */
@@ -1520,7 +1578,7 @@ i2c_status_type i2c_memory_read(i2c_handle_type* hi2c, uint16_t address, uint16_
/* generate stop condtion */ /* generate stop condtion */
i2c_stop_generate(hi2c->i2cx); i2c_stop_generate(hi2c->i2cx);
return I2C_ERR_STEP_7; return I2C_ERR_STEP_8;
} }
/* generate stop condtion */ /* generate stop condtion */
@@ -1543,7 +1601,7 @@ i2c_status_type i2c_memory_read(i2c_handle_type* hi2c, uint16_t address, uint16_
/* generate stop condtion */ /* generate stop condtion */
i2c_stop_generate(hi2c->i2cx); i2c_stop_generate(hi2c->i2cx);
return I2C_ERR_STEP_8; return I2C_ERR_STEP_9;
} }
/* disable ack */ /* disable ack */
@@ -1559,7 +1617,7 @@ i2c_status_type i2c_memory_read(i2c_handle_type* hi2c, uint16_t address, uint16_
/* generate stop condtion */ /* generate stop condtion */
i2c_stop_generate(hi2c->i2cx); i2c_stop_generate(hi2c->i2cx);
return I2C_ERR_STEP_9; return I2C_ERR_STEP_10;
} }
/* generate stop condtion */ /* generate stop condtion */
@@ -1582,7 +1640,7 @@ i2c_status_type i2c_memory_read(i2c_handle_type* hi2c, uint16_t address, uint16_
/* generate stop condtion */ /* generate stop condtion */
i2c_stop_generate(hi2c->i2cx); i2c_stop_generate(hi2c->i2cx);
return I2C_ERR_STEP_10; return I2C_ERR_STEP_11;
} }
/* read data */ /* read data */
@@ -1597,6 +1655,10 @@ i2c_status_type i2c_memory_read(i2c_handle_type* hi2c, uint16_t address, uint16_
/** /**
* @brief write data to the memory device through interrupt mode. * @brief write data to the memory device through interrupt mode.
* @param hi2c: the handle points to the operation information. * @param hi2c: the handle points to the operation information.
* @param mem_address_width: memory address width.
* this parameter can be one of the following values:
* - I2C_MEM_ADDR_WIDIH_8: memory address is 8 bit
* - I2C_MEM_ADDR_WIDIH_16: memory address is 16 bit
* @param address: memory device address. * @param address: memory device address.
* @param mem_address: memory address. * @param mem_address: memory address.
* @param pdata: data buffer. * @param pdata: data buffer.
@@ -1604,7 +1666,7 @@ i2c_status_type i2c_memory_read(i2c_handle_type* hi2c, uint16_t address, uint16_
* @param timeout: maximum waiting time. * @param timeout: maximum waiting time.
* @retval i2c status. * @retval i2c status.
*/ */
i2c_status_type i2c_memory_write_int(i2c_handle_type* hi2c, uint16_t address, uint16_t mem_address, uint8_t* pdata, uint16_t size, uint32_t timeout) i2c_status_type i2c_memory_write_int(i2c_handle_type* hi2c, i2c_mem_address_width_type mem_address_width, uint16_t address, uint16_t mem_address, uint8_t* pdata, uint16_t size, uint32_t timeout)
{ {
/* initialization parameters */ /* initialization parameters */
hi2c->mode = I2C_INT_MA_TX; hi2c->mode = I2C_INT_MA_TX;
@@ -1647,7 +1709,10 @@ i2c_status_type i2c_memory_write_int(i2c_handle_type* hi2c, uint16_t address, ui
} }
/* send memory address */ /* send memory address */
i2c_data_send(hi2c->i2cx, mem_address); if(i2c_memory_address_send(hi2c, mem_address_width, mem_address, timeout) != I2C_OK)
{
return I2C_ERR_STEP_4;
}
/* wait for the tdbe flag to be set */ /* wait for the tdbe flag to be set */
if(i2c_wait_flag(hi2c, I2C_TDBE_FLAG, I2C_EVENT_CHECK_ACKFAIL, timeout) != I2C_OK) if(i2c_wait_flag(hi2c, I2C_TDBE_FLAG, I2C_EVENT_CHECK_ACKFAIL, timeout) != I2C_OK)
@@ -1655,7 +1720,7 @@ i2c_status_type i2c_memory_write_int(i2c_handle_type* hi2c, uint16_t address, ui
/* generate stop condtion */ /* generate stop condtion */
i2c_stop_generate(hi2c->i2cx); i2c_stop_generate(hi2c->i2cx);
return I2C_ERR_STEP_4; return I2C_ERR_STEP_5;
} }
/* enable interrupt */ /* enable interrupt */
@@ -1667,6 +1732,10 @@ i2c_status_type i2c_memory_write_int(i2c_handle_type* hi2c, uint16_t address, ui
/** /**
* @brief read data from memory device through interrupt mode. * @brief read data from memory device through interrupt mode.
* @param hi2c: the handle points to the operation information. * @param hi2c: the handle points to the operation information.
* @param mem_address_width: memory address width.
* this parameter can be one of the following values:
* - I2C_MEM_ADDR_WIDIH_8: memory address is 8 bit
* - I2C_MEM_ADDR_WIDIH_16: memory address is 16 bit
* @param address: memory device address. * @param address: memory device address.
* @param mem_address: memory address. * @param mem_address: memory address.
* @param pdata: data buffer. * @param pdata: data buffer.
@@ -1674,7 +1743,7 @@ i2c_status_type i2c_memory_write_int(i2c_handle_type* hi2c, uint16_t address, ui
* @param timeout: maximum waiting time. * @param timeout: maximum waiting time.
* @retval i2c status. * @retval i2c status.
*/ */
i2c_status_type i2c_memory_read_int(i2c_handle_type* hi2c, uint16_t address, uint16_t mem_address, uint8_t* pdata, uint16_t size, uint32_t timeout) i2c_status_type i2c_memory_read_int(i2c_handle_type* hi2c, i2c_mem_address_width_type mem_address_width, uint16_t address, uint16_t mem_address, uint8_t* pdata, uint16_t size, uint32_t timeout)
{ {
/* initialization parameters */ /* initialization parameters */
hi2c->mode = I2C_INT_MA_RX; hi2c->mode = I2C_INT_MA_RX;
@@ -1717,7 +1786,10 @@ i2c_status_type i2c_memory_read_int(i2c_handle_type* hi2c, uint16_t address, uin
} }
/* send memory address */ /* send memory address */
i2c_data_send(hi2c->i2cx, mem_address); if(i2c_memory_address_send(hi2c, mem_address_width, mem_address, timeout) != I2C_OK)
{
return I2C_ERR_STEP_4;
}
/* wait for the tdbe flag to be set */ /* wait for the tdbe flag to be set */
if(i2c_wait_flag(hi2c, I2C_TDBE_FLAG, I2C_EVENT_CHECK_ACKFAIL, timeout) != I2C_OK) if(i2c_wait_flag(hi2c, I2C_TDBE_FLAG, I2C_EVENT_CHECK_ACKFAIL, timeout) != I2C_OK)
@@ -1725,7 +1797,7 @@ i2c_status_type i2c_memory_read_int(i2c_handle_type* hi2c, uint16_t address, uin
/* generate stop condtion */ /* generate stop condtion */
i2c_stop_generate(hi2c->i2cx); i2c_stop_generate(hi2c->i2cx);
return I2C_ERR_STEP_4; return I2C_ERR_STEP_5;
} }
/* send slave address */ /* send slave address */
@@ -1734,7 +1806,7 @@ i2c_status_type i2c_memory_read_int(i2c_handle_type* hi2c, uint16_t address, uin
/* generate stop condtion */ /* generate stop condtion */
i2c_stop_generate(hi2c->i2cx); i2c_stop_generate(hi2c->i2cx);
return I2C_ERR_STEP_5; return I2C_ERR_STEP_6;
} }
if(hi2c->pcount == 1) if(hi2c->pcount == 1)
@@ -1777,6 +1849,10 @@ i2c_status_type i2c_memory_read_int(i2c_handle_type* hi2c, uint16_t address, uin
/** /**
* @brief write data to the memory device through dma mode. * @brief write data to the memory device through dma mode.
* @param hi2c: the handle points to the operation information. * @param hi2c: the handle points to the operation information.
* @param mem_address_width: memory address width.
* this parameter can be one of the following values:
* - I2C_MEM_ADDR_WIDIH_8: memory address is 8 bit
* - I2C_MEM_ADDR_WIDIH_16: memory address is 16 bit
* @param address: memory device address. * @param address: memory device address.
* @param mem_address: memory address. * @param mem_address: memory address.
* @param pdata: data buffer. * @param pdata: data buffer.
@@ -1784,7 +1860,7 @@ i2c_status_type i2c_memory_read_int(i2c_handle_type* hi2c, uint16_t address, uin
* @param timeout: maximum waiting time. * @param timeout: maximum waiting time.
* @retval i2c status. * @retval i2c status.
*/ */
i2c_status_type i2c_memory_write_dma(i2c_handle_type* hi2c, uint16_t address, uint16_t mem_address, uint8_t* pdata, uint16_t size, uint32_t timeout) i2c_status_type i2c_memory_write_dma(i2c_handle_type* hi2c, i2c_mem_address_width_type mem_address_width, uint16_t address, uint16_t mem_address, uint8_t* pdata, uint16_t size, uint32_t timeout)
{ {
/* initialization parameters */ /* initialization parameters */
hi2c->mode = I2C_DMA_MA_TX; hi2c->mode = I2C_DMA_MA_TX;
@@ -1833,7 +1909,10 @@ i2c_status_type i2c_memory_write_dma(i2c_handle_type* hi2c, uint16_t address, ui
} }
/* send memory address */ /* send memory address */
i2c_data_send(hi2c->i2cx, mem_address); if(i2c_memory_address_send(hi2c, mem_address_width, mem_address, timeout) != I2C_OK)
{
return I2C_ERR_STEP_4;
}
/* wait for the tdbe flag to be set */ /* wait for the tdbe flag to be set */
if(i2c_wait_flag(hi2c, I2C_TDBE_FLAG, I2C_EVENT_CHECK_ACKFAIL, timeout) != I2C_OK) if(i2c_wait_flag(hi2c, I2C_TDBE_FLAG, I2C_EVENT_CHECK_ACKFAIL, timeout) != I2C_OK)
@@ -1841,7 +1920,7 @@ i2c_status_type i2c_memory_write_dma(i2c_handle_type* hi2c, uint16_t address, ui
/* generate stop condtion */ /* generate stop condtion */
i2c_stop_generate(hi2c->i2cx); i2c_stop_generate(hi2c->i2cx);
return I2C_ERR_STEP_4; return I2C_ERR_STEP_5;
} }
/* enable dma request */ /* enable dma request */
@@ -1853,6 +1932,10 @@ i2c_status_type i2c_memory_write_dma(i2c_handle_type* hi2c, uint16_t address, ui
/** /**
* @brief read data from memory device through polling mode. * @brief read data from memory device through polling mode.
* @param hi2c: the handle points to the operation information. * @param hi2c: the handle points to the operation information.
* @param mem_address_width: memory address width.
* this parameter can be one of the following values:
* - I2C_MEM_ADDR_WIDIH_8: memory address is 8 bit
* - I2C_MEM_ADDR_WIDIH_16: memory address is 16 bit
* @param address: memory device address. * @param address: memory device address.
* @param mem_address: memory address. * @param mem_address: memory address.
* @param pdata: data buffer. * @param pdata: data buffer.
@@ -1860,7 +1943,7 @@ i2c_status_type i2c_memory_write_dma(i2c_handle_type* hi2c, uint16_t address, ui
* @param timeout: maximum waiting time. * @param timeout: maximum waiting time.
* @retval i2c status. * @retval i2c status.
*/ */
i2c_status_type i2c_memory_read_dma(i2c_handle_type* hi2c, uint16_t address, uint16_t mem_address, uint8_t* pdata, uint16_t size, uint32_t timeout) i2c_status_type i2c_memory_read_dma(i2c_handle_type* hi2c, i2c_mem_address_width_type mem_address_width, uint16_t address, uint16_t mem_address, uint8_t* pdata, uint16_t size, uint32_t timeout)
{ {
/* initialization parameters */ /* initialization parameters */
hi2c->mode = I2C_DMA_MA_RX; hi2c->mode = I2C_DMA_MA_RX;
@@ -1912,7 +1995,10 @@ i2c_status_type i2c_memory_read_dma(i2c_handle_type* hi2c, uint16_t address, uin
} }
/* send memory address */ /* send memory address */
i2c_data_send(hi2c->i2cx, mem_address); if(i2c_memory_address_send(hi2c, mem_address_width, mem_address, timeout) != I2C_OK)
{
return I2C_ERR_STEP_4;
}
/* wait for the tdbe flag to be set */ /* wait for the tdbe flag to be set */
if(i2c_wait_flag(hi2c, I2C_TDBE_FLAG, I2C_EVENT_CHECK_ACKFAIL, timeout) != I2C_OK) if(i2c_wait_flag(hi2c, I2C_TDBE_FLAG, I2C_EVENT_CHECK_ACKFAIL, timeout) != I2C_OK)
@@ -1920,7 +2006,7 @@ i2c_status_type i2c_memory_read_dma(i2c_handle_type* hi2c, uint16_t address, uin
/* generate stop condtion */ /* generate stop condtion */
i2c_stop_generate(hi2c->i2cx); i2c_stop_generate(hi2c->i2cx);
return I2C_ERR_STEP_4; return I2C_ERR_STEP_5;
} }
/* send slave address */ /* send slave address */
@@ -1929,7 +2015,7 @@ i2c_status_type i2c_memory_read_dma(i2c_handle_type* hi2c, uint16_t address, uin
/* generate stop condtion */ /* generate stop condtion */
i2c_stop_generate(hi2c->i2cx); i2c_stop_generate(hi2c->i2cx);
return I2C_ERR_STEP_5; return I2C_ERR_STEP_6;
} }
if(size == 1) if(size == 1)

View File

@@ -1,8 +1,8 @@
/** /**
************************************************************************** **************************************************************************
* @file i2c_application.h * @file i2c_application.h
* @version v2.0.6 * @version v2.0.7
* @date 2022-06-28 * @date 2022-08-16
* @brief i2c application libray header file * @brief i2c application libray header file
************************************************************************** **************************************************************************
* Copyright notice & Disclaimer * Copyright notice & Disclaimer
@@ -48,6 +48,20 @@ extern "C" {
#define I2C_EVENT_CHECK_ACKFAIL ((uint32_t)0x00000001) /*!< check flag ackfail */ #define I2C_EVENT_CHECK_ACKFAIL ((uint32_t)0x00000001) /*!< check flag ackfail */
#define I2C_EVENT_CHECK_STOP ((uint32_t)0x00000002) /*!< check flag stop */ #define I2C_EVENT_CHECK_STOP ((uint32_t)0x00000002) /*!< check flag stop */
/**
* @}
*/
/** @defgroup I2C_library_memory_address_width_mode
* @{
*/
typedef enum
{
I2C_MEM_ADDR_WIDIH_8 = 0x01, /*!< memory address is 8 bit */
I2C_MEM_ADDR_WIDIH_16 = 0x02, /*!< memory address is 16 bit */
} i2c_mem_address_width_type;
/** /**
* @} * @}
*/ */
@@ -152,12 +166,12 @@ i2c_status_type i2c_master_receive_dma (i2c_handle_type* hi2c, uint16_t addre
i2c_status_type i2c_slave_transmit_dma (i2c_handle_type* hi2c, uint8_t* pdata, uint16_t size, uint32_t timeout); i2c_status_type i2c_slave_transmit_dma (i2c_handle_type* hi2c, uint8_t* pdata, uint16_t size, uint32_t timeout);
i2c_status_type i2c_slave_receive_dma (i2c_handle_type* hi2c, uint8_t* pdata, uint16_t size, uint32_t timeout); i2c_status_type i2c_slave_receive_dma (i2c_handle_type* hi2c, uint8_t* pdata, uint16_t size, uint32_t timeout);
i2c_status_type i2c_memory_write (i2c_handle_type* hi2c, uint16_t address, uint16_t mem_address, uint8_t* pdata, uint16_t size, uint32_t timeout); i2c_status_type i2c_memory_write (i2c_handle_type* hi2c, i2c_mem_address_width_type mem_address_width, uint16_t address, uint16_t mem_address, uint8_t* pdata, uint16_t size, uint32_t timeout);
i2c_status_type i2c_memory_write_int (i2c_handle_type* hi2c, uint16_t address, uint16_t mem_address, uint8_t* pdata, uint16_t size, uint32_t timeout); i2c_status_type i2c_memory_write_int (i2c_handle_type* hi2c, i2c_mem_address_width_type mem_address_width, uint16_t address, uint16_t mem_address, uint8_t* pdata, uint16_t size, uint32_t timeout);
i2c_status_type i2c_memory_write_dma (i2c_handle_type* hi2c, uint16_t address, uint16_t mem_address, uint8_t* pdata, uint16_t size, uint32_t timeout); i2c_status_type i2c_memory_write_dma (i2c_handle_type* hi2c, i2c_mem_address_width_type mem_address_width, uint16_t address, uint16_t mem_address, uint8_t* pdata, uint16_t size, uint32_t timeout);
i2c_status_type i2c_memory_read (i2c_handle_type* hi2c, uint16_t address, uint16_t mem_address, uint8_t* pdata, uint16_t size, uint32_t timeout); i2c_status_type i2c_memory_read (i2c_handle_type* hi2c, i2c_mem_address_width_type mem_address_width, uint16_t address, uint16_t mem_address, uint8_t* pdata, uint16_t size, uint32_t timeout);
i2c_status_type i2c_memory_read_int (i2c_handle_type* hi2c, uint16_t address, uint16_t mem_address, uint8_t* pdata, uint16_t size, uint32_t timeout); i2c_status_type i2c_memory_read_int (i2c_handle_type* hi2c, i2c_mem_address_width_type mem_address_width, uint16_t address, uint16_t mem_address, uint8_t* pdata, uint16_t size, uint32_t timeout);
i2c_status_type i2c_memory_read_dma (i2c_handle_type* hi2c, uint16_t address, uint16_t mem_address, uint8_t* pdata, uint16_t size, uint32_t timeout); i2c_status_type i2c_memory_read_dma (i2c_handle_type* hi2c, i2c_mem_address_width_type mem_address_width, uint16_t address, uint16_t mem_address, uint8_t* pdata, uint16_t size, uint32_t timeout);
void i2c_evt_irq_handler (i2c_handle_type* hi2c); void i2c_evt_irq_handler (i2c_handle_type* hi2c);
void i2c_err_irq_handler (i2c_handle_type* hi2c); void i2c_err_irq_handler (i2c_handle_type* hi2c);

View File

@@ -1,8 +1,8 @@
/** /**
************************************************************************** **************************************************************************
* @file audio_class.c * @file audio_class.c
* @version v2.0.6 * @version v2.0.7
* @date 2022-06-28 * @date 2022-08-16
* @brief usb audio class type * @brief usb audio class type
************************************************************************** **************************************************************************
* Copyright notice & Disclaimer * Copyright notice & Disclaimer

View File

@@ -1,8 +1,8 @@
/** /**
************************************************************************** **************************************************************************
* @file audio_class.h * @file audio_class.h
* @version v2.0.6 * @version v2.0.7
* @date 2022-06-28 * @date 2022-08-16
* @brief usb audio class file * @brief usb audio class file
************************************************************************** **************************************************************************
* Copyright notice & Disclaimer * Copyright notice & Disclaimer

View File

@@ -1,8 +1,8 @@
/** /**
************************************************************************** **************************************************************************
* @file audio_conf.h * @file audio_conf.h
* @version v2.0.6 * @version v2.0.7
* @date 2022-06-28 * @date 2022-08-16
* @brief usb audio config * @brief usb audio config
************************************************************************** **************************************************************************
* Copyright notice & Disclaimer * Copyright notice & Disclaimer

View File

@@ -1,8 +1,8 @@
/** /**
************************************************************************** **************************************************************************
* @file audio_desc.c * @file audio_desc.c
* @version v2.0.6 * @version v2.0.7
* @date 2022-06-28 * @date 2022-08-16
* @brief usb audio device descriptor * @brief usb audio device descriptor
************************************************************************** **************************************************************************
* Copyright notice & Disclaimer * Copyright notice & Disclaimer

View File

@@ -1,8 +1,8 @@
/** /**
************************************************************************** **************************************************************************
* @file audio_desc.h * @file audio_desc.h
* @version v2.0.6 * @version v2.0.7
* @date 2022-06-28 * @date 2022-08-16
* @brief usb audio descriptor header file * @brief usb audio descriptor header file
************************************************************************** **************************************************************************
* Copyright notice & Disclaimer * Copyright notice & Disclaimer

View File

@@ -1,8 +1,8 @@
/** /**
************************************************************************** **************************************************************************
* @file audio_conf.h * @file audio_conf.h
* @version v2.0.6 * @version v2.0.7
* @date 2022-06-28 * @date 2022-08-16
* @brief usb audio config * @brief usb audio config
************************************************************************** **************************************************************************
* Copyright notice & Disclaimer * Copyright notice & Disclaimer

View File

@@ -1,8 +1,8 @@
/** /**
************************************************************************** **************************************************************************
* @file audio_class.c * @file audio_class.c
* @version v2.0.6 * @version v2.0.7
* @date 2022-06-28 * @date 2022-08-16
* @brief usb audio class type * @brief usb audio class type
************************************************************************** **************************************************************************
* Copyright notice & Disclaimer * Copyright notice & Disclaimer

View File

@@ -1,8 +1,8 @@
/** /**
************************************************************************** **************************************************************************
* @file audio_class.h * @file audio_class.h
* @version v2.0.6 * @version v2.0.7
* @date 2022-06-28 * @date 2022-08-16
* @brief usb audio class file * @brief usb audio class file
************************************************************************** **************************************************************************
* Copyright notice & Disclaimer * Copyright notice & Disclaimer

View File

@@ -1,8 +1,8 @@
/** /**
************************************************************************** **************************************************************************
* @file audio_desc.c * @file audio_desc.c
* @version v2.0.6 * @version v2.0.7
* @date 2022-06-28 * @date 2022-08-16
* @brief usb audio device descriptor * @brief usb audio device descriptor
************************************************************************** **************************************************************************
* Copyright notice & Disclaimer * Copyright notice & Disclaimer

View File

@@ -1,8 +1,8 @@
/** /**
************************************************************************** **************************************************************************
* @file audio_desc.h * @file audio_desc.h
* @version v2.0.6 * @version v2.0.7
* @date 2022-06-28 * @date 2022-08-16
* @brief usb audio descriptor header file * @brief usb audio descriptor header file
************************************************************************** **************************************************************************
* Copyright notice & Disclaimer * Copyright notice & Disclaimer

View File

@@ -1,8 +1,8 @@
/** /**
************************************************************************** **************************************************************************
* @file cdc_class.c * @file cdc_class.c
* @version v2.0.6 * @version v2.0.7
* @date 2022-06-28 * @date 2022-08-16
* @brief usb cdc class type * @brief usb cdc class type
************************************************************************** **************************************************************************
* Copyright notice & Disclaimer * Copyright notice & Disclaimer

View File

@@ -1,8 +1,8 @@
/** /**
************************************************************************** **************************************************************************
* @file cdc_class.h * @file cdc_class.h
* @version v2.0.6 * @version v2.0.7
* @date 2022-06-28 * @date 2022-08-16
* @brief usb cdc class file * @brief usb cdc class file
************************************************************************** **************************************************************************
* Copyright notice & Disclaimer * Copyright notice & Disclaimer

View File

@@ -1,8 +1,8 @@
/** /**
************************************************************************** **************************************************************************
* @file cdc_desc.c * @file cdc_desc.c
* @version v2.0.6 * @version v2.0.7
* @date 2022-06-28 * @date 2022-08-16
* @brief usb cdc device descriptor * @brief usb cdc device descriptor
************************************************************************** **************************************************************************
* Copyright notice & Disclaimer * Copyright notice & Disclaimer

View File

@@ -1,8 +1,8 @@
/** /**
************************************************************************** **************************************************************************
* @file cdc_desc.h * @file cdc_desc.h
* @version v2.0.6 * @version v2.0.7
* @date 2022-06-28 * @date 2022-08-16
* @brief usb cdc descriptor header file * @brief usb cdc descriptor header file
************************************************************************** **************************************************************************
* Copyright notice & Disclaimer * Copyright notice & Disclaimer

View File

@@ -1,8 +1,8 @@
/** /**
************************************************************************** **************************************************************************
* @file cdc_keyboard_class.c * @file cdc_keyboard_class.c
* @version v2.0.6 * @version v2.0.7
* @date 2022-06-28 * @date 2022-08-16
* @brief usb cdc and keyboard class type * @brief usb cdc and keyboard class type
************************************************************************** **************************************************************************
* Copyright notice & Disclaimer * Copyright notice & Disclaimer

View File

@@ -1,8 +1,8 @@
/** /**
************************************************************************** **************************************************************************
* @file cdc_keyboard_class.h * @file cdc_keyboard_class.h
* @version v2.0.6 * @version v2.0.7
* @date 2022-06-28 * @date 2022-08-16
* @brief usb cdc and keyboard class file * @brief usb cdc and keyboard class file
************************************************************************** **************************************************************************
* Copyright notice & Disclaimer * Copyright notice & Disclaimer

View File

@@ -1,8 +1,8 @@
/** /**
************************************************************************** **************************************************************************
* @file cdc_keyboard_desc.c * @file cdc_keyboard_desc.c
* @version v2.0.6 * @version v2.0.7
* @date 2022-06-28 * @date 2022-08-16
* @brief usb cdc and keyboard device descriptor * @brief usb cdc and keyboard device descriptor
************************************************************************** **************************************************************************
* Copyright notice & Disclaimer * Copyright notice & Disclaimer

View File

@@ -1,8 +1,8 @@
/** /**
************************************************************************** **************************************************************************
* @file cdc_keyboard_desc.h * @file cdc_keyboard_desc.h
* @version v2.0.6 * @version v2.0.7
* @date 2022-06-28 * @date 2022-08-16
* @brief usb cdc and keyboard descriptor header file * @brief usb cdc and keyboard descriptor header file
************************************************************************** **************************************************************************
* Copyright notice & Disclaimer * Copyright notice & Disclaimer

View File

@@ -1,8 +1,8 @@
/** /**
************************************************************************** **************************************************************************
* @file cdc_msc_class.c * @file cdc_msc_class.c
* @version v2.0.6 * @version v2.0.7
* @date 2022-06-28 * @date 2022-08-16
* @brief usb cdc class type * @brief usb cdc class type
************************************************************************** **************************************************************************
* Copyright notice & Disclaimer * Copyright notice & Disclaimer

View File

@@ -1,8 +1,8 @@
/** /**
************************************************************************** **************************************************************************
* @file cdc_msc_class.h * @file cdc_msc_class.h
* @version v2.0.6 * @version v2.0.7
* @date 2022-06-28 * @date 2022-08-16
* @brief usb cdc class file * @brief usb cdc class file
************************************************************************** **************************************************************************
* Copyright notice & Disclaimer * Copyright notice & Disclaimer

View File

@@ -1,8 +1,8 @@
/** /**
************************************************************************** **************************************************************************
* @file cdc_msc_desc.c * @file cdc_msc_desc.c
* @version v2.0.6 * @version v2.0.7
* @date 2022-06-28 * @date 2022-08-16
* @brief usb cdc device descriptor * @brief usb cdc device descriptor
************************************************************************** **************************************************************************
* Copyright notice & Disclaimer * Copyright notice & Disclaimer

View File

@@ -1,8 +1,8 @@
/** /**
************************************************************************** **************************************************************************
* @file cdc_msc_desc.h * @file cdc_msc_desc.h
* @version v2.0.6 * @version v2.0.7
* @date 2022-06-28 * @date 2022-08-16
* @brief usb cdc descriptor header file * @brief usb cdc descriptor header file
************************************************************************** **************************************************************************
* Copyright notice & Disclaimer * Copyright notice & Disclaimer

View File

@@ -1,8 +1,8 @@
/** /**
************************************************************************** **************************************************************************
* @file msc_bot_scsi.c * @file msc_bot_scsi.c
* @version v2.0.6 * @version v2.0.7
* @date 2022-06-28 * @date 2022-08-16
* @brief usb mass storage bulk-only transport and scsi command * @brief usb mass storage bulk-only transport and scsi command
************************************************************************** **************************************************************************
* Copyright notice & Disclaimer * Copyright notice & Disclaimer

View File

@@ -1,8 +1,8 @@
/** /**
************************************************************************** **************************************************************************
* @file custom_hid_class.c * @file custom_hid_class.c
* @version v2.0.6 * @version v2.0.7
* @date 2022-06-28 * @date 2022-08-16
* @brief usb custom hid class type * @brief usb custom hid class type
************************************************************************** **************************************************************************
* Copyright notice & Disclaimer * Copyright notice & Disclaimer
@@ -151,6 +151,9 @@ static usb_sts_type class_setup_handler(void *udev, usb_setup_type *setup)
pcshid->hid_state = HID_REQ_SET_REPORT; pcshid->hid_state = HID_REQ_SET_REPORT;
usbd_ctrl_recv(pudev, pcshid->hid_set_report, setup->wLength); usbd_ctrl_recv(pudev, pcshid->hid_set_report, setup->wLength);
break; break;
case HID_REQ_GET_REPORT:
usbd_ctrl_send(pudev, pcshid->hid_get_report, setup->wLength);
break;
default: default:
usbd_ctrl_unsupport(pudev); usbd_ctrl_unsupport(pudev);
break; break;

View File

@@ -1,8 +1,8 @@
/** /**
************************************************************************** **************************************************************************
* @file custom_hid_class.h * @file custom_hid_class.h
* @version v2.0.6 * @version v2.0.7
* @date 2022-06-28 * @date 2022-08-16
* @brief usb custom hid header file * @brief usb custom hid header file
************************************************************************** **************************************************************************
* Copyright notice & Disclaimer * Copyright notice & Disclaimer
@@ -77,6 +77,7 @@ typedef struct
uint32_t alt_setting; uint32_t alt_setting;
uint8_t hid_state; uint8_t hid_state;
uint8_t hid_set_report[64]; uint8_t hid_set_report[64];
uint8_t hid_get_report[64];
}custom_hid_type; }custom_hid_type;
/** /**

View File

@@ -1,8 +1,8 @@
/** /**
************************************************************************** **************************************************************************
* @file custom_hid_desc.c * @file custom_hid_desc.c
* @version v2.0.6 * @version v2.0.7
* @date 2022-06-28 * @date 2022-08-16
* @brief usb hid device descriptor * @brief usb hid device descriptor
************************************************************************** **************************************************************************
* Copyright notice & Disclaimer * Copyright notice & Disclaimer

View File

@@ -1,8 +1,8 @@
/** /**
************************************************************************** **************************************************************************
* @file custom_hid_desc.h * @file custom_hid_desc.h
* @version v2.0.6 * @version v2.0.7
* @date 2022-06-28 * @date 2022-08-16
* @brief usb custom hid descriptor header file * @brief usb custom hid descriptor header file
************************************************************************** **************************************************************************
* Copyright notice & Disclaimer * Copyright notice & Disclaimer

View File

@@ -1,8 +1,8 @@
/** /**
************************************************************************** **************************************************************************
* @file hid_iap_class.c * @file hid_iap_class.c
* @version v2.0.6 * @version v2.0.7
* @date 2022-06-28 * @date 2022-08-16
* @brief usb hid iap class type * @brief usb hid iap class type
************************************************************************** **************************************************************************
* Copyright notice & Disclaimer * Copyright notice & Disclaimer

View File

@@ -1,8 +1,8 @@
/** /**
************************************************************************** **************************************************************************
* @file hid_iap_class.h * @file hid_iap_class.h
* @version v2.0.6 * @version v2.0.7
* @date 2022-06-28 * @date 2022-08-16
* @brief usb hid iap header file * @brief usb hid iap header file
************************************************************************** **************************************************************************
* Copyright notice & Disclaimer * Copyright notice & Disclaimer

View File

@@ -1,8 +1,8 @@
/** /**
************************************************************************** **************************************************************************
* @file hid_iap_desc.c * @file hid_iap_desc.c
* @version v2.0.6 * @version v2.0.7
* @date 2022-06-28 * @date 2022-08-16
* @brief usb hid device descriptor * @brief usb hid device descriptor
************************************************************************** **************************************************************************
* Copyright notice & Disclaimer * Copyright notice & Disclaimer

View File

@@ -1,8 +1,8 @@
/** /**
************************************************************************** **************************************************************************
* @file hid_iap_desc.h * @file hid_iap_desc.h
* @version v2.0.6 * @version v2.0.7
* @date 2022-06-28 * @date 2022-08-16
* @brief usb hid descriptor header file * @brief usb hid descriptor header file
************************************************************************** **************************************************************************
* Copyright notice & Disclaimer * Copyright notice & Disclaimer

View File

@@ -1,8 +1,8 @@
/** /**
************************************************************************** **************************************************************************
* @file keyboard_class.c * @file keyboard_class.c
* @version v2.0.6 * @version v2.0.7
* @date 2022-06-28 * @date 2022-08-16
* @brief usb hid keyboard class type * @brief usb hid keyboard class type
************************************************************************** **************************************************************************
* Copyright notice & Disclaimer * Copyright notice & Disclaimer

View File

@@ -1,8 +1,8 @@
/** /**
************************************************************************** **************************************************************************
* @file keyboard_class.h * @file keyboard_class.h
* @version v2.0.6 * @version v2.0.7
* @date 2022-06-28 * @date 2022-08-16
* @brief usb hid keyboard header file * @brief usb hid keyboard header file
************************************************************************** **************************************************************************
* Copyright notice & Disclaimer * Copyright notice & Disclaimer

View File

@@ -1,8 +1,8 @@
/** /**
************************************************************************** **************************************************************************
* @file keyboard_desc.c * @file keyboard_desc.c
* @version v2.0.6 * @version v2.0.7
* @date 2022-06-28 * @date 2022-08-16
* @brief usb hid keyboard device descriptor * @brief usb hid keyboard device descriptor
************************************************************************** **************************************************************************
* Copyright notice & Disclaimer * Copyright notice & Disclaimer

View File

@@ -1,8 +1,8 @@
/** /**
************************************************************************** **************************************************************************
* @file keyboard_desc.h * @file keyboard_desc.h
* @version v2.0.6 * @version v2.0.7
* @date 2022-06-28 * @date 2022-08-16
* @brief usb keyboard descriptor header file * @brief usb keyboard descriptor header file
************************************************************************** **************************************************************************
* Copyright notice & Disclaimer * Copyright notice & Disclaimer

View File

@@ -1,8 +1,8 @@
/** /**
************************************************************************** **************************************************************************
* @file mouse_class.c * @file mouse_class.c
* @version v2.0.6 * @version v2.0.7
* @date 2022-06-28 * @date 2022-08-16
* @brief usb hid mouse class type * @brief usb hid mouse class type
************************************************************************** **************************************************************************
* Copyright notice & Disclaimer * Copyright notice & Disclaimer

View File

@@ -1,8 +1,8 @@
/** /**
************************************************************************** **************************************************************************
* @file mouse_class.h * @file mouse_class.h
* @version v2.0.6 * @version v2.0.7
* @date 2022-06-28 * @date 2022-08-16
* @brief usb hid mouse header file * @brief usb hid mouse header file
************************************************************************** **************************************************************************
* Copyright notice & Disclaimer * Copyright notice & Disclaimer

View File

@@ -1,8 +1,8 @@
/** /**
************************************************************************** **************************************************************************
* @file mouse_desc.c * @file mouse_desc.c
* @version v2.0.6 * @version v2.0.7
* @date 2022-06-28 * @date 2022-08-16
* @brief usb hid mouse device descriptor * @brief usb hid mouse device descriptor
************************************************************************** **************************************************************************
* Copyright notice & Disclaimer * Copyright notice & Disclaimer

Some files were not shown because too many files have changed in this diff Show More