On 10/13/2016 12:24 PM, Erik Friesen wrote: > To clarify my question, I am trying to understand at what level lcnc > accesses hardware peripherals. For example, suppose I build a board with > an spi dac peripheral to the arm, as well as write the kernel driver, if > necessary. What type of glue do I need to provide in this situation?
LinuxCNC interfaces with hardware peripherals through HAL, the Hardware Abstraction Layer. Each hardware peripheral is represented by a HAL "component". A HAL component is a piece of software that talks to its hardware and presents HAL pins to the rest of LinuxCNC. A HAL component is thus a kind of device driver. It talks to LinuxCNC via HAL pins, and talks to its hardware in whatever way is appropriate for that hardware. Each HAL component runs either in "realtime" context, or "non-realtime". Since you're talking about motion control and 4 kHz update rates, you want a realtime component. Realtime components run in realtime threads, that's the "addf" stuff you see in .hal files. Here's a diagram that shows the LinuxCNC architecture: http://linuxcnc.org/docs/2.7/html/code/code-notes.html#_architecture_overview Your component would sit down in the bottom left, in the "realtime hardware devices" box. Realtime components can be written in C or in a domain-specific language called "comp". Take a look at src/hal/drivers/hal_speaker.c and src/hal/drivers/serport.comp for some simple examples. Some info on how to get started hacking on LinuxCNC are in these documents: http://linuxcnc.org/docs/devel/html/code/contributing-to-linuxcnc.html http://linuxcnc.org/docs/devel/html/code/building-linuxcnc.html Feel free to ask follow-on questions if any of this is not clear. -- Sebastian Kuzminsky ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, SlashDot.org! http://sdm.link/slashdot _______________________________________________ Emc-users mailing list Emc-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/emc-users