Author Topic: Software for peripheral registers documentation  (Read 2116 times)

0 Members and 1 Guest are viewing this topic.

Offline hcglitteTopic starter

  • Regular Contributor
  • *
  • Posts: 137
Software for peripheral registers documentation
« on: November 02, 2017, 09:23:10 pm »
Hi,
I was wondering if there exists some SW for documenting the bit fields in registers.
It would be nice to have this available for documenting various registers for a communication protocol for instance.
Then it could be exported to pdf or something and be rendered beautifully.

It's tedious to use tables in MS word etc.

Does something like this exist?
 

Offline dgtl

  • Regular Contributor
  • *
  • Posts: 183
  • Country: ee
Re: Software for peripheral registers documentation
« Reply #1 on: November 03, 2017, 12:06:01 am »
ARM based microcontrollers use SVD file (xml based) to describe registers; debuggers like Eclipse GDB plugin read the SVD and can then nicely present the register space in GUI. Perhaps there are some tools based on that? As a last resort, one can apply xslt transform to this xml file to format it to HTML. If this is better than msword tables, I'm not sure.

I'm doing technical documentation for my projects in tex. The plain text files reside in version control alongside source code; they are transformed to pdf when building the project. Importing other files is used to keep the files short and structured. Works for me. A lot of automatic documentation generation systems ie doxygen generate their stuff in tex and then transform to pdf, btw. In case of library API, sometimes it makes sense to auto-generate that and then add the textual paragraphs on to that.
 

Offline westfw

  • Super Contributor
  • ***
  • Posts: 4199
  • Country: us
Re: Software for peripheral registers documentation
« Reply #2 on: November 03, 2017, 04:47:50 am »
Atmel AVRs also produce their .h files from some sort of .XML file.  There's at least one tool (in python) that generates .h files in other formats, from the Atmel XML.  (um...  https://spaces.microchip.com/gf/project/altheadergen/ )
Using XML to describe protocol packet formats as well is an interesting idea.

I think the Ada folk (the language, not Adafruit!) have some tools for generating Ada data structure descriptions from C/C++ header flles; it might be useful as well...   https://www.adacore.com/gems/gem-59 ?

 

Offline andyturk

  • Frequent Contributor
  • **
  • Posts: 895
  • Country: us
Re: Software for peripheral registers documentation
« Reply #3 on: November 03, 2017, 06:04:23 am »
LaTeX is good for this, if you don't mind hard-core tools. Writing a document in LaTeX is a lot like programming. The bytefield makes nice looking data structures. You can also use fancier tools like graphviz.

Here's a small (sanitized) example using bytefield and tables:
 

Offline hcglitteTopic starter

  • Regular Contributor
  • *
  • Posts: 137
Re: Software for peripheral registers documentation
« Reply #4 on: November 04, 2017, 09:07:04 am »
It's been some time since I used LaTeX, but I will do a refresh. graphviz looks like a nice program for various things, will definitely use that for FSM etc! Thanks to all of you for your replies.
 

Offline westfw

  • Super Contributor
  • ***
  • Posts: 4199
  • Country: us
Re: Software for peripheral registers documentation
« Reply #5 on: November 05, 2017, 06:31:45 am »
I may not have explained my XML-related comments well enough.   I was figuring that a program capable of generating .h output from a .xml input is only a SMOP away from generating documentation in your choice of text-formatting "language."  (LaTex sounds good for "real" documentation, but HTML or MDL would be possible as well.
 

Online nctnico

  • Super Contributor
  • ***
  • Posts: 26906
  • Country: nl
    • NCT Developments
Re: Software for peripheral registers documentation
« Reply #6 on: November 05, 2017, 03:29:42 pm »
I always use Word. It is a tedious job to do well (IOW: explaining what each bit does and how it all works together).
There are small lies, big lies and then there is what is on the screen of your oscilloscope.
 

Offline andyturk

  • Frequent Contributor
  • **
  • Posts: 895
  • Country: us
Re: Software for peripheral registers documentation
« Reply #7 on: November 06, 2017, 03:45:08 am »
 

Offline FrankBuss

  • Supporter
  • ****
  • Posts: 2365
  • Country: de
    • Frank Buss
Re: Software for peripheral registers documentation
« Reply #8 on: November 06, 2017, 04:25:17 am »
If you have a SVD file, there are also Python scripts to process it:

https://github.com/posborne/cmsis-svd
So Long, and Thanks for All the Fish
Electronics, hiking, retro-computing, electronic music etc.: https://www.youtube.com/c/FrankBussProgrammer
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf