update version to v2.2.1

This commit is contained in:
Artery-MCU
2025-04-29 13:40:10 +08:00
parent b71bd119f4
commit 9cdb243884
122 changed files with 5929 additions and 26979 deletions

View File

@@ -161,7 +161,7 @@ extern "C" {
*/
#define __AT32F403A_407_LIBRARY_VERSION_MAJOR (0x02) /*!< [31:24] major version */
#define __AT32F403A_407_LIBRARY_VERSION_MIDDLE (0x02) /*!< [23:16] middle version */
#define __AT32F403A_407_LIBRARY_VERSION_MINOR (0x00) /*!< [15:8] minor version */
#define __AT32F403A_407_LIBRARY_VERSION_MINOR (0x01) /*!< [15:8] minor version */
#define __AT32F403A_407_LIBRARY_VERSION_RC (0x00) /*!< [7:0] release candidate */
#define __AT32F403A_407_LIBRARY_VERSION ((__AT32F403A_407_LIBRARY_VERSION_MAJOR << 24) | \
(__AT32F403A_407_LIBRARY_VERSION_MIDDLE << 16) | \

View File

@@ -911,6 +911,7 @@ flag_status gpio_output_data_bit_read(gpio_type *gpio_x, uint16_t pins);
uint16_t gpio_output_data_read(gpio_type *gpio_x);
void gpio_bits_set(gpio_type *gpio_x, uint16_t pins);
void gpio_bits_reset(gpio_type *gpio_x, uint16_t pins);
void gpio_bits_toggle(gpio_type *gpio_x, uint16_t pins);
void gpio_bits_write(gpio_type *gpio_x, uint16_t pins, confirm_state bit_state);
void gpio_port_write(gpio_type *gpio_x, uint16_t port_value);
void gpio_pin_wp_config(gpio_type *gpio_x, uint16_t pins);

View File

@@ -392,7 +392,7 @@ void flash_spim_unlock(void)
{
FLASH->unlock3 = FLASH_UNLOCK_KEY1;
FLASH->unlock3 = FLASH_UNLOCK_KEY2;
UNUSED(*(__IO uint32_t*)USD_BASE);
UNUSED(*(__IO uint32_t*)USD_BASE);
}
/**
@@ -1036,8 +1036,8 @@ void flash_interrupt_enable(uint32_t flash_int, confirm_state new_state)
*/
void flash_spim_model_select(flash_spim_model_type mode)
{
UNUSED(*(__IO uint32_t*)USD_BASE);
FLASH->select = mode;
/* dummy read */
flash_spim_dummy_read();
}

View File

@@ -341,6 +341,37 @@ void gpio_bits_reset(gpio_type *gpio_x, uint16_t pins)
gpio_x->clr = pins;
}
/**
* @brief toggle the selected data port bits.
* @param gpio_x: to select the gpio peripheral.
* this parameter can be one of the following values:
* GPIOA, GPIOB, GPIOC, GPIOD, GPIOE.
* @param pins: gpio pin number
* parameter can be any combination of gpio_pin_x, gpio_pin_x as following values:
* - GPIO_PINS_0
* - GPIO_PINS_1
* - GPIO_PINS_2
* - GPIO_PINS_3
* - GPIO_PINS_4
* - GPIO_PINS_5
* - GPIO_PINS_6
* - GPIO_PINS_7
* - GPIO_PINS_8
* - GPIO_PINS_9
* - GPIO_PINS_10
* - GPIO_PINS_11
* - GPIO_PINS_12
* - GPIO_PINS_13
* - GPIO_PINS_14
* - GPIO_PINS_15
* - GPIO_PINS_ALL
* @retval none
*/
void gpio_bits_toggle(gpio_type *gpio_x, uint16_t pins)
{
gpio_x->odt ^= pins;
}
/**
* @brief set or clear the selected data port bit.
* @param gpio_x: to select the gpio peripheral.

View File

@@ -58,11 +58,11 @@ void rtc_counter_set(uint32_t counter_value)
}
/**
* @brief rtc counter get
* @brief rtc lowlevel counter get
* @param none
* @retval rtc counter
*/
uint32_t rtc_counter_get(void)
uint32_t rtc_lowlevel_counter_get(void)
{
uint32_t cnt = 0;
@@ -72,6 +72,28 @@ uint32_t rtc_counter_get(void)
return cnt;
}
/**
* @brief rtc counter get
* @param none
* @retval rtc counter
*/
uint32_t rtc_counter_get(void)
{
uint32_t cnt1 = 0;
uint32_t cnt2 = 0;
while(1)
{
cnt1 = rtc_lowlevel_counter_get();
cnt2 = rtc_lowlevel_counter_get();
if(cnt1 == cnt2)
{
return cnt1;
}
}
}
/**
* @brief rtc divider set
* @param div_value (0x0000_0000 ~ 0x000F_FFFF)

View File

@@ -104,7 +104,7 @@ void usart_reset(usart_type* usart_x)
* this parameter can be one of the following values:
* - USART_DATA_8BITS
* - USART_DATA_9BITS.
* note
* note:
* - when parity check is disabled, the data bit width is the actual data bit number.
* - when parity check is enabled, the data bit width is the actual data bit number minus 1, and the MSB bit is replaced with the parity bit.
* @param stop_bit: stop bits transmitted