mirror of
https://github.com/ArteryTek/AT32F415_Firmware_Library.git
synced 2026-05-21 09:22:11 +00:00
update version to v2.0.2
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
/**
|
||||
**************************************************************************
|
||||
* @file at32f415_clock.h
|
||||
* @version v2.0.0
|
||||
* @date 2021-11-26
|
||||
* @version v2.0.2
|
||||
* @date 2021-12-31
|
||||
* @brief header file of clock program
|
||||
**************************************************************************
|
||||
* Copyright notice & Disclaimer
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/**
|
||||
**************************************************************************
|
||||
* @file at32f415_conf.h
|
||||
* @version v2.0.0
|
||||
* @date 2021-11-26
|
||||
* @version v2.0.2
|
||||
* @date 2021-12-31
|
||||
* @brief at32f415 config header file
|
||||
**************************************************************************
|
||||
* Copyright notice & Disclaimer
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/**
|
||||
**************************************************************************
|
||||
* @file at32f415_int.h
|
||||
* @version v2.0.0
|
||||
* @date 2021-11-26
|
||||
* @version v2.0.2
|
||||
* @date 2021-12-31
|
||||
* @brief header file of main interrupt service routines.
|
||||
**************************************************************************
|
||||
* Copyright notice & Disclaimer
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/**
|
||||
**************************************************************************
|
||||
* @file usb_conf.h
|
||||
* @version v2.0.0
|
||||
* @date 2021-11-26
|
||||
* @version v2.0.2
|
||||
* @date 2021-12-31
|
||||
* @brief usb config header file
|
||||
**************************************************************************
|
||||
* Copyright notice & Disclaimer
|
||||
@@ -71,7 +71,7 @@ extern "C" {
|
||||
|
||||
|
||||
#define OTG_PIN_SOF_GPIO GPIOA
|
||||
#define OTG_PIN_SOF_GPIO_CLOCK CRM_GPIOB_PERIPH_CLOCK
|
||||
#define OTG_PIN_SOF_GPIO_CLOCK CRM_GPIOA_PERIPH_CLOCK
|
||||
#define OTG_PIN_SOF GPIO_PINS_8
|
||||
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/**
|
||||
**************************************************************************
|
||||
* @file usbh_user.h
|
||||
* @version v2.0.0
|
||||
* @date 2021-11-26
|
||||
* @version v2.0.2
|
||||
* @date 2021-12-31
|
||||
* @brief usb host user header file
|
||||
**************************************************************************
|
||||
* Copyright notice & Disclaimer
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/**
|
||||
**************************************************************************
|
||||
* @file readme.txt
|
||||
* @version v2.0.0
|
||||
* @date 2021-11-26
|
||||
* @version v2.0.2
|
||||
* @date 2021-12-31
|
||||
* @brief readme
|
||||
**************************************************************************
|
||||
*/
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/**
|
||||
**************************************************************************
|
||||
* @file at32f415_clock.c
|
||||
* @version v2.0.0
|
||||
* @date 2021-11-26
|
||||
* @version v2.0.2
|
||||
* @date 2021-12-31
|
||||
* @brief system clock config program
|
||||
**************************************************************************
|
||||
* Copyright notice & Disclaimer
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/**
|
||||
**************************************************************************
|
||||
* @file at32f415_int.c
|
||||
* @version v2.0.0
|
||||
* @date 2021-11-26
|
||||
* @version v2.0.2
|
||||
* @date 2021-12-31
|
||||
* @brief main interrupt service routines.
|
||||
**************************************************************************
|
||||
* Copyright notice & Disclaimer
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/**
|
||||
**************************************************************************
|
||||
* @file main.c
|
||||
* @version v2.0.0
|
||||
* @date 2021-11-26
|
||||
* @version v2.0.2
|
||||
* @date 2021-12-31
|
||||
* @brief main program
|
||||
**************************************************************************
|
||||
* Copyright notice & Disclaimer
|
||||
@@ -40,53 +40,6 @@
|
||||
* @{
|
||||
*/
|
||||
|
||||
/* suport printf function, usemicrolib is unnecessary */
|
||||
#if (__ARMCC_VERSION > 6000000)
|
||||
__asm (".global __use_no_semihosting\n\t");
|
||||
void _sys_exit(int x)
|
||||
{
|
||||
x = x;
|
||||
}
|
||||
/* __use_no_semihosting was requested, but _ttywrch was */
|
||||
void _ttywrch(int ch)
|
||||
{
|
||||
ch = ch;
|
||||
}
|
||||
FILE __stdout;
|
||||
#else
|
||||
#ifdef __CC_ARM
|
||||
#pragma import(__use_no_semihosting)
|
||||
struct __FILE
|
||||
{
|
||||
int handle;
|
||||
};
|
||||
FILE __stdout;
|
||||
void _sys_exit(int x)
|
||||
{
|
||||
x = x;
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined ( __GNUC__ ) && !defined (__clang__)
|
||||
#define PUTCHAR_PROTOTYPE int __io_putchar(int ch)
|
||||
#else
|
||||
#define PUTCHAR_PROTOTYPE int fputc(int ch, FILE *f)
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief retargets the c library printf function to the usart.
|
||||
* @param none
|
||||
* @retval none
|
||||
*/
|
||||
PUTCHAR_PROTOTYPE
|
||||
{
|
||||
while(usart_flag_get(USART1, USART_TDBE_FLAG) == RESET);
|
||||
usart_data_transmit(USART1, ch);
|
||||
return ch;
|
||||
}
|
||||
|
||||
|
||||
/* usb global struct define */
|
||||
otg_core_type otg_core_struct;
|
||||
void usb_clock48m_select(usb_clk48_s clk_s);
|
||||
@@ -138,34 +91,6 @@ void EXINT0_IRQHandler(void)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief initialize uart1
|
||||
* @param baudrate: uart baudrate
|
||||
* @retval none
|
||||
*/
|
||||
void uart_print_init(uint32_t baudrate)
|
||||
{
|
||||
gpio_init_type gpio_init_struct;
|
||||
|
||||
/* enable the uart1 and gpio clock */
|
||||
crm_periph_clock_enable(CRM_USART1_PERIPH_CLOCK, TRUE);
|
||||
crm_periph_clock_enable(CRM_GPIOA_PERIPH_CLOCK, TRUE);
|
||||
|
||||
gpio_default_para_init(&gpio_init_struct);
|
||||
|
||||
/* configure the uart1 tx pin */
|
||||
gpio_init_struct.gpio_drive_strength = GPIO_DRIVE_STRENGTH_STRONGER;
|
||||
gpio_init_struct.gpio_out_type = GPIO_OUTPUT_PUSH_PULL;
|
||||
gpio_init_struct.gpio_mode = GPIO_MODE_MUX;
|
||||
gpio_init_struct.gpio_pins = GPIO_PINS_9;
|
||||
gpio_init_struct.gpio_pull = GPIO_PULL_NONE;
|
||||
gpio_init(GPIOA, &gpio_init_struct);
|
||||
|
||||
/* configure uart param */
|
||||
usart_init(USART1, baudrate, USART_DATA_8BITS, USART_STOP_1_BIT);
|
||||
usart_transmitter_enable(USART1, TRUE);
|
||||
usart_enable(USART1, TRUE);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief main function.
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/**
|
||||
**************************************************************************
|
||||
* @file usbh_user.c
|
||||
* @version v2.0.0
|
||||
* @date 2021-11-26
|
||||
* @version v2.0.2
|
||||
* @date 2021-12-31
|
||||
* @brief usb user function
|
||||
**************************************************************************
|
||||
* Copyright notice & Disclaimer
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/**
|
||||
**************************************************************************
|
||||
* @file at32f415_clock.h
|
||||
* @version v2.0.0
|
||||
* @date 2021-11-26
|
||||
* @version v2.0.2
|
||||
* @date 2021-12-31
|
||||
* @brief header file of clock program
|
||||
**************************************************************************
|
||||
* Copyright notice & Disclaimer
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/**
|
||||
**************************************************************************
|
||||
* @file at32f415_conf.h
|
||||
* @version v2.0.0
|
||||
* @date 2021-11-26
|
||||
* @version v2.0.2
|
||||
* @date 2021-12-31
|
||||
* @brief at32f415 config header file
|
||||
**************************************************************************
|
||||
* Copyright notice & Disclaimer
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/**
|
||||
**************************************************************************
|
||||
* @file at32f415_int.h
|
||||
* @version v2.0.0
|
||||
* @date 2021-11-26
|
||||
* @version v2.0.2
|
||||
* @date 2021-12-31
|
||||
* @brief header file of main interrupt service routines.
|
||||
**************************************************************************
|
||||
* Copyright notice & Disclaimer
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/**
|
||||
**************************************************************************
|
||||
* @file usb_conf.h
|
||||
* @version v2.0.0
|
||||
* @date 2021-11-26
|
||||
* @version v2.0.2
|
||||
* @date 2021-12-31
|
||||
* @brief usb config header file
|
||||
**************************************************************************
|
||||
* Copyright notice & Disclaimer
|
||||
@@ -71,7 +71,7 @@ extern "C" {
|
||||
|
||||
|
||||
#define OTG_PIN_SOF_GPIO GPIOA
|
||||
#define OTG_PIN_SOF_GPIO_CLOCK CRM_GPIOB_PERIPH_CLOCK
|
||||
#define OTG_PIN_SOF_GPIO_CLOCK CRM_GPIOA_PERIPH_CLOCK
|
||||
#define OTG_PIN_SOF GPIO_PINS_8
|
||||
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/**
|
||||
**************************************************************************
|
||||
* @file usbh_user.h
|
||||
* @version v2.0.0
|
||||
* @date 2021-11-26
|
||||
* @version v2.0.2
|
||||
* @date 2021-12-31
|
||||
* @brief usb host user header file
|
||||
**************************************************************************
|
||||
* Copyright notice & Disclaimer
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/**
|
||||
**************************************************************************
|
||||
* @file readme.txt
|
||||
* @version v2.0.0
|
||||
* @date 2021-11-26
|
||||
* @version v2.0.2
|
||||
* @date 2021-12-31
|
||||
* @brief readme
|
||||
**************************************************************************
|
||||
*/
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/**
|
||||
**************************************************************************
|
||||
* @file at32f415_clock.c
|
||||
* @version v2.0.0
|
||||
* @date 2021-11-26
|
||||
* @version v2.0.2
|
||||
* @date 2021-12-31
|
||||
* @brief system clock config program
|
||||
**************************************************************************
|
||||
* Copyright notice & Disclaimer
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/**
|
||||
**************************************************************************
|
||||
* @file at32f415_int.c
|
||||
* @version v2.0.0
|
||||
* @date 2021-11-26
|
||||
* @version v2.0.2
|
||||
* @date 2021-12-31
|
||||
* @brief main interrupt service routines.
|
||||
**************************************************************************
|
||||
* Copyright notice & Disclaimer
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/**
|
||||
**************************************************************************
|
||||
* @file main.c
|
||||
* @version v2.0.0
|
||||
* @date 2021-11-26
|
||||
* @version v2.0.2
|
||||
* @date 2021-12-31
|
||||
* @brief main program
|
||||
**************************************************************************
|
||||
* Copyright notice & Disclaimer
|
||||
@@ -41,89 +41,12 @@
|
||||
* @{
|
||||
*/
|
||||
|
||||
/* suport printf function, usemicrolib is unnecessary */
|
||||
#if (__ARMCC_VERSION > 6000000)
|
||||
__asm (".global __use_no_semihosting\n\t");
|
||||
void _sys_exit(int x)
|
||||
{
|
||||
x = x;
|
||||
}
|
||||
/* __use_no_semihosting was requested, but _ttywrch was */
|
||||
void _ttywrch(int ch)
|
||||
{
|
||||
ch = ch;
|
||||
}
|
||||
FILE __stdout;
|
||||
#else
|
||||
#ifdef __CC_ARM
|
||||
#pragma import(__use_no_semihosting)
|
||||
struct __FILE
|
||||
{
|
||||
int handle;
|
||||
};
|
||||
FILE __stdout;
|
||||
void _sys_exit(int x)
|
||||
{
|
||||
x = x;
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined ( __GNUC__ ) && !defined (__clang__)
|
||||
#define PUTCHAR_PROTOTYPE int __io_putchar(int ch)
|
||||
#else
|
||||
#define PUTCHAR_PROTOTYPE int fputc(int ch, FILE *f)
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief retargets the c library printf function to the usart.
|
||||
* @param none
|
||||
* @retval none
|
||||
*/
|
||||
PUTCHAR_PROTOTYPE
|
||||
{
|
||||
while(usart_flag_get(USART1, USART_TDBE_FLAG) == RESET);
|
||||
usart_data_transmit(USART1, ch);
|
||||
return ch;
|
||||
}
|
||||
|
||||
|
||||
/* usb global struct define */
|
||||
otg_core_type otg_core_struct;
|
||||
void usb_clock48m_select(usb_clk48_s clk_s);
|
||||
void usb_gpio_config(void);
|
||||
void usb_low_power_wakeup_config(void);
|
||||
|
||||
|
||||
/**
|
||||
* @brief initialize uart1
|
||||
* @param baudrate: uart baudrate
|
||||
* @retval none
|
||||
*/
|
||||
void uart_print_init(uint32_t baudrate)
|
||||
{
|
||||
gpio_init_type gpio_init_struct;
|
||||
|
||||
/* enable the uart1 and gpio clock */
|
||||
crm_periph_clock_enable(CRM_USART1_PERIPH_CLOCK, TRUE);
|
||||
crm_periph_clock_enable(CRM_GPIOA_PERIPH_CLOCK, TRUE);
|
||||
|
||||
gpio_default_para_init(&gpio_init_struct);
|
||||
|
||||
/* configure the uart1 tx pin */
|
||||
gpio_init_struct.gpio_drive_strength = GPIO_DRIVE_STRENGTH_STRONGER;
|
||||
gpio_init_struct.gpio_out_type = GPIO_OUTPUT_PUSH_PULL;
|
||||
gpio_init_struct.gpio_mode = GPIO_MODE_MUX;
|
||||
gpio_init_struct.gpio_pins = GPIO_PINS_9;
|
||||
gpio_init_struct.gpio_pull = GPIO_PULL_NONE;
|
||||
gpio_init(GPIOA, &gpio_init_struct);
|
||||
|
||||
/* configure uart param */
|
||||
usart_init(USART1, baudrate, USART_DATA_8BITS, USART_STOP_1_BIT);
|
||||
usart_transmitter_enable(USART1, TRUE);
|
||||
usart_enable(USART1, TRUE);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief main function.
|
||||
* @param none
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/**
|
||||
**************************************************************************
|
||||
* @file usbh_msc_diskio.c
|
||||
* @version v2.0.0
|
||||
* @date 2021-11-26
|
||||
* @version v2.0.2
|
||||
* @date 2021-12-31
|
||||
* @brief usb mass storage disk io
|
||||
**************************************************************************
|
||||
* Copyright notice & Disclaimer
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/**
|
||||
**************************************************************************
|
||||
* @file usbh_user.c
|
||||
* @version v2.0.0
|
||||
* @date 2021-11-26
|
||||
* @version v2.0.2
|
||||
* @date 2021-12-31
|
||||
* @brief usb user function
|
||||
**************************************************************************
|
||||
* Copyright notice & Disclaimer
|
||||
|
||||
Reference in New Issue
Block a user