📄 stm32f10x_usart.lst
字号:
##############################################################################
# #
# IAR ARM ANSI C/C++ Compiler V4.42A/W32 KICKSTART 13/Mar/2009 16:01:15 #
# Copyright 1999-2005 IAR Systems. All rights reserved. #
# #
# Cpu mode = thumb #
# Endian = little #
# Stack alignment = 4 #
# Source file = E:\UC_OS\Micrium\Software\CPU\ST\STM32\src\stm32f10x #
# _usart.c #
# Command line = E:\UC_OS\Micrium\Software\CPU\ST\STM32\src\stm32f10x #
# _usart.c -lCN E:\UC_OS\Micrium\Software\EvalBoards\S #
# T\STM3210B-EVAL\IAR\OS-Probe\Flash\List\ -o #
# E:\UC_OS\Micrium\Software\EvalBoards\ST\STM3210B-EVA #
# L\IAR\OS-Probe\Flash\Obj\ -z6 --no_unroll #
# --no_inline --no_tbaa --no_scheduling --debug #
# --cpu_mode thumb --endian little --cpu cortex-M3 #
# --stack_align 4 -e --fpu None --dlib_config #
# "C:\Program Files\IAR Systems\Embedded Workbench #
# 4.0 Kickstart\arm\LIB\dl7mptnnl8n.h" -I #
# E:\UC_OS\Micrium\Software\EvalBoards\ST\STM3210B-EVA #
# L\IAR\OS-Probe\ -I E:\UC_OS\Micrium\Software\EvalBoa #
# rds\ST\STM3210B-EVAL\IAR\OS-Probe\..\..\..\..\..\uco #
# s-ii\ports\arm-cortex-m3\generic\iar\ -I #
# E:\UC_OS\Micrium\Software\EvalBoards\ST\STM3210B-EVA #
# L\IAR\OS-Probe\..\..\..\..\..\ucos-ii\source\ -I #
# E:\UC_OS\Micrium\Software\EvalBoards\ST\STM3210B-EVA #
# L\IAR\OS-Probe\..\..\..\..\..\uc-lib\ -I #
# E:\UC_OS\Micrium\Software\EvalBoards\ST\STM3210B-EVA #
# L\IAR\OS-Probe\..\..\..\..\..\uc-cpu\ -I #
# E:\UC_OS\Micrium\Software\EvalBoards\ST\STM3210B-EVA #
# L\IAR\OS-Probe\..\..\..\..\..\uc-cpu\ARM-Cortex-M3\I #
# AR\ -I E:\UC_OS\Micrium\Software\EvalBoards\ST\STM32 #
# 10B-EVAL\IAR\OS-Probe\..\..\..\..\..\cpu\st\stm32\in #
# c\ -I E:\UC_OS\Micrium\Software\EvalBoards\ST\STM321 #
# 0B-EVAL\IAR\OS-Probe\..\BSP\ -I #
# E:\UC_OS\Micrium\Software\EvalBoards\ST\STM3210B-EVA #
# L\IAR\OS-Probe\..\..\..\..\..\uC-Probe\Target\Commun #
# ication\Generic\RS-232\Source\ -I #
# E:\UC_OS\Micrium\Software\EvalBoards\ST\STM3210B-EVA #
# L\IAR\OS-Probe\..\..\..\..\..\uC-Probe\Target\Commun #
# ication\Generic\RS-232\Ports\ST\STM32\ -I #
# E:\UC_OS\Micrium\Software\EvalBoards\ST\STM3210B-EVA #
# L\IAR\OS-Probe\..\..\..\..\..\uC-Probe\Target\Commun #
# ication\Generic\Source\ -I #
# E:\UC_OS\Micrium\Software\EvalBoards\ST\STM3210B-EVA #
# L\IAR\OS-Probe\..\..\..\..\..\uC-Probe\Target\Plugin #
# s\uCOS-II\ -I "C:\Program Files\IAR #
# Systems\Embedded Workbench 4.0 Kickstart\arm\INC\" #
# List file = E:\UC_OS\Micrium\Software\EvalBoards\ST\STM3210B-EVA #
# L\IAR\OS-Probe\Flash\List\stm32f10x_usart.lst #
# Object file = E:\UC_OS\Micrium\Software\EvalBoards\ST\STM3210B-EVA #
# L\IAR\OS-Probe\Flash\Obj\stm32f10x_usart.r79 #
# #
# #
##############################################################################
E:\UC_OS\Micrium\Software\CPU\ST\STM32\src\stm32f10x_usart.c
1 /******************** (C) COPYRIGHT 2007 STMicroelectronics ********************
2 * File Name : stm32f10x_usart.c
3 * Author : MCD Application Team
4 * Date First Issued : 09/29/2006
5 * Description : This file provides all the USART 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_usart.h"
23 #include "stm32f10x_rcc.h"
24
25 /* Private typedef -----------------------------------------------------------*/
26 /* Private define ------------------------------------------------------------*/
27 /* USART RUN Mask */
28 #define CR1_RUN_Set ((u16)0x2000) /* USART Enable Mask */
29 #define CR1_RUN_Reset ((u16)0xDFFF) /* USART Disable Mask */
30
31 #define CR2_Address_Mask ((u16)0xFFF0) /* USART address Mask */
32
33 /* USART RWU Mask */
34 #define CR1_RWU_Set ((u16)0x0002) /* USART mute mode Enable Mask */
35 #define CR1_RWU_Reset ((u16)0xFFFD) /* USART mute mode Enable Mask */
36
37 #define USART_IT_Mask ((u16)0x001F) /* USART Interrupt Mask */
38
39 /* USART LIN Mask */
40 #define CR2_LINE_Set ((u16)0x4000) /* USART LIN Enable Mask */
41 #define CR2_LINE_Reset ((u16)0xBFFF) /* USART LIN Disable Mask */
42
43 #define CR1_SBK_Set ((u16)0x0001) /* USART Break Character send Mask */
44
45 /* USART SC Mask */
46 #define CR3_SCEN_Set ((u16)0x0020) /* USART SC Enable Mask */
47 #define CR3_SCEN_Reset ((u16)0xFFDF) /* USART SC Disable Mask */
48
49 /* USART SC NACK Mask */
50 #define CR3_NACK_Set ((u16)0x0010) /* USART SC NACK Enable Mask */
51 #define CR3_NACK_Reset ((u16)0xFFEF) /* USART SC NACK Disable Mask */
52
53 /* USART Half-Duplex Mask */
54 #define CR3_HDSEL_Set ((u16)0x0008) /* USART Half-Duplex Enable Mask */
55 #define CR3_HDSEL_Reset ((u16)0xFFF7) /* USART Half-Duplex Disable Mask */
56
57 /* USART IrDA Mask */
58 #define CR3_IRLP_Mask ((u16)0xFFFB) /* USART IrDA LowPower mode Mask */
59
60 /* USART LIN Break detection */
61 #define CR3_LBDL_Mask ((u16)0xFFDF) /* USART LIN Break detection Mask */
62
63 /* USART WakeUp Method */
64 #define CR3_WAKE_Mask ((u16)0xF7FF) /* USART WakeUp Method Mask */
65
66 /* USART IrDA Mask */
67 #define CR3_IREN_Set ((u16)0x0002) /* USART IrDA Enable Mask */
68 #define CR3_IREN_Reset ((u16)0xFFFD) /* USART IrDA Disable Mask */
69
70 #define GTPR_LSB_Mask ((u16)0x00FF) /* Guard Time Register LSB Mask */
71 #define GTPR_MSB_Mask ((u16)0xFF00) /* Guard Time Register MSB Mask */
72
73 #define CR1_CLEAR_Mask ((u16)0xE9F3) /* USART CR1 Mask */
74 #define CR2_CLEAR_Mask ((u16)0xC0FF) /* USART CR2 Mask */
75 #define CR3_CLEAR_Mask ((u16)0xFCFF) /* USART CR3 Mask */
76
77
78 /* Private macro -------------------------------------------------------------*/
79 /* Private variables ---------------------------------------------------------*/
80 /* Private function prototypes -----------------------------------------------*/
81 /* Private functions ---------------------------------------------------------*/
82
83 /*******************************************************************************
84 * Function Name : USART_DeInit
85 * Description : Deinitializes the USARTx peripheral registers to their
86 * default reset values.
87 * Input : - USARTx: where x can be 1, 2 or 3 to select the USART
88 * peripheral.
89 * Output : None
90 * Return : None
91 *******************************************************************************/
\ In segment CODE, align 4, keep-with-next
92 void USART_DeInit(USART_TypeDef* USARTx)
93 {
\ USART_DeInit:
\ 00000000 00B5 PUSH {LR}
94 switch (*(u32*)&USARTx)
\ 00000002 1349 LDR.N R1,??USART_DeInit_0 ;; 0x40004400
\ 00000004 8842 CMP R0,R1
\ 00000006 0FD0 BEQ.N ??USART_DeInit_1
\ 00000008 1249 LDR.N R1,??USART_DeInit_0+0x4 ;; 0x40004800
\ 0000000A 8842 CMP R0,R1
\ 0000000C 16D0 BEQ.N ??USART_DeInit_2
\ 0000000E .... LDR.N R1,??DataTable1 ;; 0x40013800
\ 00000010 8842 CMP R0,R1
\ 00000012 1CD1 BNE.N ??USART_DeInit_3
95 {
96 case USART1_BASE:
97 RCC_APB2PeriphResetCmd(RCC_APB2Periph_USART1, ENABLE);
\ 00000014 0121 MOVS R1,#+1
\ 00000016 8803 LSLS R0,R1,#+14
\ 00000018 ........ _BLF RCC_APB2PeriphResetCmd,??RCC_APB2PeriphResetCmd??rT
98 RCC_APB2PeriphResetCmd(RCC_APB2Periph_USART1, DISABLE);
\ 0000001C 0021 MOVS R1,#+0
\ 0000001E 5FF48040 MOVS R0,#+16384
\ 00000022 ........ _BLF RCC_APB2PeriphResetCmd,??RCC_APB2PeriphResetCmd??rT
\ 00000026 00BD POP {PC}
99 break;
100
101 case USART2_BASE:
102 RCC_APB1PeriphResetCmd(RCC_APB1Periph_USART2, ENABLE);
\ ??USART_DeInit_1:
\ 00000028 0121 MOVS R1,#+1
\ 0000002A 4804 LSLS R0,R1,#+17
\ 0000002C ........ _BLF RCC_APB1PeriphResetCmd,??RCC_APB1PeriphResetCmd??rT
103 RCC_APB1PeriphResetCmd(RCC_APB1Periph_USART2, DISABLE);
\ 00000030 0021 MOVS R1,#+0
\ 00000032 5FF40030 MOVS R0,#+131072
\ 00000036 ........ _BLF RCC_APB1PeriphResetCmd,??RCC_APB1PeriphResetCmd??rT
\ 0000003A 00BD POP {PC}
104 break;
105
106 case USART3_BASE:
107 RCC_APB1PeriphResetCmd(RCC_APB1Periph_USART3, ENABLE);
\ ??USART_DeInit_2:
\ 0000003C 0121 MOVS R1,#+1
\ 0000003E 8804 LSLS R0,R1,#+18
\ 00000040 ........ _BLF RCC_APB1PeriphResetCmd,??RCC_APB1PeriphResetCmd??rT
108 RCC_APB1PeriphResetCmd(RCC_APB1Periph_USART3, DISABLE);
\ 00000044 0021 MOVS R1,#+0
\ 00000046 5FF48020 MOVS R0,#+262144
\ 0000004A ........ _BLF RCC_APB1PeriphResetCmd,??RCC_APB1PeriphResetCmd??rT
109 break;
110
111 default:
112 break;
113 }
114 }
\ ??USART_DeInit_3:
\ 0000004E 00BD POP {PC} ;; return
\ ??USART_DeInit_0:
\ 00000050 00440040 DC32 0x40004400
\ 00000054 00480040 DC32 0x40004800
115
116 /*******************************************************************************
117 * Function Name : USART_Init
118 * Description : Initializes the USARTx peripheral according to the specified
119 * parameters in the USART_InitStruct .
120 * Input : - USARTx: where x can be 1, 2 or 3 to select the USART peripheral.
121 * - USART_InitStruct: pointer to a USART_InitTypeDef structure
122 * that contains the configuration information for the
123 * specified USART peripheral.
124 * Output : None
125 * Return : None
126 *******************************************************************************/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -