]> sigrok.org Git - libsigrokdecode.git/blobdiff - decoders/spiflash/lists.py
license: remove FSF postal address from boiler plate license text
[libsigrokdecode.git] / decoders / spiflash / lists.py
index a692119bd9c9b1617059ad197de360fe849e0e26..9aa6bd4b0969c7c61d3f9dad1d6135941baf187e 100644 (file)
 ## GNU General Public License for more details.
 ##
 ## You should have received a copy of the GNU General Public License
-## along with this program; if not, write to the Free Software
-## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
+## along with this program; if not, see <http://www.gnu.org/licenses/>.
 ##
 
-# Dict which maps command IDs to their names and descriptions.
-cmds = {
-    0x06: ('WREN', 'Write enable'),
-    0x04: ('WRDI', 'Write disable'),
-    0x9f: ('RDID', 'Read identification'),
-    0x05: ('RDSR', 'Read status register'),
-    0x35: ('RDSR2', 'Read status register 2'),
-    0x01: ('WRSR', 'Write status register'),
-    0x03: ('READ', 'Read data'),
-    0x0b: ('FAST/READ', 'Fast read data'),
-    0xbb: ('2READ', '2x I/O read'),
-    0x20: ('SE', 'Sector erase'),
-    0xd8: ('BE', 'Block erase'),
-    0x60: ('CE', 'Chip erase'),
-    0xc7: ('CE2', 'Chip erase'), # Alternative command ID
-    0x02: ('PP', 'Page program'),
-    0xad: ('CP', 'Continuously program mode'),
-    0xb9: ('DP', 'Deep power down'),
-    0xab: ('RDP/RES', 'Release from deep powerdown / Read electronic ID'),
-    0x90: ('REMS', 'Read electronic manufacturer & device ID'),
-    0xef: ('REMS2', 'Read ID for 2x I/O mode'),
-    0xb1: ('ENSO', 'Enter secured OTP'),
-    0xc1: ('EXSO', 'Exit secured OTP'),
-    0x2b: ('RDSCUR', 'Read security register'),
-    0x2f: ('WRSCUR', 'Write security register'),
-    0x70: ('ESRY', 'Enable SO to output RY/BY#'),
-    0x80: ('DSRY', 'Disable SO to output RY/BY#'),
-}
+from collections import OrderedDict
+
+# OrderedDict which maps command IDs to their names and descriptions.
+# Please keep this sorted by command ID.
+# Don't forget to update 'Ann' in pd.py if you add/remove items here.
+cmds = OrderedDict([
+    (0x01, ('WRSR', 'Write status register')),
+    (0x02, ('PP', 'Page program')),
+    (0x03, ('READ', 'Read data')),
+    (0x04, ('WRDI', 'Write disable')),
+    (0x05, ('RDSR', 'Read status register')),
+    (0x06, ('WREN', 'Write enable')),
+    (0x0b, ('FAST/READ', 'Fast read data')),
+    (0x20, ('SE', 'Sector erase')),
+    (0x2b, ('RDSCUR', 'Read security register')),
+    (0x2f, ('WRSCUR', 'Write security register')),
+    (0x35, ('RDSR2', 'Read status register 2')),
+    (0x60, ('CE', 'Chip erase')),
+    (0x70, ('ESRY', 'Enable SO to output RY/BY#')),
+    (0x80, ('DSRY', 'Disable SO to output RY/BY#')),
+    (0x90, ('REMS', 'Read electronic manufacturer & device ID')),
+    (0x9f, ('RDID', 'Read identification')),
+    (0xab, ('RDP/RES', 'Release from deep powerdown / Read electronic ID')),
+    (0xad, ('CP', 'Continuously program mode')),
+    (0xb1, ('ENSO', 'Enter secured OTP')),
+    (0xb9, ('DP', 'Deep power down')),
+    (0xbb, ('2READ', '2x I/O read')), # a.k.a. "Fast read dual I/O".
+    (0xc1, ('EXSO', 'Exit secured OTP')),
+    (0xc7, ('CE2', 'Chip erase')), # Alternative command ID
+    (0xd8, ('BE', 'Block erase')),
+    (0xef, ('REMS2', 'Read ID for 2x I/O mode')),
+])
 
 device_name = {
     'fidelix': {