Skip to content

Commit

Permalink
update version to v2.1.2
Browse files Browse the repository at this point in the history
  • Loading branch information
Artery-MCU committed Jan 25, 2024
1 parent 35a0cb1 commit b8dfb37
Showing 103 changed files with 3,346 additions and 233 deletions.
Binary file not shown.
Binary file modified document/ReleaseNotes_AT32F413_Firmware_Library.pdf
Binary file not shown.
4 changes: 2 additions & 2 deletions libraries/cmsis/cm4/device_support/at32f413.h
Original file line number Diff line number Diff line change
@@ -124,7 +124,7 @@ extern "C" {
*/
#define __AT32F413_LIBRARY_VERSION_MAJOR (0x02) /*!< [31:24] major version */
#define __AT32F413_LIBRARY_VERSION_MIDDLE (0x01) /*!< [23:16] middle version */
#define __AT32F413_LIBRARY_VERSION_MINOR (0x01) /*!< [15:8] minor version */
#define __AT32F413_LIBRARY_VERSION_MINOR (0x02) /*!< [15:8] minor version */
#define __AT32F413_LIBRARY_VERSION_RC (0x00) /*!< [7:0] release candidate */
#define __AT32F413_LIBRARY_VERSION ((__AT32F413_LIBRARY_VERSION_MAJOR << 24) | \
(__AT32F413_LIBRARY_VERSION_MIDDLE << 16) | \
@@ -230,7 +230,7 @@ typedef enum IRQn
ACC_IRQn = 72, /*!< acc interrupt */
USBFS_MAPH_IRQn = 73, /*!< usb map hp interrupt */
USBFS_MAPL_IRQn = 74, /*!< usb map lp interrupt */
DMA2_Channel6_7_IRQn = 75, /*!< dma2 channel 6 and channel 7 global interrupt */
DMA2_Channel6_7_IRQn = 75 /*!< dma2 channel 6 and channel 7 global interrupt */

} IRQn_Type;

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
;**************************************************************************
;* @file startup_at32f403a_407.s
;* @brief at32f403a_407 startup file for keil
;* @file startup_at32f413.s
;* @brief at32f413 startup file for keil
;* <<< Use Configuration Wizard in Context Menu >>>
;**************************************************************************
;
Binary file not shown.
4 changes: 1 addition & 3 deletions libraries/drivers/inc/at32f413_bpr.h
Original file line number Diff line number Diff line change
@@ -116,9 +116,7 @@ typedef enum
BPR_RTC_OUTPUT_CLOCK_CAL_BEFORE = 0x080, /*!< output clock before calibration */
BPR_RTC_OUTPUT_ALARM = 0x100, /*!< output alarm event with pluse mode */
BPR_RTC_OUTPUT_SECOND = 0x300, /*!< output second event with pluse mode */
BPR_RTC_OUTPUT_CLOCK_CAL_AFTER = 0x480, /*!< output clock after calibration */
BPR_RTC_OUTPUT_ALARM_TOGGLE = 0x900, /*!< output alarm event with toggle mode */
BPR_RTC_OUTPUT_SECOND_TOGGLE = 0xB00 /*!< output second event with toggle mode */
BPR_RTC_OUTPUT_CLOCK_CAL_AFTER = 0x480 /*!< output clock after calibration */
} bpr_rtc_output_type;

/**
4 changes: 2 additions & 2 deletions libraries/drivers/inc/at32f413_crm.h
Original file line number Diff line number Diff line change
@@ -137,7 +137,7 @@ typedef enum
CRM_CAN1_PERIPH_CLOCK = MAKE_VALUE(0x1C, 25), /*!< can1 periph clock */
CRM_BPR_PERIPH_CLOCK = MAKE_VALUE(0x1C, 27), /*!< bpr periph clock */
CRM_PWC_PERIPH_CLOCK = MAKE_VALUE(0x1C, 28), /*!< pwc periph clock */
CRM_CAN2_PERIPH_CLOCK = MAKE_VALUE(0x1C, 31), /*!< can2 periph clock */
CRM_CAN2_PERIPH_CLOCK = MAKE_VALUE(0x1C, 31) /*!< can2 periph clock */

} crm_periph_clock_type;

@@ -181,7 +181,7 @@ typedef enum
CRM_CAN1_PERIPH_RESET = MAKE_VALUE(0x10, 25), /*!< can1 periph reset */
CRM_BPR_PERIPH_RESET = MAKE_VALUE(0x10, 27), /*!< bpr periph reset */
CRM_PWC_PERIPH_RESET = MAKE_VALUE(0x10, 28), /*!< pwc periph reset */
CRM_CAN2_PERIPH_RESET = MAKE_VALUE(0x10, 31), /*!< can2 periph reset */
CRM_CAN2_PERIPH_RESET = MAKE_VALUE(0x10, 31) /*!< can2 periph reset */

} crm_periph_reset_type;

1 change: 1 addition & 0 deletions libraries/drivers/inc/at32f413_dma.h
Original file line number Diff line number Diff line change
@@ -505,6 +505,7 @@ void dma_data_number_set(dma_channel_type* dmax_channely, uint16_t data_number);
uint16_t dma_data_number_get(dma_channel_type* dmax_channely);
void dma_interrupt_enable(dma_channel_type* dmax_channely, uint32_t dma_int, confirm_state new_state);
flag_status dma_flag_get(uint32_t dmax_flag);
flag_status dma_interrupt_flag_get(uint32_t dmax_flag);
void dma_flag_clear(uint32_t dmax_flag);


2 changes: 1 addition & 1 deletion libraries/drivers/inc/at32f413_flash.h
Original file line number Diff line number Diff line change
@@ -168,7 +168,7 @@ typedef enum
typedef enum
{
FLASH_SPIM_MODEL1 = 0x01, /*!< spim model 1 */
FLASH_SPIM_MODEL2 = 0x02, /*!< spim model 2 */
FLASH_SPIM_MODEL2 = 0x02 /*!< spim model 2 */
} flash_spim_model_type;

/**
2 changes: 0 additions & 2 deletions libraries/drivers/src/at32f413_bpr.c
Original file line number Diff line number Diff line change
@@ -162,8 +162,6 @@ void bpr_data_write(bpr_data_type bpr_data, uint16_t data_value)
* - BPR_RTC_OUTPUT_ALARM: output alarm event with pluse mode.
* - BPR_RTC_OUTPUT_SECOND: output second event with pluse mode.
* - BPR_RTC_OUTPUT_CLOCK_CAL_AFTER: output clock after calibration.
* - BPR_RTC_OUTPUT_ALARM_TOGGLE: output alarm event with toggle mode.
* - BPR_RTC_OUTPUT_SECOND_TOGGLE: output second event with toggle mode.
* @retval none
*/
void bpr_rtc_output_select(bpr_rtc_output_type output_source)
46 changes: 46 additions & 0 deletions libraries/drivers/src/at32f413_dma.c
Original file line number Diff line number Diff line change
@@ -273,6 +273,52 @@ void dma_flexible_config(dma_type* dma_x, uint8_t flex_channelx, dma_flexible_re
}
}

/**
* @brief get dma interrupt flag
* @param dmax_flag
* this parameter can be one of the following values:
* - DMA1_FDT1_FLAG - DMA1_HDT1_FLAG - DMA1_DTERR1_FLAG
* - DMA1_FDT2_FLAG - DMA1_HDT2_FLAG - DMA1_DTERR2_FLAG
* - DMA1_FDT3_FLAG - DMA1_HDT3_FLAG - DMA1_DTERR3_FLAG
* - DMA1_FDT4_FLAG - DMA1_HDT4_FLAG - DMA1_DTERR4_FLAG
* - DMA1_FDT5_FLAG - DMA1_HDT5_FLAG - DMA1_DTERR5_FLAG
* - DMA1_FDT6_FLAG - DMA1_HDT6_FLAG - DMA1_DTERR6_FLAG
* - DMA1_FDT7_FLAG - DMA1_HDT7_FLAG - DMA1_DTERR7_FLAG
* - DMA2_FDT1_FLAG - DMA2_HDT1_FLAG - DMA2_DTERR1_FLAG
* - DMA2_FDT2_FLAG - DMA2_HDT2_FLAG - DMA2_DTERR2_FLAG
* - DMA2_FDT3_FLAG - DMA2_HDT3_FLAG - DMA2_DTERR3_FLAG
* - DMA2_FDT4_FLAG - DMA2_HDT4_FLAG - DMA2_DTERR4_FLAG
* - DMA2_FDT5_FLAG - DMA2_HDT5_FLAG - DMA2_DTERR5_FLAG
* - DMA2_FDT6_FLAG - DMA2_HDT6_FLAG - DMA2_DTERR6_FLAG
* - DMA2_FDT7_FLAG - DMA2_HDT7_FLAG - DMA2_DTERR7_FLAG
* @retval state of dma flag
*/
flag_status dma_interrupt_flag_get(uint32_t dmax_flag)
{
flag_status status = RESET;
uint32_t temp = 0;

if(dmax_flag > 0x10000000)
{
temp = DMA2->sts;
}
else
{
temp = DMA1->sts;
}

if ((temp & dmax_flag) != (uint16_t)RESET)
{
status = SET;
}
else
{
status = RESET;
}

return status;
}

/**
* @brief get dma flag
* @param dmax_flag
6 changes: 4 additions & 2 deletions libraries/drivers/src/at32f413_exint.c
Original file line number Diff line number Diff line change
@@ -167,8 +167,10 @@ flag_status exint_flag_get(uint32_t exint_line)
flag_status exint_interrupt_flag_get(uint32_t exint_line)
{
flag_status status = RESET;
uint32_t exint_flag =0;
exint_flag = EXINT->intsts & exint_line & EXINT->inten;
uint32_t exint_flag = 0;
exint_flag = EXINT->intsts & exint_line;
exint_flag = exint_flag & EXINT->inten;

if((exint_flag != (uint16_t)RESET))
{
status = SET;
2 changes: 1 addition & 1 deletion libraries/drivers/src/at32f413_i2c.c
Original file line number Diff line number Diff line change
@@ -632,7 +632,7 @@ flag_status i2c_interrupt_flag_get(i2c_type *i2c_x, uint32_t flag)
break;
case I2C_RDBF_FLAG:
case I2C_TDBE_FLAG:
iten = i2c_x->ctrl2_bit.dataien & i2c_x->ctrl2_bit.evtien;
iten = i2c_x->ctrl2_bit.dataien && i2c_x->ctrl2_bit.evtien;
break;
case I2C_BUSERR_FLAG:
case I2C_ARLOST_FLAG:
7 changes: 6 additions & 1 deletion middlewares/usbd_class/audio_hid/audio_hid_class.c
Original file line number Diff line number Diff line change
@@ -284,13 +284,18 @@ usb_sts_type class_hid_setup_handler(void *udev, usb_setup_type *setup)
{
len = MIN(USBD_AUHID_HID_SIZ_REPORT_DESC, setup->wLength);
buf = (uint8_t *)g_usbd_audio_hid_report;
usbd_ctrl_send(pudev, (uint8_t *)buf, len);
}
else if(setup->wValue >> 8 == HID_DESCRIPTOR_TYPE)
{
len = MIN(9, setup->wLength);
buf = (uint8_t *)g_audio_hid_usb_desc;
usbd_ctrl_send(pudev, (uint8_t *)buf, len);
}
else
{
usbd_ctrl_unsupport(pudev);
}
usbd_ctrl_send(pudev, (uint8_t *)buf, len);
break;
case USB_STD_REQ_GET_INTERFACE:
usbd_ctrl_send(pudev, (uint8_t *)&paudio_hid->alt_setting, 1);
Original file line number Diff line number Diff line change
@@ -422,13 +422,18 @@ static usb_sts_type keyboard_class_setup_handler(void *udev, usb_setup_type *set
{
len = MIN(USBD_VCPKYBRD_HID_SIZ_REPORT_DESC, setup->wLength);
buf = (uint8_t *)g_usbd_vcpkybrd_hid_report;
usbd_ctrl_send(pudev, (uint8_t *)buf, len);
}
else if(setup->wValue >> 8 == HID_DESCRIPTOR_TYPE)
{
len = MIN(9, setup->wLength);
buf = (uint8_t *)g_vcpkybrd_hid_usb_desc;
usbd_ctrl_send(pudev, (uint8_t *)buf, len);
}
else
{
usbd_ctrl_unsupport(pudev);
}
usbd_ctrl_send(pudev, (uint8_t *)buf, len);
break;
case USB_STD_REQ_GET_INTERFACE:
usbd_ctrl_send(pudev, (uint8_t *)&vcpkybrd->alt_setting, 1);
7 changes: 6 additions & 1 deletion middlewares/usbd_class/custom_hid/custom_hid_class.c
Original file line number Diff line number Diff line change
@@ -166,13 +166,18 @@ static usb_sts_type class_setup_handler(void *udev, usb_setup_type *setup)
{
len = MIN(USBD_CUSHID_SIZ_REPORT_DESC, setup->wLength);
buf = (uint8_t *)g_usbd_custom_hid_report;
usbd_ctrl_send(pudev, (uint8_t *)buf, len);
}
else if(setup->wValue >> 8 == HID_DESCRIPTOR_TYPE)
{
len = MIN(9, setup->wLength);
buf = (uint8_t *)g_custom_hid_usb_desc;
usbd_ctrl_send(pudev, (uint8_t *)buf, len);
}
else
{
usbd_ctrl_unsupport(pudev);
}
usbd_ctrl_send(pudev, (uint8_t *)buf, len);
break;
case USB_STD_REQ_GET_INTERFACE:
usbd_ctrl_send(pudev, (uint8_t *)&pcshid->alt_setting, 1);
7 changes: 6 additions & 1 deletion middlewares/usbd_class/hid_iap/hid_iap_class.c
Original file line number Diff line number Diff line change
@@ -157,13 +157,18 @@ static usb_sts_type class_setup_handler(void *udev, usb_setup_type *setup)
{
len = MIN(USBD_HIDIAP_SIZ_REPORT_DESC, setup->wLength);
buf = (uint8_t *)g_usbd_hidiap_report;
usbd_ctrl_send(pudev, (uint8_t *)buf, len);
}
else if(setup->wValue >> 8 == HID_DESCRIPTOR_TYPE)
{
len = MIN(9, setup->wLength);
buf = (uint8_t *)g_hidiap_usb_desc;
usbd_ctrl_send(pudev, (uint8_t *)buf, len);
}
else
{
usbd_ctrl_unsupport(pudev);
}
usbd_ctrl_send(pudev, (uint8_t *)buf, len);
break;
case USB_STD_REQ_GET_INTERFACE:
usbd_ctrl_send(pudev, (uint8_t *)&piap->alt_setting, 1);
7 changes: 6 additions & 1 deletion middlewares/usbd_class/keyboard/keyboard_class.c
Original file line number Diff line number Diff line change
@@ -287,13 +287,18 @@ static usb_sts_type class_setup_handler(void *udev, usb_setup_type *setup)
{
len = MIN(USBD_KEYBOARD_SIZ_REPORT_DESC, setup->wLength);
buf = (uint8_t *)g_usbd_keyboard_report;
usbd_ctrl_send(pudev, (uint8_t *)buf, len);
}
else if(setup->wValue >> 8 == HID_DESCRIPTOR_TYPE)
{
len = MIN(9, setup->wLength);
buf = (uint8_t *)g_keyboard_usb_desc;
usbd_ctrl_send(pudev, (uint8_t *)buf, len);
}
else
{
usbd_ctrl_unsupport(pudev);
}
usbd_ctrl_send(pudev, (uint8_t *)buf, len);
break;
case USB_STD_REQ_GET_INTERFACE:
usbd_ctrl_send(pudev, (uint8_t *)&pkeyboard->alt_setting, 1);
7 changes: 6 additions & 1 deletion middlewares/usbd_class/mouse/mouse_class.c
Original file line number Diff line number Diff line change
@@ -152,13 +152,18 @@ static usb_sts_type class_setup_handler(void *udev, usb_setup_type *setup)
{
len = MIN(USBD_MOUSE_SIZ_REPORT_DESC, setup->wLength);
buf = (uint8_t *)g_usbd_mouse_report;
usbd_ctrl_send(pudev, (uint8_t *)buf, len);
}
else if(setup->wValue >> 8 == HID_DESCRIPTOR_TYPE)
{
len = MIN(9, setup->wLength);
buf = (uint8_t *)g_mouse_usb_desc;
usbd_ctrl_send(pudev, (uint8_t *)buf, len);
}
else
{
usbd_ctrl_unsupport(pudev);
}
usbd_ctrl_send(pudev, (uint8_t *)buf, len);
break;
case USB_STD_REQ_GET_INTERFACE:
usbd_ctrl_send(pudev, (uint8_t *)&pmouse->alt_setting, 1);
Loading

0 comments on commit b8dfb37

Please sign in to comment.