📄 eeprom.lst
字号:
1 .file "eeprom.c"
2 .arch atmega8
3 __SREG__ = 0x3f
4 __SP_H__ = 0x3e
5 __SP_L__ = 0x3d
6 __tmp_reg__ = 0
7 __zero_reg__ = 1
8 .global __do_copy_data
9 .global __do_clear_bss
11 .text
12 .Ltext0:
124 .global HH
125 .data
128 HH:
129 0000 5A .byte 90
130 .global TL_Z
133 TL_Z:
134 0001 6400 .word 100
135 .global TL
138 TL:
139 0003 CEFF .word -50
140 .global TH_Z
143 TH_Z:
144 0005 E703 .word 999
145 .global TH
148 TH:
149 0007 4605 .word 1350
150 .text
153 .global read_byte_from_eeprom
155 read_byte_from_eeprom:
1:drive/eeprom.c **** #define EEPROM_C 1
2:drive/eeprom.c **** #include "inc/config.h"
3:drive/eeprom.c **** /************************************************************************************
4:drive/eeprom.c **** **-------------------- file name : EEPROM.c -----------------------------------
5:drive/eeprom.c **** ** author:
6:drive/eeprom.c **** ** date: 20080201
7:drive/eeprom.c **** ** version: 1.0
8:drive/eeprom.c **** ** remaks
9:drive/eeprom.c **** **--------------------------------------------------------------
10:drive/eeprom.c **** ** modify:
11:drive/eeprom.c **** ** author:
12:drive/eeprom.c **** ** date:
13:drive/eeprom.c **** **-----------------------------------------------------------------------------------
14:drive/eeprom.c **** ************************************************************************************/
15:drive/eeprom.c ****
16:drive/eeprom.c ****
17:drive/eeprom.c ****
18:drive/eeprom.c ****
19:drive/eeprom.c ****
20:drive/eeprom.c ****
21:drive/eeprom.c ****
22:drive/eeprom.c ****
23:drive/eeprom.c **** /** the global variables used by eeprom **/
24:drive/eeprom.c **** //--------------------------------------
25:drive/eeprom.c **** int16 TH =1350 ; //温度上限启动值
26:drive/eeprom.c **** int16 TH_Z =999 ; //温度上限返回值
27:drive/eeprom.c **** int16 TL =-50 ; //温度上限启动值
28:drive/eeprom.c **** int16 TL_Z =100 ; //温度上限返回值
29:drive/eeprom.c **** //--------------------------------------
30:drive/eeprom.c **** u08 HH = 90 ; //湿度上限启动值
31:drive/eeprom.c ****
32:drive/eeprom.c ****
33:drive/eeprom.c **** u08 BAUDRATE;
34:drive/eeprom.c **** u08 AUTOSWITCH;
35:drive/eeprom.c ****
36:drive/eeprom.c **** /*****************************************************************************
37:drive/eeprom.c **** *-----------------------------------------------------------------------------
38:drive/eeprom.c **** * subroutine: read_byte_from_eeprom(u08 eeprom_adress)
39:drive/eeprom.c **** * function: used by keyprocess ,compare relay
40:drive/eeprom.c **** * globle variable:
41:drive/eeprom.c **** * date: 2006.09.16
42:drive/eeprom.c **** * author:
43:drive/eeprom.c **** * abstract:
44:drive/eeprom.c **** ******************************************************************************/
45:drive/eeprom.c **** uint8 read_byte_from_eeprom(uint16 eeprom_adress)
46:drive/eeprom.c **** {
157 .LM1:
158 /* prologue: frame size=0 */
159 /* prologue end (size=0) */
160 .LBB2:
161 .LBB3:
163 .Ltext1:
1:d:/WinAVR/avr/include/avr/eeprom.h **** /* Copyright (c) 2002, 2003, 2004 Marek Michalkiewicz
2:d:/WinAVR/avr/include/avr/eeprom.h **** Copyright (c) 2005, 2006 Bjoern Haase
3:d:/WinAVR/avr/include/avr/eeprom.h **** All rights reserved.
4:d:/WinAVR/avr/include/avr/eeprom.h ****
5:d:/WinAVR/avr/include/avr/eeprom.h **** Redistribution and use in source and binary forms, with or without
6:d:/WinAVR/avr/include/avr/eeprom.h **** modification, are permitted provided that the following conditions are met:
7:d:/WinAVR/avr/include/avr/eeprom.h ****
8:d:/WinAVR/avr/include/avr/eeprom.h **** * Redistributions of source code must retain the above copyright
9:d:/WinAVR/avr/include/avr/eeprom.h **** notice, this list of conditions and the following disclaimer.
10:d:/WinAVR/avr/include/avr/eeprom.h ****
11:d:/WinAVR/avr/include/avr/eeprom.h **** * Redistributions in binary form must reproduce the above copyright
12:d:/WinAVR/avr/include/avr/eeprom.h **** notice, this list of conditions and the following disclaimer in
13:d:/WinAVR/avr/include/avr/eeprom.h **** the documentation and/or other materials provided with the
14:d:/WinAVR/avr/include/avr/eeprom.h **** distribution.
15:d:/WinAVR/avr/include/avr/eeprom.h ****
16:d:/WinAVR/avr/include/avr/eeprom.h **** * Neither the name of the copyright holders nor the names of
17:d:/WinAVR/avr/include/avr/eeprom.h **** contributors may be used to endorse or promote products derived
18:d:/WinAVR/avr/include/avr/eeprom.h **** from this software without specific prior written permission.
19:d:/WinAVR/avr/include/avr/eeprom.h ****
20:d:/WinAVR/avr/include/avr/eeprom.h **** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21:d:/WinAVR/avr/include/avr/eeprom.h **** AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22:d:/WinAVR/avr/include/avr/eeprom.h **** IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23:d:/WinAVR/avr/include/avr/eeprom.h **** ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
24:d:/WinAVR/avr/include/avr/eeprom.h **** LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
25:d:/WinAVR/avr/include/avr/eeprom.h **** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26:d:/WinAVR/avr/include/avr/eeprom.h **** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27:d:/WinAVR/avr/include/avr/eeprom.h **** INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28:d:/WinAVR/avr/include/avr/eeprom.h **** CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29:d:/WinAVR/avr/include/avr/eeprom.h **** ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30:d:/WinAVR/avr/include/avr/eeprom.h **** POSSIBILITY OF SUCH DAMAGE. */
31:d:/WinAVR/avr/include/avr/eeprom.h ****
32:d:/WinAVR/avr/include/avr/eeprom.h **** /* $Id: eeprom.h,v 1.17.2.1 2006/02/26 21:51:04 aesok Exp $ */
33:d:/WinAVR/avr/include/avr/eeprom.h ****
34:d:/WinAVR/avr/include/avr/eeprom.h **** /*
35:d:/WinAVR/avr/include/avr/eeprom.h **** eeprom.h
36:d:/WinAVR/avr/include/avr/eeprom.h ****
37:d:/WinAVR/avr/include/avr/eeprom.h **** Contributors:
38:d:/WinAVR/avr/include/avr/eeprom.h **** Created by Marek Michalkiewicz <marekm@linux.org.pl>
39:d:/WinAVR/avr/include/avr/eeprom.h **** eeprom_write_word and eeprom_write_block added by Artur Lipowski
40:d:/WinAVR/avr/include/avr/eeprom.h **** <LAL@pro.onet.pl>
41:d:/WinAVR/avr/include/avr/eeprom.h **** Complete rewrite using the original interface by Bjoern Haase
42:d:/WinAVR/avr/include/avr/eeprom.h **** <bjoern.haase@de.bosch.com>.
43:d:/WinAVR/avr/include/avr/eeprom.h **** */
44:d:/WinAVR/avr/include/avr/eeprom.h ****
45:d:/WinAVR/avr/include/avr/eeprom.h **** #ifndef _EEPROM_H_
46:d:/WinAVR/avr/include/avr/eeprom.h **** #define _EEPROM_H_ 1
47:d:/WinAVR/avr/include/avr/eeprom.h ****
48:d:/WinAVR/avr/include/avr/eeprom.h **** #define __need_size_t
49:d:/WinAVR/avr/include/avr/eeprom.h **** #include <stddef.h>
50:d:/WinAVR/avr/include/avr/eeprom.h **** #include <inttypes.h>
51:d:/WinAVR/avr/include/avr/eeprom.h ****
52:d:/WinAVR/avr/include/avr/eeprom.h ****
53:d:/WinAVR/avr/include/avr/eeprom.h **** #ifdef __AVR_MEGA__
54:d:/WinAVR/avr/include/avr/eeprom.h **** #define XCALL "call"
55:d:/WinAVR/avr/include/avr/eeprom.h **** #else
56:d:/WinAVR/avr/include/avr/eeprom.h **** #define XCALL "rcall"
57:d:/WinAVR/avr/include/avr/eeprom.h **** #endif
58:d:/WinAVR/avr/include/avr/eeprom.h ****
59:d:/WinAVR/avr/include/avr/eeprom.h **** #include <avr/io.h>
60:d:/WinAVR/avr/include/avr/eeprom.h **** #ifndef __EEPROM_REG_LOCATIONS__
61:d:/WinAVR/avr/include/avr/eeprom.h **** /** \def __EEPROM_REG_LOCATIONS__
62:d:/WinAVR/avr/include/avr/eeprom.h **** \ingroup avr_eeprom
63:d:/WinAVR/avr/include/avr/eeprom.h **** In order to be able to work without a requiring a multilib
64:d:/WinAVR/avr/include/avr/eeprom.h **** approach for dealing with controllers having the EEPROM registers
65:d:/WinAVR/avr/include/avr/eeprom.h **** at different positions in memory space, the eeprom functions evaluate
66:d:/WinAVR/avr/include/avr/eeprom.h **** __EEPROM_REG_LOCATIONS__: It is assumed to be defined by
67:d:/WinAVR/avr/include/avr/eeprom.h **** the device io header and contains 6 uppercase hex digits encoding the
68:d:/WinAVR/avr/include/avr/eeprom.h **** addresses of EECR,EEDR and EEAR.
69:d:/WinAVR/avr/include/avr/eeprom.h **** First two letters: EECR address.
70:d:/WinAVR/avr/include/avr/eeprom.h **** Second two letters: EEDR address.
71:d:/WinAVR/avr/include/avr/eeprom.h **** Last two letters: EEAR address.
72:d:/WinAVR/avr/include/avr/eeprom.h **** The default 1C1D1E corresponds to the
73:d:/WinAVR/avr/include/avr/eeprom.h **** register location that is valid for most controllers. The value
74:d:/WinAVR/avr/include/avr/eeprom.h **** of this define symbol is used for appending it to the base name of the
75:d:/WinAVR/avr/include/avr/eeprom.h **** assembler functions. */
76:d:/WinAVR/avr/include/avr/eeprom.h **** #define __EEPROM_REG_LOCATIONS__ 1C1D1E
77:d:/WinAVR/avr/include/avr/eeprom.h **** #endif
78:d:/WinAVR/avr/include/avr/eeprom.h **** #define _STR2(EXP) _STR1(EXP)
79:d:/WinAVR/avr/include/avr/eeprom.h **** #define _STR1(EXP) #EXP
80:d:/WinAVR/avr/include/avr/eeprom.h **** #define _REG_LOCATION_SUFFIX _STR2(__EEPROM_REG_LOCATIONS__)
81:d:/WinAVR/avr/include/avr/eeprom.h ****
82:d:/WinAVR/avr/include/avr/eeprom.h **** #ifndef CR_TAB
83:d:/WinAVR/avr/include/avr/eeprom.h **** #define CR_TAB "\n\t"
84:d:/WinAVR/avr/include/avr/eeprom.h **** #endif
85:d:/WinAVR/avr/include/avr/eeprom.h ****
86:d:/WinAVR/avr/include/avr/eeprom.h ****
87:d:/WinAVR/avr/include/avr/eeprom.h **** /** \defgroup avr_eeprom <avr/eeprom.h>: EEPROM handling
88:d:/WinAVR/avr/include/avr/eeprom.h **** \code #include <avr/eeprom.h> \endcode
89:d:/WinAVR/avr/include/avr/eeprom.h ****
90:d:/WinAVR/avr/include/avr/eeprom.h **** This header file declares the interface to some simple library
91:d:/WinAVR/avr/include/avr/eeprom.h **** routines suitable for handling the data EEPROM contained in the
92:d:/WinAVR/avr/include/avr/eeprom.h **** AVR microcontrollers. The implementation uses a simple polled
93:d:/WinAVR/avr/include/avr/eeprom.h **** mode interface. Applications that require interrupt-controlled
94:d:/WinAVR/avr/include/avr/eeprom.h **** EEPROM access to ensure that no time will be wasted in spinloops
95:d:/WinAVR/avr/include/avr/eeprom.h **** will have to deploy their own implementation.
96:d:/WinAVR/avr/include/avr/eeprom.h ****
97:d:/WinAVR/avr/include/avr/eeprom.h **** \note All of the read/write functions first make sure the EEPROM
98:d:/WinAVR/avr/include/avr/eeprom.h **** is ready to be accessed. Since this may cause long delays if a
99:d:/WinAVR/avr/include/avr/eeprom.h **** write operation is still pending, time-critical applications
100:d:/WinAVR/avr/include/avr/eeprom.h **** should first poll the EEPROM e. g. using eeprom_is_ready() before
101:d:/WinAVR/avr/include/avr/eeprom.h **** attempting any actual I/O.
102:d:/WinAVR/avr/include/avr/eeprom.h ****
103:d:/WinAVR/avr/include/avr/eeprom.h **** \note This header file declares inline functions that call the
104:d:/WinAVR/avr/include/avr/eeprom.h **** assembler subroutines directly. This prevents that the compiler
105:d:/WinAVR/avr/include/avr/eeprom.h **** generates push/pops for the call-clobbered registers. This way
106:d:/WinAVR/avr/include/avr/eeprom.h **** also a specific calling convention could be used for the eeprom
107:d:/WinAVR/avr/include/avr/eeprom.h **** routines e.g. by passing values in __tmp_reg__, eeprom addresses in
108:d:/WinAVR/avr/include/avr/eeprom.h **** X and memory addresses in Z registers. Method is optimized for code
109:d:/WinAVR/avr/include/avr/eeprom.h **** size.
110:d:/WinAVR/avr/include/avr/eeprom.h ****
111:d:/WinAVR/avr/include/avr/eeprom.h **** \note Presently supported are two locations of the EEPROM register
112:d:/WinAVR/avr/include/avr/eeprom.h **** set: 0x1F,0x20,0x21 and 0x1C,0x1D,0x1E
113:d:/WinAVR/avr/include/avr/eeprom.h **** (see ::__EEPROM_REG_LOCATIONS__).
114:d:/WinAVR/avr/include/avr/eeprom.h ****
115:d:/WinAVR/avr/include/avr/eeprom.h **** \note As these functions modify IO registers, they are known to be
116:d:/WinAVR/avr/include/avr/eeprom.h **** non-reentrant. If any of these functions are used from both,
117:d:/WinAVR/avr/include/avr/eeprom.h **** standard and interrupt context, the applications must ensure
118:d:/WinAVR/avr/include/avr/eeprom.h **** proper protection (e.g. by disabling interrupts before accessing
119:d:/WinAVR/avr/include/avr/eeprom.h **** them).
120:d:/WinAVR/avr/include/avr/eeprom.h ****
121:d:/WinAVR/avr/include/avr/eeprom.h **** */
122:d:/WinAVR/avr/include/avr/eeprom.h ****
123:d:/WinAVR/avr/include/avr/eeprom.h ****
124:d:/WinAVR/avr/include/avr/eeprom.h **** /* forward declarations of the inline functions so that doxygen does
125:d:/WinAVR/avr/include/avr/eeprom.h **** not get confused by the attribute expression. */
126:d:/WinAVR/avr/include/avr/eeprom.h ****
127:d:/WinAVR/avr/include/avr/eeprom.h **** static inline uint8_t __attribute__ ((always_inline))
128:d:/WinAVR/avr/include/avr/eeprom.h **** eeprom_read_byte (const uint8_t *addr);
129:d:/WinAVR/avr/include/avr/eeprom.h ****
130:d:/WinAVR/avr/include/avr/eeprom.h **** static inline uint16_t __attribute__ ((always_inline))
131:d:/WinAVR/avr/include/avr/eeprom.h **** eeprom_read_word (const uint16_t *addr);
132:d:/WinAVR/avr/include/avr/eeprom.h ****
133:d:/WinAVR/avr/include/avr/eeprom.h **** static inline void __attribute__ ((always_inline))
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -