⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 stm32f10x_iwdg.lst

📁 STM32利用正交编码器实现电机的控制
💻 LST
字号:
##############################################################################
#                                                                            #
# IAR ARM ANSI C/C++ Compiler V4.42A/W32               15/May/2008  12:06:31 #
# Copyright 1999-2005 IAR Systems. All rights reserved.                      #
#                                                                            #
#    Cpu mode        =  thumb                                                #
#    Endian          =  little                                               #
#    Stack alignment =  4                                                    #
#    Source file     =  C:\David JIANG\ST MCU\Docs\STM32\AN_JIANG\TIM        #
#                       Encoder\example\FWLib\src\stm32f10x_iwdg.c           #
#    Command line    =  "C:\David JIANG\ST MCU\Docs\STM32\AN_JIANG\TIM       #
#                       Encoder\example\FWLib\src\stm32f10x_iwdg.c" -D       #
#                       VECT_TAB_FLASH -lcN "C:\David JIANG\ST               #
#                       MCU\Docs\STM32\AN_JIANG\TIM                          #
#                       Encoder\example\project\EWARM\BOOT_FLASH\List\" -lb  #
#                       "C:\David JIANG\ST MCU\Docs\STM32\AN_JIANG\TIM       #
#                       Encoder\example\project\EWARM\BOOT_FLASH\List\" -o   #
#                       "C:\David JIANG\ST MCU\Docs\STM32\AN_JIANG\TIM       #
#                       Encoder\example\project\EWARM\BOOT_FLASH\Obj\" -z3   #
#                       --no_cse --no_unroll --no_inline --no_code_motion    #
#                       --no_tbaa --no_clustering --no_scheduling --debug    #
#                       --cpu_mode thumb --endian little --cpu cortex-M3     #
#                       --stack_align 4 --require_prototypes --fpu None      #
#                       --dlib_config "C:\Program Files\IAR                  #
#                       Systems\Embedded Workbench                           #
#                       4.0\arm\LIB\dl7mptnnl8f.h" -I "C:\David JIANG\ST     #
#                       MCU\Docs\STM32\AN_JIANG\TIM                          #
#                       Encoder\example\project\EWARM\" -I "C:\David         #
#                       JIANG\ST MCU\Docs\STM32\AN_JIANG\TIM                 #
#                       Encoder\example\project\EWARM\..\include\" -I        #
#                       "C:\David JIANG\ST MCU\Docs\STM32\AN_JIANG\TIM       #
#                       Encoder\example\project\EWARM\..\..\FWLib\inc\" -I   #
#                       "C:\Program Files\IAR Systems\Embedded Workbench     #
#                       4.0\arm\INC\"                                        #
#    List file       =  C:\David JIANG\ST MCU\Docs\STM32\AN_JIANG\TIM        #
#                       Encoder\example\project\EWARM\BOOT_FLASH\List\stm32f #
#                       10x_iwdg.lst                                         #
#    Object file     =  C:\David JIANG\ST MCU\Docs\STM32\AN_JIANG\TIM        #
#                       Encoder\example\project\EWARM\BOOT_FLASH\Obj\stm32f1 #
#                       0x_iwdg.r79                                          #
#                                                                            #
#                                                                            #
##############################################################################

C:\David JIANG\ST MCU\Docs\STM32\AN_JIANG\TIM Encoder\example\FWLib\src\stm32f10x_iwdg.c
      1          /******************** (C) COPYRIGHT 2007 STMicroelectronics ********************
      2          * File Name          : stm32f10x_iwdg.c
      3          * Author             : MCD Application Team
      4          * Date First Issued  : 09/29/2006
      5          * Description        : This file provides all the IWDG firmware functions.
      6          ********************************************************************************
      7          * History:
      8          * 05/21/2007: V0.3
      9          * 04/02/2007: V0.2
     10          * 02/05/2007: V0.1
     11          * 09/29/2006: V0.01
     12          ********************************************************************************
     13          * THE PRESENT SOFTWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS
     14          * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE TIME.
     15          * AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY DIRECT,
     16          * INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING FROM THE
     17          * CONTENT OF SUCH SOFTWARE AND/OR THE USE MADE BY CUSTOMERS OF THE CODING
     18          * INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
     19          *******************************************************************************/
     20          
     21          /* Includes ------------------------------------------------------------------*/
     22          #include "stm32f10x_iwdg.h"
     23          
     24          /* Private typedef -----------------------------------------------------------*/
     25          /* Private define ------------------------------------------------------------*/
     26          /* ---------------------- IWDG registers bit mask ------------------------ */
     27          /* KR register bit mask */
     28          #define KR_Reload    ((u16)0xAAAA)
     29          #define KR_Enable    ((u16)0xCCCC)
     30          
     31          /* Private macro -------------------------------------------------------------*/
     32          /* Private variables ---------------------------------------------------------*/
     33          /* Private function prototypes -----------------------------------------------*/
     34          /* Private functions ---------------------------------------------------------*/
     35          
     36          /*******************************************************************************
     37          * Function Name  : IWDG_WriteAccessCmd
     38          * Description    : Enables or disables write access to IWDG_PR and IWDG_RLR
     39          *                  registers.
     40          * Input          : - IWDG_WriteAccess: new state of write access to IWDG_PR and
     41          *                    IWDG_RLR registers.
     42          *                    This parameter can be one of the following values:
     43          *                       - IWDG_WriteAccess_Enable: Enable write access to 
     44          *                         IWDG_PR and IWDG_RLR registers
     45          *                       - IWDG_WriteAccess_Disable: Disable write access to
     46          *                         IWDG_PR and IWDG_RLR registers
     47          * Output         : None
     48          * Return         : None
     49          *******************************************************************************/
     50          void IWDG_WriteAccessCmd(u16 IWDG_WriteAccess)
     51          {
     52            /* Check the parameters */
     53            assert(IS_IWDG_WRITE_ACCESS(IWDG_WriteAccess));
     54          
     55            IWDG->KR = IWDG_WriteAccess;
     56          }
     57          
     58          /*******************************************************************************
     59          * Function Name  : IWDG_SetPrescaler
     60          * Description    : Sets IWDG Prescaler value.
     61          * Input          : - IWDG_Prescaler: specifies the IWDG Prescaler value.
     62          *                    This parameter can be one of the following values:
     63          *                       - IWDG_Prescaler_4: IWDG prescaler set to 4
     64          *                       - IWDG_Prescaler_8: IWDG prescaler set to 8
     65          *                       - IWDG_Prescaler_16: IWDG prescaler set to 16
     66          *                       - IWDG_Prescaler_32: IWDG prescaler set to 32
     67          *                       - IWDG_Prescaler_64: IWDG prescaler set to 64
     68          *                       - IWDG_Prescaler_128: IWDG prescaler set to 128
     69          *                       - IWDG_Prescaler_256: IWDG prescaler set to 256
     70          * Output         : None
     71          * Return         : None
     72          *******************************************************************************/
     73          void IWDG_SetPrescaler(u8 IWDG_Prescaler)
     74          {
     75            /* Check the parameters */
     76            assert(IS_IWDG_PRESCALER(IWDG_Prescaler));
     77          
     78            IWDG->PR = IWDG_Prescaler;
     79          }
     80          
     81          /*******************************************************************************
     82          * Function Name  : IWDG_SetReload
     83          * Description    : Sets IWDG Reload value.
     84          * Input          : - Reload: specifies the IWDG Reload value.
     85          *                    This parameter must be a number between 0 and 0x0FFF.
     86          * Output         : None
     87          * Return         : None
     88          *******************************************************************************/
     89          void IWDG_SetReload(u16 Reload)
     90          {
     91            /* Check the parameters */
     92            assert(IS_IWDG_RELOAD(Reload));
     93          
     94            IWDG->RLR = Reload;
     95          }
     96          
     97          /*******************************************************************************
     98          * Function Name  : IWDG_ReloadCounter
     99          * Description    : Reloads IWDG counter with value defined in the reload register
    100          *                  (write access to IWDG_PR and IWDG_RLR registers disabled).
    101          * Input          : None
    102          * Output         : None
    103          * Return         : None
    104          *******************************************************************************/
    105          void IWDG_ReloadCounter(void)
    106          {
    107            IWDG->KR = KR_Reload;
    108          }
    109          
    110          /*******************************************************************************
    111          * Function Name  : IWDG_Enable
    112          * Description    : Enables IWDG (write access to IWDG_PR and IWDG_RLR registers
    113          *                  disabled).
    114          * Input          : None
    115          * Output         : None
    116          * Return         : None
    117          *******************************************************************************/
    118          void IWDG_Enable(void)
    119          {
    120            IWDG->KR = KR_Enable;
    121          }
    122          
    123          /*******************************************************************************
    124          * Function Name  : IWDG_GetFlagStatus
    125          * Description    : Checks whether the specified IWDG flag is set or not.
    126          * Input          : - IWDG_FLAG: specifies the flag to check.
    127          *                    This parameter can be one of the following values:
    128          *                       - IWDG_FLAG_PVU: Prescaler Value Update on going
    129          *                       - IWDG_FLAG_RVU: Reload Value Update on going
    130          * Output         : None
    131          * Return         : The new state of IWDG_FLAG (SET or RESET).
    132          *******************************************************************************/
    133          FlagStatus IWDG_GetFlagStatus(u16 IWDG_FLAG)
    134          {
    135            FlagStatus bitstatus = RESET;
    136          
    137            /* Check the parameters */
    138            assert(IS_IWDG_FLAG(IWDG_FLAG));
    139          
    140            if ((IWDG->SR & IWDG_FLAG) != (u32)RESET)
    141            {
    142              bitstatus = SET;
    143            }
    144            else
    145            {
    146              bitstatus = RESET;
    147            }
    148          
    149            /* Return the flag status */
    150            return bitstatus;
    151          }
    152          
    153          /******************* (C) COPYRIGHT 2007 STMicroelectronics *****END OF FILE****/

   Maximum stack usage in bytes:

     Function            CSTACK
     --------            ------
     IWDG_Enable             0
     IWDG_GetFlagStatus      8
     IWDG_ReloadCounter      0
     IWDG_SetPrescaler       8
     IWDG_SetReload          8
     IWDG_WriteAccessCmd     8


   Segment part sizes:

     Function/Label                 Bytes
     --------------                 -----
     IWDG_WriteAccessCmd              36
     IWDG_SetPrescaler                48
     IWDG_SetReload                   28
     IWDG_ReloadCounter               16
     IWDG_Enable                      16
     IWDG_GetFlagStatus               40
     ??DataTable8                      4
     ??DataTable9                      4
     ?<Constant "C:\\David JIANG\\ST MCU...">
                                      92
      Others                           8

 
 200 bytes in segment CODE
  92 bytes in segment DATA_C
 
 192 bytes of CODE  memory (+ 8 bytes shared)
  92 bytes of CONST memory

Errors: none
Warnings: none

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -