Senior Design: Sound Monitor / STM32L4xx_HAL_Driver
Embed: (wiki syntax)

« Back to documentation index

stm32l4xx_hal_wwdg.c File Reference

stm32l4xx_hal_wwdg.c File Reference

WWDG HAL module driver. This file provides firmware functions to manage the following functionalities of the Window Watchdog (WWDG) peripheral: + Initialization and de-initialization functions + IO operation functions + Peripheral State functions. More...

Go to the source code of this file.

Functions

HAL_StatusTypeDef HAL_WWDG_Init (WWDG_HandleTypeDef *hwwdg)
 Initialize the WWDG according to the specified parameters in the WWDG_InitTypeDef and initialize the associated handle.
HAL_StatusTypeDef HAL_WWDG_DeInit (WWDG_HandleTypeDef *hwwdg)
 DeInitialize the WWDG peripheral.
__weak void HAL_WWDG_MspInit (WWDG_HandleTypeDef *hwwdg)
 Initialize the WWDG MSP.
__weak void HAL_WWDG_MspDeInit (WWDG_HandleTypeDef *hwwdg)
 DeInitialize the WWDG MSP.
HAL_StatusTypeDef HAL_WWDG_Start (WWDG_HandleTypeDef *hwwdg)
 Start the WWDG.
HAL_StatusTypeDef HAL_WWDG_Start_IT (WWDG_HandleTypeDef *hwwdg)
 Start the WWDG with interrupt enabled.
HAL_StatusTypeDef HAL_WWDG_Refresh (WWDG_HandleTypeDef *hwwdg, uint32_t Counter)
 Refresh the WWDG.
void HAL_WWDG_IRQHandler (WWDG_HandleTypeDef *hwwdg)
 Handle WWDG interrupt request.
__weak void HAL_WWDG_WakeupCallback (WWDG_HandleTypeDef *hwwdg)
 Early Wakeup WWDG callback.
HAL_WWDG_StateTypeDef HAL_WWDG_GetState (WWDG_HandleTypeDef *hwwdg)
 Return the WWDG handle state.

Detailed Description

WWDG HAL module driver. This file provides firmware functions to manage the following functionalities of the Window Watchdog (WWDG) peripheral: + Initialization and de-initialization functions + IO operation functions + Peripheral State functions.

Author:
MCD Application Team
Version:
V1.1.0
Date:
16-September-2015
  ==============================================================================
                      ##### WWDG specific features #####
  ==============================================================================
  [..] 
    Once enabled the WWDG generates a system reset on expiry of a programmed
    time period, unless the program refreshes the counter (T[6;0] downcounter)
    before reaching 0x3F value (i.e. a reset is generated when the counter
    value rolls over from 0x40 to 0x3F).

    (+) An MCU reset is also generated if the counter value is refreshed
        before the counter has reached the refresh window value. This
        implies that the counter must be refreshed in a limited window.
    (+) Once enabled the WWDG cannot be disabled except by a system reset.
    (+) WWDGRST flag in RCC_CSR register informs when a WWDG reset has 
        occurred (check available with __HAL_RCC_GET_FLAG(RCC_FLAG_WWDGRST)).               
    (+) The WWDG counter input clock is derived from the APB clock divided
        by a programmable prescaler.
    (+) WWDG clock (Hz) = PCLK1 / (4096 * Prescaler)
    (+) WWDG timeout (mS) = 1000 * (T[5;0] + 1) / WWDG clock
        where T[5;0] are the lowest 6 bits of Counter.
    (+) WWDG Counter refresh is allowed between the following limits :
        (++) min time (mS) = 1000 * (Counter - Window) / WWDG clock
        (++) max time (mS) = 1000 * (Counter - 0x40) / WWDG clock
    (+) Min-max timeout value @80 MHz(PCLK1): ~51.2 us / ~26.22 ms


                     ##### How to use this driver #####
  ==============================================================================
  [..]
    (+) Enable WWDG APB1 clock using __HAL_RCC_WWDG_CLK_ENABLE().
    (+) Set the WWDG prescaler, refresh window and counter value
        using HAL_WWDG_Init() function.
    (+) Start the WWDG using HAL_WWDG_Start() function.
        When the WWDG is enabled the counter value should be configured to
        a value greater than 0x40 to prevent generating an immediate reset.
    (+) Optionally you can enable the Early Wakeup Interrupt (EWI) which is
        generated when the counter reaches 0x40, and then start the WWDG using
        HAL_WWDG_Start_IT(). At EWI HAL_WWDG_WakeupCallback() is executed and user can 
        add his own code by customization of function pointer HAL_WWDG_WakeupCallback().
        Once enabled, EWI interrupt cannot be disabled except by a system reset.
    (+) The application program must refresh the WWDG counter at regular
        intervals during normal operation to prevent an MCU reset using
        HAL_WWDG_Refresh() function. This operation must occur only when
        the counter is lower than the refresh window value already programmed.

     *** WWDG HAL driver macros list ***
     ==================================
     [..]
       Below the list of most used macros in WWDG HAL driver.
       
      (+) __HAL_WWDG_ENABLE: Enable the WWDG peripheral 
      (+) __HAL_WWDG_ENABLE_IT: Enable the WWDG early wakeup interrupt
      (+) __HAL_WWDG_GET_IT_SOURCE: Check the selected WWDG's interrupt source 
      (+) __HAL_WWDG_GET_FLAG: Get the selected WWDG's flag status
      (+) __HAL_WWDG_CLEAR_FLAG: Clear the WWDG's pending flags 

  
Attention:

© COPYRIGHT(c) 2015 STMicroelectronics

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. Neither the name of STMicroelectronics nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Definition in file stm32l4xx_hal_wwdg.c.