📄 stm32f10x_can.lst
字号:
###############################################################################
# #
# IAR ANSI C/C++ Compiler V6.10.2.52244/W32 for ARM 07/Aug/2011 12:10:32 #
# Copyright 1999-2010 IAR Systems AB. #
# #
# Cpu mode = thumb #
# Endian = little #
# Source file = F:\stm32\我的程序\Micrium\Software\EWARM\BSP\ST\STM32F10 #
# x_StdPeriph_Driver\src\stm32f10x_can.c #
# Command line = F:\stm32\我的程序\Micrium\Software\EWARM\BSP\ST\STM32F10 #
# x_StdPeriph_Driver\src\stm32f10x_can.c -D #
# USE_STDPERIPH_DRIVER -D STM32F10X_CL -lCN #
# F:\stm32\我的程序\Micrium\Software\EWARM\OS-II\Flash\Lis #
# t\ -o F:\stm32\我的程序\Micrium\Software\EWARM\OS-II\Fla #
# sh\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 #
# D:\arm\INC\c\DLib_Config_Normal.h -I #
# F:\stm32\我的程序\Micrium\Software\EWARM\OS-II\APP\ -I #
# F:\stm32\我的程序\Micrium\Software\EWARM\OS-II\..\BSP\ #
# -I F:\stm32\我的程序\Micrium\Software\EWARM\OS-II\..\BSP #
# \ST\CMSIS\CM3\CoreSupport\ -I #
# F:\stm32\我的程序\Micrium\Software\EWARM\OS-II\..\BSP\ST #
# \CMSIS\CM3\DeviceSupport\ST\STM32F10x\ -I #
# F:\stm32\我的程序\Micrium\Software\EWARM\OS-II\..\BSP\ST #
# \STM32F10x_StdPeriph_Driver\inc\ -I #
# F:\stm32\我的程序\Micrium\Software\EWARM\OS-II\..\BSP\uC #
# OS-II\ -I F:\stm32\我的程序\Micrium\Software\EWARM\OS-II #
# \..\..\uCOS-II\Ports\ARM-Cortex-M3\Generic\IAR\ -I #
# F:\stm32\我的程序\Micrium\Software\EWARM\OS-II\..\..\uCO #
# S-II\Source\ -I F:\stm32\我的程序\Micrium\Software\EWARM #
# \OS-II\..\..\uC-LIB\ -I F:\stm32\我的程序\Micrium\Softwa #
# re\EWARM\OS-II\..\..\uC-LIB\Ports\ARM-Cortex-M3\IAR\ -I #
# F:\stm32\我的程序\Micrium\Software\EWARM\OS-II\..\..\uC- #
# CPU\ -I F:\stm32\我的程序\Micrium\Software\EWARM\OS-II\. #
# .\..\uC-CPU\ARM-Cortex-M3\IAR\ -On --use_c++_inline #
# List file = F:\stm32\我的程序\Micrium\Software\EWARM\OS-II\Flash\Lis #
# t\stm32f10x_can.lst #
# Object file = F:\stm32\我的程序\Micrium\Software\EWARM\OS-II\Flash\Obj #
# \stm32f10x_can.o #
# #
# #
###############################################################################
F:\stm32\我的程序\Micrium\Software\EWARM\BSP\ST\STM32F10x_StdPeriph_Driver\src\stm32f10x_can.c
1 /**
2 ******************************************************************************
3 * @file stm32f10x_can.c
4 * @author MCD Application Team
5 * @version V3.4.0
6 * @date 10/15/2010
7 * @brief This file provides all the CAN firmware functions.
8 ******************************************************************************
9 * @copy
10 *
11 * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS
12 * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE
13 * TIME. AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY
14 * DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING
15 * FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE
16 * CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
17 *
18 * <h2><center>© COPYRIGHT 2010 STMicroelectronics</center></h2>
19 */
20
21 /* Includes ------------------------------------------------------------------*/
22 #include "stm32f10x_can.h"
23 #include "stm32f10x_rcc.h"
24
25 /** @addtogroup STM32F10x_StdPeriph_Driver
26 * @{
27 */
28
29 /** @defgroup CAN
30 * @brief CAN driver modules
31 * @{
32 */
33
34 /** @defgroup CAN_Private_TypesDefinitions
35 * @{
36 */
37
38 /**
39 * @}
40 */
41
42 /** @defgroup CAN_Private_Defines
43 * @{
44 */
45
46 /* CAN Master Control Register bits */
47
48 #define MCR_DBF ((uint32_t)0x00010000) /* software master reset */
49
50 /* CAN Mailbox Transmit Request */
51 #define TMIDxR_TXRQ ((uint32_t)0x00000001) /* Transmit mailbox request */
52
53 /* CAN Filter Master Register bits */
54 #define FMR_FINIT ((uint32_t)0x00000001) /* Filter init mode */
55
56 /* Time out for INAK bit */
57 #define INAK_TIMEOUT ((uint32_t)0x0000FFFF)
58 /* Time out for SLAK bit */
59 #define SLAK_TIMEOUT ((uint32_t)0x0000FFFF)
60
61
62
63 /* Flags in TSR register */
64 #define CAN_FLAGS_TSR ((uint32_t)0x08000000)
65 /* Flags in RF1R register */
66 #define CAN_FLAGS_RF1R ((uint32_t)0x04000000)
67 /* Flags in RF0R register */
68 #define CAN_FLAGS_RF0R ((uint32_t)0x02000000)
69 /* Flags in MSR register */
70 #define CAN_FLAGS_MSR ((uint32_t)0x01000000)
71 /* Flags in ESR register */
72 #define CAN_FLAGS_ESR ((uint32_t)0x00F00000)
73
74
75 /**
76 * @}
77 */
78
79 /** @defgroup CAN_Private_Macros
80 * @{
81 */
82
83 /**
84 * @}
85 */
86
87 /** @defgroup CAN_Private_Variables
88 * @{
89 */
90
91 /**
92 * @}
93 */
94
95 /** @defgroup CAN_Private_FunctionPrototypes
96 * @{
97 */
98
99 static ITStatus CheckITStatus(uint32_t CAN_Reg, uint32_t It_Bit);
100
101 /**
102 * @}
103 */
104
105 /** @defgroup CAN_Private_Functions
106 * @{
107 */
108
109 /**
110 * @brief Deinitializes the CAN peripheral registers to their default reset values.
111 * @param CANx: where x can be 1 or 2 to select the CAN peripheral.
112 * @retval None.
113 */
\ In section .text, align 2, keep-with-next
114 void CAN_DeInit(CAN_TypeDef* CANx)
115 {
\ CAN_DeInit:
\ 00000000 10B5 PUSH {R4,LR}
\ 00000002 0400 MOVS R4,R0
116 /* Check the parameters */
117 assert_param(IS_CAN_ALL_PERIPH(CANx));
118
119 if (CANx == CAN1)
\ 00000004 ........ LDR.W R0,??DataTable5 ;; 0x40006400
\ 00000008 8442 CMP R4,R0
\ 0000000A 0AD1 BNE.N ??CAN_DeInit_0
120 {
121 /* Enable CAN1 reset state */
122 RCC_APB1PeriphResetCmd(RCC_APB1Periph_CAN1, ENABLE);
\ 0000000C 0121 MOVS R1,#+1
\ 0000000E 5FF00070 MOVS R0,#+33554432
\ 00000012 ........ BL RCC_APB1PeriphResetCmd
123 /* Release CAN1 from reset state */
124 RCC_APB1PeriphResetCmd(RCC_APB1Periph_CAN1, DISABLE);
\ 00000016 0021 MOVS R1,#+0
\ 00000018 5FF00070 MOVS R0,#+33554432
\ 0000001C ........ BL RCC_APB1PeriphResetCmd
\ 00000020 09E0 B.N ??CAN_DeInit_1
125 }
126 else
127 {
128 /* Enable CAN2 reset state */
129 RCC_APB1PeriphResetCmd(RCC_APB1Periph_CAN2, ENABLE);
\ ??CAN_DeInit_0:
\ 00000022 0121 MOVS R1,#+1
\ 00000024 5FF08060 MOVS R0,#+67108864
\ 00000028 ........ BL RCC_APB1PeriphResetCmd
130 /* Release CAN2 from reset state */
131 RCC_APB1PeriphResetCmd(RCC_APB1Periph_CAN2, DISABLE);
\ 0000002C 0021 MOVS R1,#+0
\ 0000002E 5FF08060 MOVS R0,#+67108864
\ 00000032 ........ BL RCC_APB1PeriphResetCmd
132 }
133 }
\ ??CAN_DeInit_1:
\ 00000036 10BD POP {R4,PC} ;; return
134
135 /**
136 * @brief Initializes the CAN peripheral according to the specified
137 * parameters in the CAN_InitStruct.
138 * @param CANx: where x can be 1 or 2 to to select the CAN peripheral.
139 * @param CAN_InitStruct: pointer to a CAN_InitTypeDef structure that
140 * contains the configuration information for the CAN peripheral.
141 * @retval Constant indicates initialization succeed which will be
142 * CANINITFAILED or CANINITOK.
143 */
\ In section .text, align 2, keep-with-next
144 uint8_t CAN_Init(CAN_TypeDef* CANx, CAN_InitTypeDef* CAN_InitStruct)
145 {
\ CAN_Init:
\ 00000000 30B4 PUSH {R4,R5}
\ 00000002 0200 MOVS R2,R0
146 uint8_t InitStatus = CANINITFAILED;
\ 00000004 0020 MOVS R0,#+0
147 uint32_t wait_ack = 0x00000000;
\ 00000006 0023 MOVS R3,#+0
148 /* Check the parameters */
149 assert_param(IS_CAN_ALL_PERIPH(CANx));
150 assert_param(IS_FUNCTIONAL_STATE(CAN_InitStruct->CAN_TTCM));
151 assert_param(IS_FUNCTIONAL_STATE(CAN_InitStruct->CAN_ABOM));
152 assert_param(IS_FUNCTIONAL_STATE(CAN_InitStruct->CAN_AWUM));
153 assert_param(IS_FUNCTIONAL_STATE(CAN_InitStruct->CAN_NART));
154 assert_param(IS_FUNCTIONAL_STATE(CAN_InitStruct->CAN_RFLM));
155 assert_param(IS_FUNCTIONAL_STATE(CAN_InitStruct->CAN_TXFP));
156 assert_param(IS_CAN_MODE(CAN_InitStruct->CAN_Mode));
157 assert_param(IS_CAN_SJW(CAN_InitStruct->CAN_SJW));
158 assert_param(IS_CAN_BS1(CAN_InitStruct->CAN_BS1));
159 assert_param(IS_CAN_BS2(CAN_InitStruct->CAN_BS2));
160 assert_param(IS_CAN_PRESCALER(CAN_InitStruct->CAN_Prescaler));
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -