mirror of
https://github.com/ArteryTek/AT32F415_Firmware_Library.git
synced 2026-05-21 09:22:11 +00:00
update version to v2.0.4
This commit is contained in:
@@ -1,17 +1,17 @@
|
||||
/**
|
||||
**************************************************************************
|
||||
* @file at32f415_wdt.c
|
||||
* @version v2.0.3
|
||||
* @date 2022-02-11
|
||||
* @version v2.0.4
|
||||
* @date 2022-04-02
|
||||
* @brief contains all the functions for the wdt firmware library
|
||||
**************************************************************************
|
||||
* Copyright notice & Disclaimer
|
||||
*
|
||||
* The software Board Support Package (BSP) that is made available to
|
||||
* download from Artery official website is the copyrighted work of Artery.
|
||||
* Artery authorizes customers to use, copy, and distribute the BSP
|
||||
* software and its related documentation for the purpose of design and
|
||||
* development in conjunction with Artery microcontrollers. Use of the
|
||||
* The software Board Support Package (BSP) that is made available to
|
||||
* download from Artery official website is the copyrighted work of Artery.
|
||||
* Artery authorizes customers to use, copy, and distribute the BSP
|
||||
* software and its related documentation for the purpose of design and
|
||||
* development in conjunction with Artery microcontrollers. Use of the
|
||||
* software is governed by this copyright notice and the following disclaimer.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED ON "AS IS" BASIS WITHOUT WARRANTIES,
|
||||
@@ -40,7 +40,7 @@
|
||||
/** @defgroup WDT_private_functions
|
||||
* @{
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* @brief wdt enable ,the reload value will be sent to the counter
|
||||
* @param none
|
||||
@@ -52,7 +52,7 @@ void wdt_enable(void)
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief reload wdt counter
|
||||
* @brief reload wdt counter
|
||||
* @param none
|
||||
* @retval none
|
||||
*/
|
||||
@@ -62,7 +62,7 @@ void wdt_counter_reload(void)
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief set wdt counter reload value
|
||||
* @brief set wdt counter reload value
|
||||
* @param reload_value (0x0000~0x0FFF)
|
||||
* @retval none
|
||||
*/
|
||||
@@ -72,53 +72,53 @@ void wdt_reload_value_set(uint16_t reload_value)
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief set wdt division divider
|
||||
* @param division
|
||||
* @brief set wdt division divider
|
||||
* @param division
|
||||
* this parameter can be one of the following values:
|
||||
* - WDT_CLK_DIV_4
|
||||
* - WDT_CLK_DIV_8
|
||||
* - WDT_CLK_DIV_16
|
||||
* - WDT_CLK_DIV_32
|
||||
* - WDT_CLK_DIV_64
|
||||
* - WDT_CLK_DIV_128
|
||||
* - WDT_CLK_DIV_256
|
||||
* @retval none
|
||||
* - WDT_CLK_DIV_4
|
||||
* - WDT_CLK_DIV_8
|
||||
* - WDT_CLK_DIV_16
|
||||
* - WDT_CLK_DIV_32
|
||||
* - WDT_CLK_DIV_64
|
||||
* - WDT_CLK_DIV_128
|
||||
* - WDT_CLK_DIV_256
|
||||
* @retval none
|
||||
*/
|
||||
void wdt_divider_set(wdt_division_type division)
|
||||
{
|
||||
{
|
||||
WDT->div_bit.div = division;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief enable or disable wdt cmd register write
|
||||
* @param new_state (TRUE or FALSE)
|
||||
* @retval none
|
||||
* @brief enable or disable wdt cmd register write
|
||||
* @param new_state (TRUE or FALSE)
|
||||
* @retval none
|
||||
*/
|
||||
void wdt_register_write_enable( confirm_state new_state)
|
||||
{
|
||||
{
|
||||
if(new_state == FALSE)
|
||||
{
|
||||
WDT->cmd = WDT_CMD_LOCK;
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
WDT->cmd = WDT_CMD_UNLOCK;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief get wdt flag
|
||||
* @param wdt_flag
|
||||
* @brief get wdt flag
|
||||
* @param wdt_flag
|
||||
* this parameter can be one of the following values:
|
||||
* - WDT_DIVF_UPDATE_FLAG: division value update complete flag.
|
||||
* - WDT_RLDF_UPDATE_FLAG: reload value update complete flag.
|
||||
* @retval state of wdt flag
|
||||
* - WDT_DIVF_UPDATE_FLAG: division value update complete flag.
|
||||
* - WDT_RLDF_UPDATE_FLAG: reload value update complete flag.
|
||||
* @retval state of wdt flag
|
||||
*/
|
||||
flag_status wdt_flag_get(uint16_t wdt_flag)
|
||||
{
|
||||
{
|
||||
flag_status status = RESET;
|
||||
|
||||
if ((WDT->sts & wdt_flag) != (uint16_t)RESET)
|
||||
if ((WDT->sts & wdt_flag) != (uint16_t)RESET)
|
||||
{
|
||||
status = SET;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user