mbed library sources. Supersedes mbed-src.
Fork of mbed-dev by
targets/TARGET_NUVOTON/TARGET_M451/device/StdDriver/m451_wdt.c@149:156823d33999, 2016-10-28 (annotated)
- Committer:
- <>
- Date:
- Fri Oct 28 11:17:30 2016 +0100
- Revision:
- 149:156823d33999
This updates the lib to the mbed lib v128
NOTE: This release includes a restructuring of the file and directory locations and thus some
include paths in your code may need updating accordingly.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
<> | 149:156823d33999 | 1 | /**************************************************************************//** |
<> | 149:156823d33999 | 2 | * @file wdt.c |
<> | 149:156823d33999 | 3 | * @version V3.00 |
<> | 149:156823d33999 | 4 | * $Revision: 5 $ |
<> | 149:156823d33999 | 5 | * $Date: 15/08/11 10:26a $ |
<> | 149:156823d33999 | 6 | * @brief M451 series WDT driver source file |
<> | 149:156823d33999 | 7 | * |
<> | 149:156823d33999 | 8 | * @note |
<> | 149:156823d33999 | 9 | * Copyright (C) 2013~2015 Nuvoton Technology Corp. All rights reserved. |
<> | 149:156823d33999 | 10 | *****************************************************************************/ |
<> | 149:156823d33999 | 11 | #include "M451Series.h" |
<> | 149:156823d33999 | 12 | |
<> | 149:156823d33999 | 13 | |
<> | 149:156823d33999 | 14 | /** @addtogroup Standard_Driver Standard Driver |
<> | 149:156823d33999 | 15 | @{ |
<> | 149:156823d33999 | 16 | */ |
<> | 149:156823d33999 | 17 | |
<> | 149:156823d33999 | 18 | /** @addtogroup WDT_Driver WDT Driver |
<> | 149:156823d33999 | 19 | @{ |
<> | 149:156823d33999 | 20 | */ |
<> | 149:156823d33999 | 21 | |
<> | 149:156823d33999 | 22 | /** @addtogroup WDT_EXPORTED_FUNCTIONS WDT Exported Functions |
<> | 149:156823d33999 | 23 | @{ |
<> | 149:156823d33999 | 24 | */ |
<> | 149:156823d33999 | 25 | |
<> | 149:156823d33999 | 26 | /** |
<> | 149:156823d33999 | 27 | * @brief Initialize WDT and start counting |
<> | 149:156823d33999 | 28 | * |
<> | 149:156823d33999 | 29 | * @param[in] u32TimeoutInterval Time-out interval period of WDT module. Valid values are: |
<> | 149:156823d33999 | 30 | * - \ref WDT_TIMEOUT_2POW4 |
<> | 149:156823d33999 | 31 | * - \ref WDT_TIMEOUT_2POW6 |
<> | 149:156823d33999 | 32 | * - \ref WDT_TIMEOUT_2POW8 |
<> | 149:156823d33999 | 33 | * - \ref WDT_TIMEOUT_2POW10 |
<> | 149:156823d33999 | 34 | * - \ref WDT_TIMEOUT_2POW12 |
<> | 149:156823d33999 | 35 | * - \ref WDT_TIMEOUT_2POW14 |
<> | 149:156823d33999 | 36 | * - \ref WDT_TIMEOUT_2POW16 |
<> | 149:156823d33999 | 37 | * - \ref WDT_TIMEOUT_2POW18 |
<> | 149:156823d33999 | 38 | * @param[in] u32ResetDelay Configure WDT time-out reset delay period. Valid values are: |
<> | 149:156823d33999 | 39 | * - \ref WDT_RESET_DELAY_1026CLK |
<> | 149:156823d33999 | 40 | * - \ref WDT_RESET_DELAY_130CLK |
<> | 149:156823d33999 | 41 | * - \ref WDT_RESET_DELAY_18CLK |
<> | 149:156823d33999 | 42 | * - \ref WDT_RESET_DELAY_3CLK |
<> | 149:156823d33999 | 43 | * @param[in] u32EnableReset Enable WDT time-out reset system function. Valid values are TRUE and FALSE. |
<> | 149:156823d33999 | 44 | * @param[in] u32EnableWakeup Enable WDT time-out wake-up system function. Valid values are TRUE and FALSE. |
<> | 149:156823d33999 | 45 | * |
<> | 149:156823d33999 | 46 | * @return None |
<> | 149:156823d33999 | 47 | * |
<> | 149:156823d33999 | 48 | * @details This function makes WDT module start counting with different time-out interval, reset delay period and choose to \n |
<> | 149:156823d33999 | 49 | * enable or disable WDT time-out reset system or wake-up system. |
<> | 149:156823d33999 | 50 | * @note Please make sure that Register Write-Protection Function has been disabled before using this function. |
<> | 149:156823d33999 | 51 | */ |
<> | 149:156823d33999 | 52 | void WDT_Open(uint32_t u32TimeoutInterval, |
<> | 149:156823d33999 | 53 | uint32_t u32ResetDelay, |
<> | 149:156823d33999 | 54 | uint32_t u32EnableReset, |
<> | 149:156823d33999 | 55 | uint32_t u32EnableWakeup) |
<> | 149:156823d33999 | 56 | { |
<> | 149:156823d33999 | 57 | WDT->ALTCTL = u32ResetDelay; |
<> | 149:156823d33999 | 58 | |
<> | 149:156823d33999 | 59 | WDT->CTL = u32TimeoutInterval | WDT_CTL_WDTEN_Msk | |
<> | 149:156823d33999 | 60 | (u32EnableReset << WDT_CTL_RSTEN_Pos) | |
<> | 149:156823d33999 | 61 | (u32EnableWakeup << WDT_CTL_WKEN_Pos); |
<> | 149:156823d33999 | 62 | return; |
<> | 149:156823d33999 | 63 | } |
<> | 149:156823d33999 | 64 | |
<> | 149:156823d33999 | 65 | /*@}*/ /* end of group WDT_EXPORTED_FUNCTIONS */ |
<> | 149:156823d33999 | 66 | |
<> | 149:156823d33999 | 67 | /*@}*/ /* end of group WDT_Driver */ |
<> | 149:156823d33999 | 68 | |
<> | 149:156823d33999 | 69 | /*@}*/ /* end of group Standard_Driver */ |
<> | 149:156823d33999 | 70 | |
<> | 149:156823d33999 | 71 | /*** (C) COPYRIGHT 2013~2015 Nuvoton Technology Corp. ***/ |