📄 hal_flash.lst
字号:
C51 COMPILER V7.50 HAL_FLASH 04/09/2009 10:12:50 PAGE 1
C51 COMPILER V7.50, COMPILATION OF MODULE HAL_FLASH
OBJECT MODULE PLACED IN .\build\hal_flash.obj
COMPILER INVOKED BY: C:\Keil\C51\BIN\C51.EXE ..\..\..\..\arch\hal\nrf24lu1\hal_flash.c LARGE OMF2 OPTIMIZE(9,SPEED) BROW
-SE INCDIR(..\common;..\..\..\..\comp\protocol\wdp\common\;..\..\..\..\comp\protocol\wdp\host\;..\..\..\..\arch\hal\inclu
-de;..\..\..\..\arch\hal\nrf24lu1;..\..\..\..\arch\nrf24lu1;..\common;..\..\..\..\comp\protocol\fap) DEBUG PRINT(.\lst\ha
-l_flash.lst) OBJECT(.\build\hal_flash.obj)
line level source
1 /* Copyright (c) 2007 Nordic Semiconductor. All Rights Reserved.
2 *
3 * The information contained herein is property of Nordic Semiconductor ASA.
4 * Terms and conditions of usage are described in detail in NORDIC
5 * SEMICONDUCTOR STANDARD SOFTWARE LICENSE AGREEMENT.
6 *
7 * Licensees are granted free, non-transferable use of the information. NO
8 * WARRENTY of ANY KIND is provided. This heading must NOT be removed from
9 * the file.
10 *
11 * $LastChangedRevision: 2290 $
12 */
13
14 /** @file
15 * Implementation of the Flash HAL module
16 * @author Ole Saether
17 */
18
19 #include <Nordic\reg24lu1.h>
20 #include "hal_flash.h"
21
22 void hal_flash_page_erase(uint8_t pn)
23 {
24 1 // Save interrupt enable state and disable interrupts:
25 1 F0 = EA;
26 1 EA = 0;
27 1 // Enable flash write operation:
28 1 FCR = 0xAA;
29 1 FCR = 0x55;
30 1 WEN = 1;
31 1 //
32 1 // Write the page address to FCR to start the page erase operation. This
33 1 // operation is "self timed" when executing from the flash; the CPU will
34 1 // halt until the operation is finished:
35 1 FCR = pn;
36 1 //
37 1 // When running from XDATA RAM we need to wait for the operation to finish:
38 1 while(RDYN == 1)
39 1 ;
40 1 WEN = 0;
41 1 EA = F0; // Restore interrupt enable state
42 1 }
43
44 void hal_flash_byte_write(uint16_t a, uint8_t b)
45 {
46 1 uint8_t xdata *data pb;
47 1
48 1 // Save interrupt enable state and disable interrupts:
49 1 F0 = EA;
50 1 EA = 0;
51 1 // Enable flash write operation:
52 1 FCR = 0xAA;
C51 COMPILER V7.50 HAL_FLASH 04/09/2009 10:12:50 PAGE 2
53 1 FCR = 0x55;
54 1 WEN = 1;
55 1 //
56 1 // Write the byte directly to the flash. This operation is "self timed" when
57 1 // executing from the flash; the CPU will halt until the operation is
58 1 // finished:
59 1 pb = (uint8_t xdata *)a;
60 1 *pb = b;
61 1 //
62 1 // When running from XDATA RAM we need to wait for the operation to finish:
63 1 while(RDYN == 1)
64 1 ;
65 1 WEN = 0;
66 1 EA = F0; // Restore interrupt enable state
67 1 }
68
69 void hal_flash_bytes_write(uint16_t a, uint8_t *p, uint16_t n)
70 {
71 1 uint8_t xdata *data pb;
72 1
73 1 // Save interrupt enable state and disable interrupts:
74 1 F0 = EA;
75 1 EA = 0;
76 1 // Enable flash write operation:
77 1 FCR = 0xAA;
78 1 FCR = 0x55;
79 1 WEN = 1;
80 1 //
81 1 // Write the bytes directly to the flash. This operation is
82 1 // "self timed"; the CPU will halt until the operation is
83 1 // finished:
84 1 pb = (uint8_t xdata *)a;
85 1 while(n--)
86 1 {
87 2 //lint --e{613} Suppress possible use of null pointer warning:
88 2 *pb++ = *p++;
89 2 //
90 2 // When running from XDATA RAM we need to wait for the operation to
91 2 // finish:
92 2 while(RDYN == 1)
93 2 ;
94 2 }
95 1 WEN = 0;
96 1 EA = F0; // Restore interrupt enable state
97 1 }
98
99 uint8_t hal_flash_byte_read(uint16_t a)
100 {
101 1 //lint --e{613} Suppress possible use of null pointer warning:
102 1 uint8_t xdata *pb = (uint8_t xdata *)a;
103 1 return *pb;
104 1 }
105
106 void hal_flash_bytes_read(uint16_t a, uint8_t *p, uint16_t n)
107 {
108 1 uint8_t xdata *pb = (uint8_t xdata *)a;
109 1 while(n--)
110 1 {
111 2 //lint --e{613} Suppress possible use of null pointer warning:
112 2 *p = *pb;
113 2 pb++;
114 2 p++;
C51 COMPILER V7.50 HAL_FLASH 04/09/2009 10:12:50 PAGE 3
115 2 }
116 1 }
MODULE INFORMATION: STATIC OVERLAYABLE
CODE SIZE = 176 ----
CONSTANT SIZE = ---- ----
XDATA SIZE = ---- 14
PDATA SIZE = ---- ----
DATA SIZE = ---- 4
IDATA SIZE = ---- ----
BIT SIZE = ---- ----
EDATA SIZE = ---- ----
HDATA SIZE = ---- ----
XDATA CONST SIZE = ---- ----
FAR CONST SIZE = ---- ----
END OF MODULE INFORMATION.
C51 COMPILATION COMPLETE. 0 WARNING(S), 0 ERROR(S)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -