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

📄 stm32f10x_bkp.lst

📁 STM32利用正交编码器实现电机的控制
💻 LST
📖 第 1 页 / 共 2 页
字号:
##############################################################################
#                                                                            #
# IAR ARM ANSI C/C++ Compiler V4.42A/W32               15/May/2008  12:06:30 #
# 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_bkp.c            #
#    Command line    =  "C:\David JIANG\ST MCU\Docs\STM32\AN_JIANG\TIM       #
#                       Encoder\example\FWLib\src\stm32f10x_bkp.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_bkp.lst                                          #
#    Object file     =  C:\David JIANG\ST MCU\Docs\STM32\AN_JIANG\TIM        #
#                       Encoder\example\project\EWARM\BOOT_FLASH\Obj\stm32f1 #
#                       0x_bkp.r79                                           #
#                                                                            #
#                                                                            #
##############################################################################

C:\David JIANG\ST MCU\Docs\STM32\AN_JIANG\TIM Encoder\example\FWLib\src\stm32f10x_bkp.c
      1          /******************** (C) COPYRIGHT 2007 STMicroelectronics ********************
      2          * File Name          : stm32f10x_bkp.c
      3          * Author             : MCD Application Team
      4          * Date First Issued  : 09/29/2006
      5          * Description        : This file provides all the BKP 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_bkp.h"
     23          #include "stm32f10x_rcc.h"
     24          
     25          /* Private typedef -----------------------------------------------------------*/
     26          /* Private define ------------------------------------------------------------*/
     27          /* ------------ BKP registers bit address in the alias region ----------- */
     28          #define BKP_OFFSET        (BKP_BASE - PERIPH_BASE)
     29          
     30          /* --- RTCCR Register ---*/
     31          /* Alias word address of CCO bit */
     32          #define RTCCR_OFFSET      (BKP_OFFSET + 0x2C)
     33          #define CCO_BitNumber     0x07
     34          #define RTCCR_CCO_BB      (PERIPH_BB_BASE + (RTCCR_OFFSET * 32) + (CCO_BitNumber * 4))
     35          
     36          /* --- CR Register ---*/
     37          /* Alias word address of TPAL bit */
     38          #define CR_OFFSET         (BKP_OFFSET + 0x30)
     39          #define TPAL_BitNumber    0x01
     40          #define CR_TPAL_BB        (PERIPH_BB_BASE + (CR_OFFSET * 32) + (TPAL_BitNumber * 4))
     41          
     42          /* Alias word address of TPE bit */
     43          #define TPE_BitNumber     0x00
     44          #define CR_TPE_BB         (PERIPH_BB_BASE + (CR_OFFSET * 32) + (TPE_BitNumber * 4))
     45          
     46          /* --- CSR Register ---*/
     47          /* Alias word address of TPIE bit */
     48          #define CSR_OFFSET        (BKP_OFFSET + 0x34)
     49          #define TPIE_BitNumber    0x02
     50          #define CSR_TPIE_BB       (PERIPH_BB_BASE + (CSR_OFFSET * 32) + (TPIE_BitNumber * 4))
     51          
     52          /* Alias word address of TIF bit */
     53          #define TIF_BitNumber     0x09
     54          #define CSR_TIF_BB        (PERIPH_BB_BASE + (CSR_OFFSET * 32) + (TIF_BitNumber * 4))
     55          
     56          /* Alias word address of TEF bit */
     57          #define TEF_BitNumber     0x08
     58          #define CSR_TEF_BB        (PERIPH_BB_BASE + (CSR_OFFSET * 32) + (TEF_BitNumber * 4))
     59          
     60          
     61          /* ---------------------- BKP registers bit mask ------------------------ */
     62          /* RTCCR register bit mask */
     63          #define RTCCR_CAL_Mask    ((u16)0xFF80)
     64          
     65          /* CSR register bit mask */
     66          #define CSR_CTE_Set       ((u16)0x0001)
     67          #define CSR_CTI_Set       ((u16)0x0002)
     68          
     69          /* Private macro -------------------------------------------------------------*/
     70          /* Private variables ---------------------------------------------------------*/
     71          /* Private function prototypes -----------------------------------------------*/
     72          /* Private functions ---------------------------------------------------------*/
     73          
     74          /*******************************************************************************
     75          * Function Name  : BKP_DeInit
     76          * Description    : Deinitializes the BKP peripheral registers to their default
     77          *                  reset values.
     78          * Input          : None
     79          * Output         : None
     80          * Return         : None
     81          *******************************************************************************/
     82          void BKP_DeInit(void)
     83          {
     84            RCC_BackupResetCmd(ENABLE);
     85            RCC_BackupResetCmd(DISABLE);
     86          }
     87          
     88          /*******************************************************************************
     89          * Function Name  : BKP_TamperPinLevelConfig
     90          * Description    : Configures the Tamper Pin active level.
     91          * Input          : - BKP_TamperPinLevel: specifies the Tamper Pin active level.
     92          *                    This parameter can be one of the following values:
     93          *                       - BKP_TamperPinLevel_High: Tamper pin active on high level
     94          *                       - BKP_TamperPinLevel_Low: Tamper pin active on low level
     95          * Output         : None
     96          * Return         : None
     97          *******************************************************************************/
     98          void BKP_TamperPinLevelConfig(u16 BKP_TamperPinLevel)
     99          {
    100            /* Check the parameters */
    101            assert(IS_BKP_TAMPER_PIN_LEVEL(BKP_TamperPinLevel));
    102          
    103            *(vu32 *) CR_TPAL_BB = BKP_TamperPinLevel;
    104          }
    105          
    106          /*******************************************************************************
    107          * Function Name  : BKP_TamperPinCmd
    108          * Description    : Enables or disables the Tamper Pin activation.
    109          * Input          : - NewState: new state of the Tamper Pin activation.
    110          *                    This parameter can be: ENABLE or DISABLE.
    111          * Output         : None
    112          * Return         : None
    113          *******************************************************************************/
    114          void BKP_TamperPinCmd(FunctionalState NewState)
    115          {
    116            /* Check the parameters */
    117            assert(IS_FUNCTIONAL_STATE(NewState));
    118          
    119            *(vu32 *) CR_TPE_BB = (u32)NewState;
    120          }
    121          
    122          /*******************************************************************************
    123          * Function Name  : BKP_ITConfig
    124          * Description    : Enables or disables the Tamper Pin Interrupt.
    125          * Input          : - NewState: new state of the Tamper Pin Interrupt.
    126          *                    This parameter can be: ENABLE or DISABLE.
    127          * Output         : None
    128          * Return         : None
    129          *******************************************************************************/
    130          void BKP_ITConfig(FunctionalState NewState)
    131          {
    132            /* Check the parameters */
    133            assert(IS_FUNCTIONAL_STATE(NewState));
    134          
    135            *(vu32 *) CSR_TPIE_BB = (u32)NewState;
    136          }
    137          

⌨️ 快捷键说明

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