git clone ssh://git.bobignou.red:23231/driver_helper
A tool to help you write the code use to manipulate the register in a device.
Some devices have a lot of registers and in those registers multiples fields. If you write the name, address, size and offset of those fields in a CSV file, this tool will write macros used to manipulates those fields.
The input file should be a CSV file. Here is an example of possible content:
There is multiple things to take into account:
The tool will generate a C header file containing macros defining the information in the input file. For example for the
FIFO_FLAG entry, the following macros will be defined.
#define FIFO_FLAG_ADDR 0 #define FIFO_FLAG_OFFSET 0 #define FIFO_FLAG_SIZE 2
Furthermore, the function-like macro
FIELD_WRITE(field_name, data) will be defined. They depends on the functions
_register_write(address, data). The two later should be defined by the user.
The usage of the tool is the following:
driver-helper <input file> <output file>
Driver Helper is written in Nelua. But as everyone might not have the Nelua compiler install, I included the generated C file in this repository.
make will compile the C file. To compile from the nelua file, run
You can then install it with
make install or uninstall it with
Back to homepage.