diff options
author | Uwe Hermann <uwe@hermann-uwe.de> | 2019-05-15 00:57:42 +0200 |
---|---|---|
committer | Uwe Hermann <uwe@hermann-uwe.de> | 2019-05-15 00:58:33 +0200 |
commit | de49d11e7c54c737e822e62ae7266a6232978e6f (patch) | |
tree | 056cd301a76d3b1593bb9f0512b105a36cd0e218 | |
parent | acc08e512309a2d917045be2f9f2e46f6c5d5d99 (diff) | |
download | libsigrokdecode-de49d11e7c54c737e822e62ae7266a6232978e6f.tar.gz libsigrokdecode-de49d11e7c54c737e822e62ae7266a6232978e6f.zip |
enc28j60: Factor out command list to lists.py.
-rw-r--r-- | decoders/enc28j60/lists.py | 161 | ||||
-rw-r--r-- | decoders/enc28j60/pd.py | 140 |
2 files changed, 162 insertions, 139 deletions
diff --git a/decoders/enc28j60/lists.py b/decoders/enc28j60/lists.py new file mode 100644 index 0000000..59fbc1f --- /dev/null +++ b/decoders/enc28j60/lists.py @@ -0,0 +1,161 @@ +## +## This file is part of the libsigrokdecode project. +## +## Copyright (C) 2019 Jiahao Li <reg@ljh.me> +## +## 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. + +REGS = [ + [ + 'ERDPTL', + 'ERDPTH', + 'EWRPTL', + 'EWRPTH', + 'ETXSTL', + 'ETXSTH', + 'ETXNDL', + 'ETXNDH', + 'ERXSTL', + 'ERXSTH', + 'ERXNDL', + 'ERXNDH', + 'ERXRDPTL', + 'ERXRDPTH', + 'ERXWRPTL', + 'ERXWRPTH', + 'EDMASTL', + 'EDMASTH', + 'EDMANDL', + 'EDMANDH', + 'EDMADSTL', + 'EDMADSTH', + 'EDMACSL', + 'EDMACSH', + '—', + '—', + 'Reserved', + 'EIE', + 'EIR', + 'ESTAT', + 'ECON2', + 'ECON1', + ], + [ + 'EHT0', + 'EHT1', + 'EHT2', + 'EHT3', + 'EHT4', + 'EHT5', + 'EHT6', + 'EHT7', + 'EPMM0', + 'EPMM1', + 'EPMM2', + 'EPMM3', + 'EPMM4', + 'EPMM5', + 'EPMM6', + 'EPMM7', + 'EPMCSL', + 'EPMCSH', + '—', + '—', + 'EPMOL', + 'EPMOH', + 'Reserved', + 'Reserved', + 'ERXFCON', + 'EPKTCNT', + 'Reserved', + 'EIE', + 'EIR', + 'ESTAT', + 'ECON2', + 'ECON1', + ], + [ + 'MACON1', + 'Reserved', + 'MACON3', + 'MACON4', + 'MABBIPG', + '—', + 'MAIPGL', + 'MAIPGH', + 'MACLCON1', + 'MACLCON2', + 'MAMXFLL', + 'MAMXFLH', + 'Reserved', + 'Reserved', + 'Reserved', + '—', + 'Reserved', + 'Reserved', + 'MICMD', + '—', + 'MIREGADR', + 'Reserved', + 'MIWRL', + 'MIWRH', + 'MIRDL', + 'MIRDH', + 'Reserved', + 'EIE', + 'EIR', + 'ESTAT', + 'ECON2', + 'ECON1', + ], + [ + 'MAADR5', + 'MAADR6', + 'MAADR3', + 'MAADR4', + 'MAADR1', + 'MAADR2', + 'EBSTSD', + 'EBSTCON', + 'EBSTCSL', + 'EBSTCSH', + 'MISTAT', + '—', + '—', + '—', + '—', + '—', + '—', + '—', + 'EREVID', + '—', + '—', + 'ECOCON', + 'Reserved', + 'EFLOCON', + 'EPAUSL', + 'EPAUSH', + 'Reserved', + 'EIE', + 'EIR', + 'ESTAT', + 'ECON2', + 'ECON1', + ], +] diff --git a/decoders/enc28j60/pd.py b/decoders/enc28j60/pd.py index f2b8db7..ba36419 100644 --- a/decoders/enc28j60/pd.py +++ b/decoders/enc28j60/pd.py @@ -22,6 +22,7 @@ ## SOFTWARE. import sigrokdecode as srd +from .lists import * OPCODE_MASK = 0b11100000 REG_ADDR_MASK = 0b00011111 @@ -43,145 +44,6 @@ REG_ADDR_ECON1 = 0x1F BIT_ECON1_BSEL0 = 0b00000001 BIT_ECON1_BSEL1 = 0b00000010 -REGS = [ - [ - 'ERDPTL', - 'ERDPTH', - 'EWRPTL', - 'EWRPTH', - 'ETXSTL', - 'ETXSTH', - 'ETXNDL', - 'ETXNDH', - 'ERXSTL', - 'ERXSTH', - 'ERXNDL', - 'ERXNDH', - 'ERXRDPTL', - 'ERXRDPTH', - 'ERXWRPTL', - 'ERXWRPTH', - 'EDMASTL', - 'EDMASTH', - 'EDMANDL', - 'EDMANDH', - 'EDMADSTL', - 'EDMADSTH', - 'EDMACSL', - 'EDMACSH', - '—', - '—', - 'Reserved', - 'EIE', - 'EIR', - 'ESTAT', - 'ECON2', - 'ECON1', - ], - [ - 'EHT0', - 'EHT1', - 'EHT2', - 'EHT3', - 'EHT4', - 'EHT5', - 'EHT6', - 'EHT7', - 'EPMM0', - 'EPMM1', - 'EPMM2', - 'EPMM3', - 'EPMM4', - 'EPMM5', - 'EPMM6', - 'EPMM7', - 'EPMCSL', - 'EPMCSH', - '—', - '—', - 'EPMOL', - 'EPMOH', - 'Reserved', - 'Reserved', - 'ERXFCON', - 'EPKTCNT', - 'Reserved', - 'EIE', - 'EIR', - 'ESTAT', - 'ECON2', - 'ECON1', - ], - [ - 'MACON1', - 'Reserved', - 'MACON3', - 'MACON4', - 'MABBIPG', - '—', - 'MAIPGL', - 'MAIPGH', - 'MACLCON1', - 'MACLCON2', - 'MAMXFLL', - 'MAMXFLH', - 'Reserved', - 'Reserved', - 'Reserved', - '—', - 'Reserved', - 'Reserved', - 'MICMD', - '—', - 'MIREGADR', - 'Reserved', - 'MIWRL', - 'MIWRH', - 'MIRDL', - 'MIRDH', - 'Reserved', - 'EIE', - 'EIR', - 'ESTAT', - 'ECON2', - 'ECON1', - ], - [ - 'MAADR5', - 'MAADR6', - 'MAADR3', - 'MAADR4', - 'MAADR1', - 'MAADR2', - 'EBSTSD', - 'EBSTCON', - 'EBSTCSL', - 'EBSTCSH', - 'MISTAT', - '—', - '—', - '—', - '—', - '—', - '—', - '—', - 'EREVID', - '—', - '—', - 'ECOCON', - 'Reserved', - 'EFLOCON', - 'EPAUSL', - 'EPAUSH', - 'Reserved', - 'EIE', - 'EIR', - 'ESTAT', - 'ECON2', - 'ECON1', - ], -] - class Decoder(srd.Decoder): api_version = 3 id = 'enc28j60' |