📄 stm32f10x_wwdg.lst
字号:
###############################################################################
# #
# 30/Jul/2008 14:37:36 #
# IAR ARM ANSI C/C++ Compiler V5.11.0.20622/W32 EVALUATION #
# Copyright 1999-2007 IAR Systems. All rights reserved. #
# #
# Cpu mode = thumb #
# Endian = little #
# Source file = E:\library\src\stm32f10x_wwdg.c #
# Command line = E:\library\src\stm32f10x_wwdg.c -D EMB_FLASH -lCN #
# E:\ELE\yten\pro\Debug\List\ -lb #
# E:\ELE\yten\pro\Debug\List\ -o #
# E:\ELE\yten\pro\Debug\Obj\ --no_cse --no_unroll #
# --no_inline --no_code_motion --no_tbaa --no_clustering #
# --no_scheduling --debug --endian little --cpu Cortex-M3 #
# -e --fpu None --dlib_config "C:\Program Files\IAR #
# Systems\Embedded Workbench 5.0 #
# Evaluation\ARM\INC\DLib_Config_Normal.h" -I #
# E:\ELE\yten\pro\ -I E:\ELE\yten\pro\..\LIBRARY\INC\ -I #
# "C:\Program Files\IAR Systems\Embedded Workbench 5.0 #
# Evaluation\ARM\INC\" --section .text=.XML -On #
# List file = E:\ELE\yten\pro\Debug\List\stm32f10x_wwdg.lst #
# Object file = E:\ELE\yten\pro\Debug\Obj\stm32f10x_wwdg.o #
# #
# #
###############################################################################
E:\library\src\stm32f10x_wwdg.c
1 /******************** (C) COPYRIGHT 2007 STMicroelectronics ********************
2 * File Name : stm32f10x_wwdg.c
3 * Author : MCD Application Team
4 * Version : V1.0
5 * Date : 10/08/2007
6 * Description : This file provides all the WWDG firmware functions.
7 ********************************************************************************
8 * THE PRESENT SOFTWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS
9 * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE TIME.
10 * AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY DIRECT,
11 * INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING FROM THE
12 * CONTENT OF SUCH SOFTWARE AND/OR THE USE MADE BY CUSTOMERS OF THE CODING
13 * INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
14 *******************************************************************************/
15
16 /* Includes ------------------------------------------------------------------*/
17 #include "stm32f10x_wwdg.h"
18 #include "stm32f10x_rcc.h"
19
20 /* Private typedef -----------------------------------------------------------*/
21 /* Private define ------------------------------------------------------------*/
22 /* ----------- WWDG registers bit address in the alias region ----------- */
23 #define WWDG_OFFSET (WWDG_BASE - PERIPH_BASE)
24
25 /* Alias word address of EWI bit */
26 #define CFR_OFFSET (WWDG_OFFSET + 0x04)
27 #define EWI_BitNumber 0x09
28 #define CFR_EWI_BB (PERIPH_BB_BASE + (CFR_OFFSET * 32) + (EWI_BitNumber * 4))
29
30 /* Alias word address of EWIF bit */
31 #define SR_OFFSET (WWDG_OFFSET + 0x08)
32 #define EWIF_BitNumber 0x00
33 #define SR_EWIF_BB (PERIPH_BB_BASE + (SR_OFFSET * 32) + (EWIF_BitNumber * 4))
34
35 /* --------------------- WWDG registers bit mask ------------------------ */
36 /* CR register bit mask */
37 #define CR_WDGA_Set ((u32)0x00000080)
38
39 /* CFR register bit mask */
40 #define CFR_WDGTB_Mask ((u32)0xFFFFFE7F)
41 #define CFR_W_Mask ((u32)0xFFFFFF80)
42
43 #define BIT_Mask ((u8)0x7F)
44
45 /* Private macro -------------------------------------------------------------*/
46 /* Private variables ---------------------------------------------------------*/
47 /* Private function prototypes -----------------------------------------------*/
48 /* Private functions ---------------------------------------------------------*/
49
50 /*******************************************************************************
51 * Function Name : WWDG_DeInit
52 * Description : Deinitializes the WWDG peripheral registers to their default
53 * reset values.
54 * Input : None
55 * Output : None
56 * Return : None
57 *******************************************************************************/
\ In section .XML, align 4, keep-with-next
58 void WWDG_DeInit(void)
59 {
\ WWDG_DeInit:
\ 00000000 01B5 PUSH {R0,LR}
60 RCC_APB1PeriphResetCmd(RCC_APB1Periph_WWDG, ENABLE);
\ 00000002 0121 MOVS R1,#+1
\ 00000004 5FF40060 MOVS R0,#+2048
\ 00000008 ........ BL RCC_APB1PeriphResetCmd
61 RCC_APB1PeriphResetCmd(RCC_APB1Periph_WWDG, DISABLE);
\ 0000000C 0021 MOVS R1,#+0
\ 0000000E 5FF40060 MOVS R0,#+2048
\ 00000012 ........ BL RCC_APB1PeriphResetCmd
62 }
\ 00000016 01B0 ADD SP,SP,#+4
\ 00000018 00BD POP {PC} ;; return
63
64 /*******************************************************************************
65 * Function Name : WWDG_SetPrescaler
66 * Description : Sets the WWDG Prescaler.
67 * Input : - WWDG_Prescaler: specifies the WWDG Prescaler.
68 * This parameter can be one of the following values:
69 * - WWDG_Prescaler_1: WWDG counter clock = (PCLK1/4096)/1
70 * - WWDG_Prescaler_2: WWDG counter clock = (PCLK1/4096)/2
71 * - WWDG_Prescaler_4: WWDG counter clock = (PCLK1/4096)/4
72 * - WWDG_Prescaler_8: WWDG counter clock = (PCLK1/4096)/8
73 * Output : None
74 * Return : None
75 *******************************************************************************/
\ In section .XML, align 4, keep-with-next
76 void WWDG_SetPrescaler(u32 WWDG_Prescaler)
77 {
78 u32 tmpreg = 0;
\ WWDG_SetPrescaler:
\ 00000000 0022 MOVS R2,#+0
\ 00000002 1100 MOVS R1,R2
79
80 /* Check the parameters */
81 assert_param(IS_WWDG_PRESCALER(WWDG_Prescaler));
82
83 /* Clear WDGTB[8:7] bits */
84 tmpreg = WWDG->CFR & CFR_WDGTB_Mask;
\ 00000004 .... LDR.N R2,??DataTable3 ;; 0x40002c04
\ 00000006 1268 LDR R2,[R2, #+0]
\ 00000008 7FF4C073 MVNS R3,#+384
\ 0000000C 1340 ANDS R3,R3,R2
\ 0000000E 1900 MOVS R1,R3
85
86 /* Set WDGTB[8:7] bits according to WWDG_Prescaler value */
87 tmpreg |= WWDG_Prescaler;
\ 00000010 0143 ORRS R1,R1,R0
88
89 /* Store the new value */
90 WWDG->CFR = tmpreg;
\ 00000012 .... LDR.N R2,??DataTable3 ;; 0x40002c04
\ 00000014 1160 STR R1,[R2, #+0]
91 }
\ 00000016 7047 BX LR ;; return
92
93 /*******************************************************************************
94 * Function Name : WWDG_SetWindowValue
95 * Description : Sets the WWDG window value.
96 * Input : - WindowValue: specifies the window value to be compared to
97 * the downcounter.
98 * This parameter value must be lower than 0x80.
99 * Output : None
100 * Return : None
101 *******************************************************************************/
\ In section .XML, align 4, keep-with-next
102 void WWDG_SetWindowValue(u8 WindowValue)
103 {
104 u32 tmpreg = 0;
\ WWDG_SetWindowValue:
\ 00000000 0022 MOVS R2,#+0
\ 00000002 1100 MOVS R1,R2
105
106 /* Check the parameters */
107 assert_param(IS_WWDG_WINDOW_VALUE(WindowValue));
108
109 /* Clear W[6:0] bits */
110 tmpreg = WWDG->CFR & CFR_W_Mask;
\ 00000004 .... LDR.N R2,??DataTable3 ;; 0x40002c04
\ 00000006 1268 LDR R2,[R2, #+0]
\ 00000008 7F23 MOVS R3,#+127
\ 0000000A 9A43 BICS R2,R2,R3
\ 0000000C 1100 MOVS R1,R2
111
112 /* Set W[6:0] bits according to WindowValue value */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -