📄 pio.lst
字号:
###############################################################################
# #
# 18/Jul/2008 11:37:54 #
# IAR ARM ANSI C/C++ Compiler V5.11.0.20622/W32 EVALUATION #
# Copyright 1999-2007 IAR Systems. All rights reserved. #
# #
# Cpu mode = arm #
# Endian = little #
# Source file = D:\rock\atarm\at91sam7se\software\usb-device-core-projec #
# t-1.3-iar5-at91sam7se-ek\at91lib\peripherals\pio\pio.c #
# Command line = D:\rock\atarm\at91sam7se\software\usb-device-core-projec #
# t-1.3-iar5-at91sam7se-ek\at91lib\peripherals\pio\pio.c #
# -D at91sam7se512 -lC D:\rock\atarm\at91sam7se\software\u #
# sb-device-core-project-1.3-iar5-at91sam7se-ek\at91sam7se #
# -ek\usb-device-core-project\ewp\at91sam7se512_sdram\List #
# \ --remarks -o D:\rock\atarm\at91sam7se\software\usb-dev #
# ice-core-project-1.3-iar5-at91sam7se-ek\at91sam7se-ek\us #
# b-device-core-project\ewp\at91sam7se512_sdram\Obj\ #
# --no_cse --no_unroll --no_inline --no_code_motion #
# --no_tbaa --no_clustering --no_scheduling --debug #
# --endian little --cpu ARM7TDMI -e --fpu None #
# --dlib_config "D:\Program Files\IAR Systems\Embedded #
# Workbench 5.0 Evaluation\ARM\INC\DLib_Config_Full.h" -I #
# D:\rock\atarm\at91sam7se\software\usb-device-core-projec #
# t-1.3-iar5-at91sam7se-ek\at91sam7se-ek\usb-device-core-p #
# roject\ewp\..\..\..\at91lib\ -I #
# D:\rock\atarm\at91sam7se\software\usb-device-core-projec #
# t-1.3-iar5-at91sam7se-ek\at91sam7se-ek\usb-device-core-p #
# roject\ewp\..\..\..\at91lib\boards\at91sam7se-ek\ -I #
# D:\rock\atarm\at91sam7se\software\usb-device-core-projec #
# t-1.3-iar5-at91sam7se-ek\at91sam7se-ek\usb-device-core-p #
# roject\ewp\..\..\..\at91lib\peripherals\ -I #
# D:\rock\atarm\at91sam7se\software\usb-device-core-projec #
# t-1.3-iar5-at91sam7se-ek\at91sam7se-ek\usb-device-core-p #
# roject\ewp\..\..\..\at91lib\components\ -I #
# D:\rock\atarm\at91sam7se\software\usb-device-core-projec #
# t-1.3-iar5-at91sam7se-ek\at91sam7se-ek\usb-device-core-p #
# roject\ewp\..\..\..\at91lib\usb\ -I "D:\Program #
# Files\IAR Systems\Embedded Workbench 5.0 #
# Evaluation\ARM\INC\" --interwork --cpu_mode arm -On #
# List file = D:\rock\atarm\at91sam7se\software\usb-device-core-projec #
# t-1.3-iar5-at91sam7se-ek\at91sam7se-ek\usb-device-core-p #
# roject\ewp\at91sam7se512_sdram\List\pio.lst #
# Object file = D:\rock\atarm\at91sam7se\software\usb-device-core-projec #
# t-1.3-iar5-at91sam7se-ek\at91sam7se-ek\usb-device-core-p #
# roject\ewp\at91sam7se512_sdram\Obj\pio.o #
# #
# #
###############################################################################
D:\rock\atarm\at91sam7se\software\usb-device-core-project-1.3-iar5-at91sam7se-ek\at91lib\peripherals\pio\pio.c
1 /* ----------------------------------------------------------------------------
2 * ATMEL Microcontroller Software Support - ROUSSET -
3 * ----------------------------------------------------------------------------
4 * Copyright (c) 2006, Atmel Corporation
5
6 * All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions are met:
10 *
11 * - Redistributions of source code must retain the above copyright notice,
12 * this list of conditions and the disclaimer below.
13 *
14 * - Redistributions in binary form must reproduce the above copyright notice,
15 * this list of conditions and the disclaimer below in the documentation and/or
16 * other materials provided with the distribution.
17 *
18 * Atmel's name may not be used to endorse or promote products derived from
19 * this software without specific prior written permission.
20 *
21 * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR
22 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
23 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
24 * DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT,
25 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
26 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
27 * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
28 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
29 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
30 * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 * ----------------------------------------------------------------------------
32 */
33
34 //------------------------------------------------------------------------------
35 // Headers
36 //------------------------------------------------------------------------------
37
38 #include "pio.h"
39 #include <board.h>
40
41 //------------------------------------------------------------------------------
42 // Internal definitions
43 //------------------------------------------------------------------------------
44 /// \internal Returns the current value of a register.
45 #define READ(peripheral, register) (peripheral->register)
46 /// \internal Modifies the current value of a register.
47 #define WRITE(peripheral, register, value) (peripheral->register = value)
48
49 //------------------------------------------------------------------------------
50 // Internal functions
51 //------------------------------------------------------------------------------
52 //------------------------------------------------------------------------------
53 /// Configures one or more pin(s) of a PIO controller as being controlled by
54 /// peripheral A. Optionally, the corresponding internal pull-up(s) can be
55 /// enabled.
56 /// \param pio Pointer to a PIO controller.
57 /// \param mask Bitmask of one or more pin(s) to configure.
58 /// \param enablePullUp Indicates if the pin(s) internal pull-up shall be
59 /// configured.
60 //------------------------------------------------------------------------------
\ In section .text, align 4, keep-with-next
61 static void PIO_SetPeripheralA(AT91S_PIO *pio,
62 unsigned int mask,
63 unsigned char enablePullUp)
64 {
65 // Disable interrupts on the pin(s)
66 WRITE(pio, PIO_IDR, mask);
\ PIO_SetPeripheralA:
\ 00000000 441080E5 STR R1,[R0, #+68]
67
68 // Enable the pull-up(s) if necessary
69 if (enablePullUp) {
\ 00000004 FF2012E2 ANDS R2,R2,#0xFF ;; Zero extend
\ 00000008 000052E3 CMP R2,#+0
\ 0000000C 0100000A BEQ ??PIO_SetPeripheralA_0
70
71 WRITE(pio, PIO_PPUER, mask);
\ 00000010 641080E5 STR R1,[R0, #+100]
\ 00000014 000000EA B ??PIO_SetPeripheralA_1
72 }
73 else {
74
75 WRITE(pio, PIO_PPUDR, mask);
\ ??PIO_SetPeripheralA_0:
\ 00000018 601080E5 STR R1,[R0, #+96]
76 }
77
78 // Configure pin
79 WRITE(pio, PIO_ASR, mask);
\ ??PIO_SetPeripheralA_1:
\ 0000001C 701080E5 STR R1,[R0, #+112]
80 WRITE(pio, PIO_PDR, mask);
\ 00000020 041080E5 STR R1,[R0, #+4]
81 }
\ 00000024 1EFF2FE1 BX LR ;; return
82
83 //------------------------------------------------------------------------------
84 /// Configures one or more pin(s) of a PIO controller as being controlled by
85 /// peripheral A. Optionally, the corresponding internal pull-up(s) can be
86 /// enabled.
87 /// \param pio Pointer to a PIO controller.
88 /// \param mask Bitmask of one or more pin(s) to configure.
89 /// \param enablePullUp Indicates if the pin(s) internal pull-up shall be
90 /// configured.
91 //------------------------------------------------------------------------------
\ In section .text, align 4, keep-with-next
92 static void PIO_SetPeripheralB(AT91S_PIO *pio,
93 unsigned int mask,
94 unsigned char enablePullUp)
95 {
96 // Disable interrupts on the pin(s)
97 WRITE(pio, PIO_IDR, mask);
\ PIO_SetPeripheralB:
\ 00000000 441080E5 STR R1,[R0, #+68]
98
99 // Enable the pull-up(s) if necessary
100 if (enablePullUp) {
\ 00000004 FF2012E2 ANDS R2,R2,#0xFF ;; Zero extend
\ 00000008 000052E3 CMP R2,#+0
\ 0000000C 0100000A BEQ ??PIO_SetPeripheralB_0
101
102 WRITE(pio, PIO_PPUER, mask);
\ 00000010 641080E5 STR R1,[R0, #+100]
\ 00000014 000000EA B ??PIO_SetPeripheralB_1
103 }
104 else {
105
106 WRITE(pio, PIO_PPUDR, mask);
\ ??PIO_SetPeripheralB_0:
\ 00000018 601080E5 STR R1,[R0, #+96]
107 }
108
109 // Configure pin
110 WRITE(pio, PIO_BSR, mask);
\ ??PIO_SetPeripheralB_1:
\ 0000001C 741080E5 STR R1,[R0, #+116]
111 WRITE(pio, PIO_PDR, mask);
\ 00000020 041080E5 STR R1,[R0, #+4]
112 }
\ 00000024 1EFF2FE1 BX LR ;; return
113
114 //------------------------------------------------------------------------------
115 /// Configures one or more pin(s) or a PIO controller as inputs. Optionally,
116 /// the corresponding internal pull-up(s) and glitch filter(s) can be
117 /// enabled.
118 /// \param pio Pointer to a PIO controller.
119 /// \param mask Bitmask indicating which pin(s) to configure as input(s).
120 /// \param enablePullUp Indicates if the internal pull-up(s) must be enabled.
121 /// \param enableFilter Indicates if the glitch filter(s) must be enabled.
122 //------------------------------------------------------------------------------
\ In section .text, align 4, keep-with-next
123 static void PIO_SetInput(AT91S_PIO *pio,
124 unsigned int mask,
125 unsigned char enablePullUp,
126 unsigned char enableFilter)
127 {
128 // Disable interrupts
129 WRITE(pio, PIO_IDR, mask);
\ PIO_SetInput:
\ 00000000 441080E5 STR R1,[R0, #+68]
130
131 // Enable pull-up(s) if necessary
132 if (enablePullUp) {
\ 00000004 FF2012E2 ANDS R2,R2,#0xFF ;; Zero extend
\ 00000008 000052E3 CMP R2,#+0
\ 0000000C 0100000A BEQ ??PIO_SetInput_0
133
134 WRITE(pio, PIO_PPUER, mask);
\ 00000010 641080E5 STR R1,[R0, #+100]
\ 00000014 000000EA B ??PIO_SetInput_1
135 }
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -