Mouse code for the MacroRat

Dependencies:   ITG3200 QEI

Committer:
sahilmgandhi
Date:
Sat Jun 03 00:22:44 2017 +0000
Revision:
46:b156ef445742
Parent:
18:6a4db94011d3
Final code for internal battlebot competition.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
sahilmgandhi 18:6a4db94011d3 1 /**************************************************************************//**
sahilmgandhi 18:6a4db94011d3 2 * @file wdt.c
sahilmgandhi 18:6a4db94011d3 3 * @version V1.00
sahilmgandhi 18:6a4db94011d3 4 * $Revision: 6 $
sahilmgandhi 18:6a4db94011d3 5 * $Date: 14/10/02 7:19p $
sahilmgandhi 18:6a4db94011d3 6 * @brief NUC472/NUC442 WDT driver source file
sahilmgandhi 18:6a4db94011d3 7 *
sahilmgandhi 18:6a4db94011d3 8 * @note
sahilmgandhi 18:6a4db94011d3 9 * Copyright (C) 2013 Nuvoton Technology Corp. All rights reserved.
sahilmgandhi 18:6a4db94011d3 10 *****************************************************************************/
sahilmgandhi 18:6a4db94011d3 11 #include "NUC472_442.h"
sahilmgandhi 18:6a4db94011d3 12
sahilmgandhi 18:6a4db94011d3 13 /** @addtogroup NUC472_442_Device_Driver NUC472/NUC442 Device Driver
sahilmgandhi 18:6a4db94011d3 14 @{
sahilmgandhi 18:6a4db94011d3 15 */
sahilmgandhi 18:6a4db94011d3 16
sahilmgandhi 18:6a4db94011d3 17 /** @addtogroup NUC472_442_WDT_Driver WDT Driver
sahilmgandhi 18:6a4db94011d3 18 @{
sahilmgandhi 18:6a4db94011d3 19 */
sahilmgandhi 18:6a4db94011d3 20
sahilmgandhi 18:6a4db94011d3 21
sahilmgandhi 18:6a4db94011d3 22 /** @addtogroup NUC472_442_WDT_EXPORTED_FUNCTIONS WDT Exported Functions
sahilmgandhi 18:6a4db94011d3 23 @{
sahilmgandhi 18:6a4db94011d3 24 */
sahilmgandhi 18:6a4db94011d3 25
sahilmgandhi 18:6a4db94011d3 26 /**
sahilmgandhi 18:6a4db94011d3 27 * @brief This function make WDT module start counting with different time-out interval
sahilmgandhi 18:6a4db94011d3 28 * @param[in] u32TimeoutInterval Time-out interval period of WDT module. Valid values are:
sahilmgandhi 18:6a4db94011d3 29 * - \ref WDT_TIMEOUT_2POW4
sahilmgandhi 18:6a4db94011d3 30 * - \ref WDT_TIMEOUT_2POW6
sahilmgandhi 18:6a4db94011d3 31 * - \ref WDT_TIMEOUT_2POW8
sahilmgandhi 18:6a4db94011d3 32 * - \ref WDT_TIMEOUT_2POW10
sahilmgandhi 18:6a4db94011d3 33 * - \ref WDT_TIMEOUT_2POW12
sahilmgandhi 18:6a4db94011d3 34 * - \ref WDT_TIMEOUT_2POW14
sahilmgandhi 18:6a4db94011d3 35 * - \ref WDT_TIMEOUT_2POW16
sahilmgandhi 18:6a4db94011d3 36 * - \ref WDT_TIMEOUT_2POW18
sahilmgandhi 18:6a4db94011d3 37 * @param[in] u32ResetDelay Reset delay period while WDT time-out happened. Valid values are:
sahilmgandhi 18:6a4db94011d3 38 * - \ref WDT_RESET_DELAY_3CLK
sahilmgandhi 18:6a4db94011d3 39 * - \ref WDT_RESET_DELAY_18CLK
sahilmgandhi 18:6a4db94011d3 40 * - \ref WDT_RESET_DELAY_130CLK
sahilmgandhi 18:6a4db94011d3 41 * - \ref WDT_RESET_DELAY_1026CLK
sahilmgandhi 18:6a4db94011d3 42 * @param[in] u32EnableReset Enable WDT rest system function. Valid values are \ref TRUE and \ref FALSE
sahilmgandhi 18:6a4db94011d3 43 * @param[in] u32EnableWakeup Enable WDT wake-up system function. Valid values are \ref TRUE and \ref FALSE
sahilmgandhi 18:6a4db94011d3 44 * @return None
sahilmgandhi 18:6a4db94011d3 45 */
sahilmgandhi 18:6a4db94011d3 46 void WDT_Open(uint32_t u32TimeoutInterval,
sahilmgandhi 18:6a4db94011d3 47 uint32_t u32ResetDelay,
sahilmgandhi 18:6a4db94011d3 48 uint32_t u32EnableReset,
sahilmgandhi 18:6a4db94011d3 49 uint32_t u32EnableWakeup)
sahilmgandhi 18:6a4db94011d3 50 {
sahilmgandhi 18:6a4db94011d3 51
sahilmgandhi 18:6a4db94011d3 52 WDT->CTL = u32TimeoutInterval | u32ResetDelay | WDT_CTL_WDTEN_Msk |
sahilmgandhi 18:6a4db94011d3 53 (u32EnableReset << WDT_CTL_RSTEN_Pos) |
sahilmgandhi 18:6a4db94011d3 54 (u32EnableWakeup << WDT_CTL_WKEN_Pos);
sahilmgandhi 18:6a4db94011d3 55 return;
sahilmgandhi 18:6a4db94011d3 56 }
sahilmgandhi 18:6a4db94011d3 57
sahilmgandhi 18:6a4db94011d3 58
sahilmgandhi 18:6a4db94011d3 59 /*@}*/ /* end of group NUC472_442_WDT_EXPORTED_FUNCTIONS */
sahilmgandhi 18:6a4db94011d3 60
sahilmgandhi 18:6a4db94011d3 61 /*@}*/ /* end of group NUC472_442_WDT_Driver */
sahilmgandhi 18:6a4db94011d3 62
sahilmgandhi 18:6a4db94011d3 63 /*@}*/ /* end of group NUC472_442_Device_Driver */
sahilmgandhi 18:6a4db94011d3 64
sahilmgandhi 18:6a4db94011d3 65 /*** (C) COPYRIGHT 2013 Nuvoton Technology Corp. ***/