-
Notifications
You must be signed in to change notification settings - Fork 1
/
core.con.25xxxx.spin2
104 lines (88 loc) · 3.75 KB
/
core.con.25xxxx.spin2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
{
----------------------------------------------------------------------------------------------------
Filename: core.con.25xxxx.spin2
Description: 25xxxx-specific constants
Author: Jesse Burt
Started: Nov 9, 2019
Updated: Sep 18, 2024
Copyright (c) 2024 - See end of file for terms of use.
----------------------------------------------------------------------------------------------------
}
CON
' SPI Configuration
SCK_MAX_FREQ = 104_000_000
SPI_MODE = 0
T_POR = TRST
' Known device ID responses
W25Q128FV = $17
' Timings (microseconds)
TRST = 1 ' time to reset
TVSL = 20 ' VCC (min) to CS low
TPUW = 5_000 ' time delay before write
' Register definitions
WRITE_STATUS1 = $01
PAGE_PROG = $02
READ_DATA = $03
WRITE_DISABLE = $04
READ_STATUS1 = $05
SRP = 7
SEC = 6
TB = 5
BP = 2
WEL = 1
BUSY = 0
BP_BITS = %111
FLAG_BUSY = %1
WRITE_ENABLE = $06
FAST_READ = $0B
WRITE_STATUS3 = $11
READ_STATUS3 = $15
SECTOR_ERASE = $20
WRITE_STATUS2 = $31
QUAD_PAGE_PROG = $32
READ_STATUS2 = $35
INDIV_BLK_LOCK = $36
ENTER_QPIMODE = $38
INDIV_BLK_UNLOCK = $39
FASTREAD_DUAL = $3B
READ_BLK_LOCK = $3D
PROG_SECURITY = $42
ERASE_SECURITY = $44
READ_SECURITY = $48
UNIQUE_ID = $4B
VOLATILE_SR_WR_EN = $50
BLK32_ERASE = $52
READ_SFDP = $5A
CHIP_ERASE = $60
ENABLE_RESET = $66
FASTREAD_QUAD = $6B
ERASE_PROG_SUSP = $75
BURST_WITH_WRAP = $77
ERASE_PROG_RESUME = $7A
GLOBAL_BLK_LOCK = $7E
MANUF_DEV_ID = $90
GLOBAL_BLK_UNLOCK = $98
RESET_DEVICE = $99
JEDEC_ID = $9F
RELEASE_PWRDOWN = $AB
POWER_DOWN = $B9
CHIP_ERASE2 = $C7
BLK64_ERASE = $D8
PUB null()
' This is not a top-level object
DAT
{
Copyright 2024 Jesse Burt
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
associated documentation files (the "Software"), to deal in the Software without restriction,
including without limitation the rights to use, copy, modify, merge, publish, distribute,
sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or
substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT
NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT
OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
}