In the development vesion of emc2, you'll find complete manpages for the HAL and RTAPI libraries. Of course, you can also read the source for all the existing hardwre drivers as well.
Basically, it boils down to writing one function to set up your hardware and create the HAL pins, parameters, and functions, and two functions to read and write the hardware, copying vaues to/from the HAL pins. Here is a traditional hardware driver -- in this case, for the PC parallel port: http://cvs.linuxcnc.org/cvs/emc2/src/hal/drivers/hal_parport.c?rev=1.27;content-type=text%2Fplain Here is a "comp"-style hardware driver -- in this case, for the control lines of the PC serial port: http://cvs.linuxcnc.org/cvs/emc2/src/hal/drivers/serport.comp?rev=1.4;content-type=text%2Fplain HTML versions of the manual pages are here (scroll to the bottom): http://linuxcnc.org/docs/devel/html/ As is documentation for the "comp" preprocessor: http://linuxcnc.org/docs/devel/html/hal/comp/index.html Installing a new HAL module is easy in the development version, just run: sudo comp --install whatever.c OR whatever.comp to compile and install the component from source. In emc 2.0.4, you have to add your new driver to the source tree, modify the Makefile, and recompile. 'comp' is not available. A few APIs don't exist in 2.0.4, such as hal_ready(). If you are writing drivers for hardware that is commercially available, please consider licensing your driver under the GPL or LGPL, allowing us to incorporate it in a future version of emc2. Jeff ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ Emc-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/emc-users
