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

📄 stm32f10x_wwdg.lst

📁 STM32利用正交编码器实现电机的控制
💻 LST
📖 第 1 页 / 共 2 页
字号:
     98          /*******************************************************************************
     99          * Function Name  : WWDG_SetWindowValue
    100          * Description    : Sets the WWDG window value.
    101          * Input          : - WindowValue: specifies the window value to be compared to
    102          *                    the downcounter.
    103          *                    This parameter value must be lower than 0x80.
    104          * Output         : None
    105          * Return         : None
    106          *******************************************************************************/
    107          void WWDG_SetWindowValue(u8 WindowValue)
    108          {
    109            u32 tmpreg = 0;
    110          
    111            /* Check the parameters */
    112            assert(IS_WWDG_WINDOW_VALUE(WindowValue));
    113          
    114            /* Clear W[6:0] bits */
    115            tmpreg = WWDG->CFR & CFR_W_Mask;
    116          
    117            /* Set W[6:0] bits according to WindowValue value */
    118            tmpreg |= WindowValue & BIT_Mask;
    119          
    120            /* Store the new value */
    121            WWDG->CFR = tmpreg;
    122          }
    123          
    124          /*******************************************************************************
    125          * Function Name  : WWDG_EnableIT
    126          * Description    : Enables the WWDG Early Wakeup interrupt(EWI).
    127          * Input          : None
    128          * Output         : None
    129          * Return         : None
    130          *******************************************************************************/
    131          void WWDG_EnableIT(void)
    132          {
    133            *(vu32 *) CFR_EWI_BB = (u32)ENABLE;
    134          }
    135          
    136          /*******************************************************************************
    137          * Function Name  : WWDG_SetCounter
    138          * Description    : Sets the WWDG counter value.
    139          * Input          : - Counter: specifies the watchdog counter value.
    140          *                    This parameter must be a number between 0x40 and 0x7F.
    141          * Output         : None
    142          * Return         : None
    143          *******************************************************************************/
    144          void WWDG_SetCounter(u8 Counter)
    145          {
    146            /* Check the parameters */
    147            assert(IS_WWDG_COUNTER(Counter));
    148          
    149            /* Write to T[6:0] bits to configure the counter value, no need to do
    150               a read-modify-write; writing a 0 to WDGA bit does nothing */
    151            WWDG->CR = Counter & BIT_Mask;
    152          }
    153          
    154          /*******************************************************************************
    155          * Function Name  : WWDG_Enable
    156          * Description    : Enables WWDG and load the counter value.
    157          *                  - Counter: specifies the watchdog counter value.
    158          *                    This parameter must be a number between 0x40 and 0x7F.
    159          * Input          : None
    160          * Output         : None
    161          * Return         : None
    162          *******************************************************************************/
    163          void WWDG_Enable(u8 Counter)
    164          {
    165            /* Check the parameters */
    166            assert(IS_WWDG_COUNTER(Counter));
    167          
    168            WWDG->CR = CR_WDGA_Set | Counter;
    169          }
    170          
    171          /*******************************************************************************
    172          * Function Name  : WWDG_GetFlagStatus
    173          * Description    : Checks whether the Early Wakeup interrupt flag is set or not.
    174          * Input          : None
    175          * Output         : None
    176          * Return         : The new state of the Early Wakeup interrupt flag (SET or RESET)
    177          *******************************************************************************/
    178          FlagStatus WWDG_GetFlagStatus(void)
    179          {
    180            return (FlagStatus)(*(vu32 *) SR_EWIF_BB);
    181          }
    182          
    183          /*******************************************************************************
    184          * Function Name  : WWDG_ClearFlag
    185          * Description    : Clears Early Wakeup interrupt flag.
    186          * Input          : None
    187          * Output         : None
    188          * Return         : None
    189          *******************************************************************************/
    190          void WWDG_ClearFlag(void)
    191          {
    192            WWDG->SR = (u32)RESET;
    193          }
    194          
    195          /******************* (C) COPYRIGHT 2007 STMicroelectronics *****END OF FILE****/

   Maximum stack usage in bytes:

     Function            CSTACK
     --------            ------
     WWDG_ClearFlag          0
     WWDG_DeInit             4
     WWDG_Enable             8
     WWDG_EnableIT           0
     WWDG_GetFlagStatus      0
     WWDG_SetCounter         8
     WWDG_SetPrescaler       8
     WWDG_SetWindowValue     8


   Segment part sizes:

     Function/Label                 Bytes
     --------------                 -----
     WWDG_DeInit                      24
     WWDG_SetPrescaler                58
     WWDG_SetWindowValue              44
     WWDG_EnableIT                    12
     WWDG_SetCounter                  32
     WWDG_Enable                      32
     WWDG_GetFlagStatus               16
     WWDG_ClearFlag                   10
     ??DataTable8                      4
     ??DataTable10                     4
     ?<Constant "C:\\David JIANG\\ST MCU...">
                                      92
      Others                          16

 
 252 bytes in segment CODE
  92 bytes in segment DATA_C
 
 236 bytes of CODE  memory (+ 16 bytes shared)
  92 bytes of CONST memory

Errors: none
Warnings: none

⌨️ 快捷键说明

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