annotate src/external_flash.inc @ 630:4cd81bdbf15c

3.08 stable release
author heinrichsweikamp
date Fri, 21 Feb 2020 10:51:36 +0100
parents c40025d8e750
children 185ba2f91f59
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
heinrichsweikamp
parents:
diff changeset
1 ;=============================================================================
heinrichsweikamp
parents:
diff changeset
2 ;
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 582
diff changeset
3 ; File external_flash.inc combined next generation V3.0.1
0
heinrichsweikamp
parents:
diff changeset
4 ;
heinrichsweikamp
parents:
diff changeset
5 ;
heinrichsweikamp
parents:
diff changeset
6 ; Copyright (c) 2011, JD Gascuel, HeinrichsWeikamp, all right reserved.
heinrichsweikamp
parents:
diff changeset
7 ;=============================================================================
heinrichsweikamp
parents:
diff changeset
8 ; HISTORY
heinrichsweikamp
parents:
diff changeset
9 ; 2011-08-12 : [mH] creation
heinrichsweikamp
parents:
diff changeset
10
heinrichsweikamp
parents:
diff changeset
11 ; Misc
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 561
diff changeset
12 extern incf_ext_flash_address_p1 ; +1 for the ext_flash_address:3
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 582
diff changeset
13 extern ext_flash_disable_protection ; disables write protection
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 582
diff changeset
14 extern ext_flash_enable_protection ; enables write protection
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 561
diff changeset
15
0
heinrichsweikamp
parents:
diff changeset
16 ; Writes
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 582
diff changeset
17 extern write_byte_ext_flash_plus ; write from WREG and increase address after write with banking at 0x200000
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 582
diff changeset
18 extern write_byte_ext_flash_plus_nocnt ; no increase of ext_flash_dive_counter:3
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 582
diff changeset
19 extern write_byte_ext_flash_plus_nodel ; does NOT delete 4kB Page when required
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 582
diff changeset
20 extern write_byte_ext_flash_plus_header ; write from WREG and increase address after write
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 582
diff changeset
21 extern ext_flash_byte_write ; writes one byte from WREG @ext_flash_address:3
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 561
diff changeset
22 extern ext_flash_byte_write_comms ; without wait, ~86us fixed delay due to 115200 Bauds (Use with caution)
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 582
diff changeset
23 extern write_spi1 ; just (dummy)write to read a byte
0
heinrichsweikamp
parents:
diff changeset
24
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 561
diff changeset
25 ; Delete
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 561
diff changeset
26 extern ext_flash_erase_logbook ; erases logbook memory (000000h -> 2FFFFFh -> 3MByte)
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 582
diff changeset
27 extern ext_flash_erase4kB ; erases 4kB sector @ext_flash_address:3
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 561
diff changeset
28
0
heinrichsweikamp
parents:
diff changeset
29 ; Reads
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 582
diff changeset
30 extern ext_flash_read_block_start ; block read start and reads one byte@ext_flash_address:3 into WREG
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 582
diff changeset
31 extern ext_flash_read_block ; read another byte into WREG
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 582
diff changeset
32 extern ext_flash_read_block_stop ; stop block read
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 582
diff changeset
33 extern ext_flash_byte_read ; read one byte@ext_flash_address:3 into WREG and ext_flash_rw
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 582
diff changeset
34 extern ext_flash_byte_read_plus ; return data read in WREG and ext_flash_rw and increase address after read with banking at 0x200000
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 582
diff changeset
35 extern ext_flash_byte_read_plus_0x20 ; return data read in WREG and ext_flash_rw
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 561
diff changeset
36
0
heinrichsweikamp
parents:
diff changeset
37
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 582
diff changeset
38 ;-----------------------------------------------------------------------------
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 582
diff changeset
39 ; Macros
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 582
diff changeset
40
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 582
diff changeset
41 ; decrease ext_flash_address:2 by the 8 bit value "ext_flash_temp1"
0
heinrichsweikamp
parents:
diff changeset
42 extern decf_ext_flash_address0
heinrichsweikamp
parents:
diff changeset
43 decf_ext_flash_address macro ext_flash_temp1
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 561
diff changeset
44 movlw ext_flash_temp1
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 561
diff changeset
45 call decf_ext_flash_address0
0
heinrichsweikamp
parents:
diff changeset
46 endm
heinrichsweikamp
parents:
diff changeset
47
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 582
diff changeset
48 ; increase ext_flash_address:2 by the 8 bit value "ext_flash_temp1"
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 561
diff changeset
49 extern incf_ext_flash_address0
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 561
diff changeset
50 incf_ext_flash_address macro ext_flash_temp1
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 561
diff changeset
51 movlw ext_flash_temp1
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 561
diff changeset
52 call incf_ext_flash_address0
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 561
diff changeset
53 endm
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 561
diff changeset
54
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 582
diff changeset
55 ; increase ext_flash_address:2 by the 8 bit value "ext_flash_temp1" with banking at 0x200000
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 561
diff changeset
56 extern incf_ext_flash_address0_0x20
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 561
diff changeset
57 incf_ext_flash_address_0x20 macro ext_flash_temp1
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 561
diff changeset
58 movlw ext_flash_temp1
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 561
diff changeset
59 call incf_ext_flash_address0_0x20
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 561
diff changeset
60 endm