I agree; It's a lot of code. Since you graciously offered to help with this project, I’m sharing the details of what is under the hood.
Breakdown
There are 57 GPIO pins on the bmc2711(and yes, Rpi doesn't use them all)
Each pin is supported by 12 registers(the pins are capable of much more than just on/off). Each bitmapped register needs 3-4 lines to characterize its function. (name, bits, parent, shadow).
57*12*3 = 2052. There are three lines of 'comment' separating each GPIO to make it more readable and provide an index into the 'pins' array.
57*3 = 171
26 lines of 'license.
So we're pretty close to your 2500. There's also another 2500+ lines for each of the separate register words. The tool does you the favor of breaking out and manipulating the bits separately by name.
One goal was to keep the YAML format/schema simple, without adding something like a 'template' or 'prototype', which would greatly reduce the lines and increase the code's complexity.
There is, however, if you dig a little deeper into the code base, some Python templates(only about 200 lines) that were used to render all of this, and may serve as an example for other Rpi functionality.
In short, this tool allows for a diversity of uses.
Breakdown
There are 57 GPIO pins on the bmc2711(and yes, Rpi doesn't use them all)
Each pin is supported by 12 registers(the pins are capable of much more than just on/off). Each bitmapped register needs 3-4 lines to characterize its function. (name, bits, parent, shadow).
57*12*3 = 2052. There are three lines of 'comment' separating each GPIO to make it more readable and provide an index into the 'pins' array.
57*3 = 171
26 lines of 'license.
So we're pretty close to your 2500. There's also another 2500+ lines for each of the separate register words. The tool does you the favor of breaking out and manipulating the bits separately by name.
One goal was to keep the YAML format/schema simple, without adding something like a 'template' or 'prototype', which would greatly reduce the lines and increase the code's complexity.
There is, however, if you dig a little deeper into the code base, some Python templates(only about 200 lines) that were used to render all of this, and may serve as an example for other Rpi functionality.
In short, this tool allows for a diversity of uses.
Statistics: Posted by AndrewOfC — Fri Aug 29, 2025 11:41 pm