## 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/>.
##
import sigrokdecode as srd
}
class Decoder(srd.Decoder):
- api_version = 1
+ api_version = 2
id = 'lpc'
name = 'LPC'
longname = 'Low-Pin-Count'
('warnings', 'Warnings', (0,)),
)
- def __init__(self, **kwargs):
+ def __init__(self):
self.state = 'IDLE'
self.oldlclk = -1
self.samplenum = 0
self.ss_block = self.es_block = None
def start(self):
- # self.out_python = self.register(srd.OUTPUT_PYTHON)
self.out_ann = self.register(srd.OUTPUT_ANN)
def putb(self, data):
if self.state == 'IDLE':
# A valid LPC cycle starts with LFRAME# being asserted (low).
if lframe != 0:
- continue
+ continue
self.ss_block = self.samplenum
self.state = 'GET START'
self.lad = -1
self.handle_get_data(lad, lad_bits)
elif self.state == 'GET TAR2':
self.handle_get_tar2(lad, lad_bits)
- else:
- raise Exception('Invalid state: %s' % self.state)
-