|
Re: Custom roboRIO HAL: Where to find C library for roboRIO fpga?
Quote:
Originally Posted by CodeYeti
Hello. I noticed that WPIlib uses a C++ api to access the roborio fpga (this api appears to be generated). I was wondering if there is anyplace I could either find or (even better), generate, a C version of this api to the roboRIO fpga?
I found this document from NI seemingly explaining how to get the c support library for roborio, but when I go to http://ni.com/info and enter the code roboriocsupport2015, nothing comes up.
It would be really advantageous if I could somehow just do the code generation myself rather than rely on an NI mirror, but I bet the FPGA definitions required to generate that are probably proprietary.
tl;dr Where is wpilib getting it's fpga libraries/headers for the roborio? And where can I find a C (instead of C++) equivalent?
Beyond that, I'd be stuck with writing C-ish bindings to the c++ version of the api, which seems easily breakable and just wrong.
Thanks in advance for the help,
Matt Coffin
|
You can get a link to clone the repository here. In there, in the HAL folder, there are already C bindings for the HAL. Both the python and the .NET teams use those directly to interface with the HAL. It's actually fairly easy to do.
__________________
All statements made are my own and not the feelings of any of my affiliated teams.
Teams 1510 and 2898 - Student 2010-2012
Team 4488 - Mentor 2013-2016
Co-developer of RobotDotNet, a .NET port of the WPILib.
|