📄 stm32f10x_bkp.lst
字号:
###############################################################################
# #
# 06/Jun/2008 15:35:32 #
# 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_bkp.c #
# Command line = E:\library\src\stm32f10x_bkp.c -lcN #
# E:\ELE\yten\pro\Debug\List\ -o #
# E:\ELE\yten\pro\Debug\Obj\ --debug --endian little #
# --cpu Cortex-M3 -e --fpu None --dlib_config #
# D:\IARARM\ARM\INC\DLib_Config_Normal.h -I #
# E:\ELE\yten\pro\ -I E:\ELE\yten\pro\..\LIBRARY\INC\ -I #
# D:\IARARM\ARM\INC\ -Oh #
# List file = E:\ELE\yten\pro\Debug\List\stm32f10x_bkp.lst #
# Object file = E:\ELE\yten\pro\Debug\Obj\stm32f10x_bkp.o #
# #
# #
###############################################################################
E:\library\src\stm32f10x_bkp.c
1 /******************** (C) COPYRIGHT 2007 STMicroelectronics ********************
2 * File Name : stm32f10x_bkp.c
3 * Author : MCD Application Team
4 * Version : V1.0
5 * Date : 10/08/2007
6 * Description : This file provides all the BKP 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_bkp.h"
18 #include "stm32f10x_rcc.h"
19
20 /* Private typedef -----------------------------------------------------------*/
21 /* Private define ------------------------------------------------------------*/
22 /* ------------ BKP registers bit address in the alias region ----------- */
23 #define BKP_OFFSET (BKP_BASE - PERIPH_BASE)
24
25 /* --- CR Register ---*/
26 /* Alias word address of TPAL bit */
27 #define CR_OFFSET (BKP_OFFSET + 0x30)
28 #define TPAL_BitNumber 0x01
29 #define CR_TPAL_BB (PERIPH_BB_BASE + (CR_OFFSET * 32) + (TPAL_BitNumber * 4))
30
31 /* Alias word address of TPE bit */
32 #define TPE_BitNumber 0x00
33 #define CR_TPE_BB (PERIPH_BB_BASE + (CR_OFFSET * 32) + (TPE_BitNumber * 4))
34
35 /* --- CSR Register ---*/
36 /* Alias word address of TPIE bit */
37 #define CSR_OFFSET (BKP_OFFSET + 0x34)
38 #define TPIE_BitNumber 0x02
39 #define CSR_TPIE_BB (PERIPH_BB_BASE + (CSR_OFFSET * 32) + (TPIE_BitNumber * 4))
40
41 /* Alias word address of TIF bit */
42 #define TIF_BitNumber 0x09
43 #define CSR_TIF_BB (PERIPH_BB_BASE + (CSR_OFFSET * 32) + (TIF_BitNumber * 4))
44
45 /* Alias word address of TEF bit */
46 #define TEF_BitNumber 0x08
47 #define CSR_TEF_BB (PERIPH_BB_BASE + (CSR_OFFSET * 32) + (TEF_BitNumber * 4))
48
49
50 /* ---------------------- BKP registers bit mask ------------------------ */
51 /* RTCCR register bit mask */
52 #define RTCCR_CAL_Mask ((u16)0xFF80)
53 #define RTCCR_Mask ((u16)0xFC7F)
54
55 /* CSR register bit mask */
56 #define CSR_CTE_Set ((u16)0x0001)
57 #define CSR_CTI_Set ((u16)0x0002)
58
59 /* Private macro -------------------------------------------------------------*/
60 /* Private variables ---------------------------------------------------------*/
61 /* Private function prototypes -----------------------------------------------*/
62 /* Private functions ---------------------------------------------------------*/
63
64 /*******************************************************************************
65 * Function Name : BKP_DeInit
66 * Description : Deinitializes the BKP peripheral registers to their default
67 * reset values.
68 * Input : None
69 * Output : None
70 * Return : None
71 *******************************************************************************/
72 void BKP_DeInit(void)
73 {
74 RCC_BackupResetCmd(ENABLE);
75 RCC_BackupResetCmd(DISABLE);
76 }
77
78 /*******************************************************************************
79 * Function Name : BKP_TamperPinLevelConfig
80 * Description : Configures the Tamper Pin active level.
81 * Input : - BKP_TamperPinLevel: specifies the Tamper Pin active level.
82 * This parameter can be one of the following values:
83 * - BKP_TamperPinLevel_High: Tamper pin active on high level
84 * - BKP_TamperPinLevel_Low: Tamper pin active on low level
85 * Output : None
86 * Return : None
87 *******************************************************************************/
88 void BKP_TamperPinLevelConfig(u16 BKP_TamperPinLevel)
89 {
90 /* Check the parameters */
91 assert_param(IS_BKP_TAMPER_PIN_LEVEL(BKP_TamperPinLevel));
92
93 *(vu32 *) CR_TPAL_BB = BKP_TamperPinLevel;
94 }
95
96 /*******************************************************************************
97 * Function Name : BKP_TamperPinCmd
98 * Description : Enables or disables the Tamper Pin activation.
99 * Input : - NewState: new state of the Tamper Pin activation.
100 * This parameter can be: ENABLE or DISABLE.
101 * Output : None
102 * Return : None
103 *******************************************************************************/
104 void BKP_TamperPinCmd(FunctionalState NewState)
105 {
106 /* Check the parameters */
107 assert_param(IS_FUNCTIONAL_STATE(NewState));
108
109 *(vu32 *) CR_TPE_BB = (u32)NewState;
110 }
111
112 /*******************************************************************************
113 * Function Name : BKP_ITConfig
114 * Description : Enables or disables the Tamper Pin Interrupt.
115 * Input : - NewState: new state of the Tamper Pin Interrupt.
116 * This parameter can be: ENABLE or DISABLE.
117 * Output : None
118 * Return : None
119 *******************************************************************************/
120 void BKP_ITConfig(FunctionalState NewState)
121 {
122 /* Check the parameters */
123 assert_param(IS_FUNCTIONAL_STATE(NewState));
124
125 *(vu32 *) CSR_TPIE_BB = (u32)NewState;
126 }
127
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -