wallento / wavedrompy

WaveDrom compatible python command line

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Register rendering options data format

leonardopsantos opened this issue · comments

Hi there!

Just to document the options:

import wavedrom

data = """
{"reg":
  [
    { "name":"IO_MODE",         "bits":7, "attr": "RW"},
    { "name":"NS_ACCESS_GPIO",  "bits":1, "attr": "RW"},
    { "name":"PULL_CTRL",       "bits":2, "attr": "RW"},
    { "name":"LPF",             "bits":1, "attr": "RW"},
    {                           "bits":1              },
    { "name":"DRIVE",           "bits":2, "attr": "RW"},
    {                           "bits":18             }
  ],
 "config": {"fontsize":6}
}
"""

svg = wavedrom.render(data)

svg.saveas("demo3.svg")

The available parameters are defined in the bitfield.Options constructor:

class Options:
    def __init__(self, vspace=80, hspace=800, lanes=1, bits=32, fontsize=14, bigendian=False, fontfamily='sans-serif',
                 fontweight='normal'):