0
|
1 ;=============================================================================
|
|
2 ;
|
|
3 ; File external_flash.inc
|
|
4 ;
|
|
5 ;
|
|
6 ; Copyright (c) 2011, JD Gascuel, HeinrichsWeikamp, all right reserved.
|
|
7 ;=============================================================================
|
|
8 ; HISTORY
|
|
9 ; 2011-08-12 : [mH] creation
|
|
10
|
|
11 ; Misc
|
|
12 extern ext_flash_power_down ; Put Flash in Deep Power Down
|
|
13 extern incf_ext_flash_address_p1 ; +1 for the ext_flash_address:3
|
|
14 extern ext_flash_disable_protection; Disables write protection
|
|
15 extern ext_flash_enable_protection ; Enables write protection
|
|
16
|
|
17 ; Writes
|
|
18 extern write_byte_ext_flash_plus ; Write from WREG and increase address after write with banking at 0x200000
|
6
|
19 extern write_byte_ext_flash_plus_nocnt
|
0
|
20 extern write_byte_ext_flash_plus_header ; Write from WREG and increase address after write
|
|
21 extern ext_flash_byte_write ; Writes one byte from WREG @ext_flash_address:3
|
|
22 extern write_spi1 ; Just (dummy)write to read a byte
|
|
23
|
|
24 ; Delelte
|
|
25 extern ext_flash_erase_logbook ; erases logbook memory (000000h -> 2FFFFFh -> 3MByte)
|
|
26 extern ext_flash_erase4kB ; Erases 4kB sector @ext_flash_address:3
|
|
27
|
|
28 ; Reads
|
|
29 extern ext_flash_read_block_start ; Block read start and reads one byte@ext_flash_address:3 into WREG
|
|
30 extern ext_flash_read_block ; Read another byte into WREG
|
|
31 extern ext_flash_read_block_stop ; Stop block read
|
|
32 extern ext_flash_byte_read ; Reads one byte@ext_flash_address:3 into WREG and temp1
|
|
33 extern ext_flash_byte_read_plus ; Return data read in WREG and temp1 and increase address after read with banking at 0x200000
|
|
34 extern ext_flash_byte_read_plus_0x20; Return data read in WREG and temp1
|
|
35
|
|
36 ; Will decrease ext_flash_address:2 with the 8Bit value "ext_flash_temp1"
|
|
37 extern decf_ext_flash_address0
|
|
38 decf_ext_flash_address macro ext_flash_temp1
|
|
39 movlw ext_flash_temp1
|
|
40 call decf_ext_flash_address0
|
|
41 endm
|
|
42
|
|
43 extern incf_ext_flash_address0
|
|
44 ; Will increase ext_flash_address:2 with the 8Bit value "ext_flash_temp1"
|
|
45 incf_ext_flash_address macro ext_flash_temp1
|
|
46 movlw ext_flash_temp1
|
|
47 call incf_ext_flash_address0
|
|
48 endm
|
|
49
|
|
50 ; With banking at 0x200000
|
|
51 extern incf_ext_flash_address0_0x20
|
|
52 ; Will increase ext_flash_address:2 with the 8Bit value "ext_flash_temp1"
|
|
53 incf_ext_flash_address_0x20 macro ext_flash_temp1
|
|
54 movlw ext_flash_temp1
|
|
55 call incf_ext_flash_address0_0x20
|
|
56 endm
|
|
57
|
|
58
|