NI Linux Real-Time Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

SMBus protocol access from Linux kernel

Hello

Is this possible to acces from Linux kernel level at digital lines to device with SMBus interface? Linux kernel has libraries with SMBus protocol operations, so there are in fact two questions:

1. Can I use linux kernel library for SMBus?

2. How to determine digital lines that will be SMBUs lines (SDA, SCL)

Why? If I will use FPGA resources that will be necessary to place protocol code to FPGA - that will take some amount of resources.

It will be good to have possibility to monitor SMBus device from Real-Time OS level without placing code in to FPGA.

0 Kudos
Message 1 of 4
(3,781 Views)

What device are you using? A 9068 or is it a myRIO?

0 Kudos
Message 2 of 4
(2,984 Views)

Curent target is myRIO 1900, but I am also interested in solution for sbRIO.

0 Kudos
Message 3 of 4
(2,984 Views)

If you are interested in using the I²C that is exposed through the connectors on the myRIO's MXP connector, you must use the FPGA to actually implement the I²C controller, therefore the kernel has no knowledge of the device. You could certainly expose the lines directly from the FPGA VI itself and use the FPGA C API to interact with the FPGA VI from C/C++ if you desire, of course you could likewise simply put the guts of the control in the FPGA VI itself and expose a "Read" and "Write" interface that you could use.

Basic answer is, since we're talking about something that is dynamically configured, there's not currently a good way for the kernel to know of the device to expose the kernel interface to the device (and, even if it did, it wouldn't expose things at the level that you are asking). So LVFPGA + the FPGA C API gives you the flexibility that you're asking for. I'm not sure if there is already a nice, pre-made library for interacting with the default personality in the myRIO, but I wouldn't be surprised.

Edit: See: http://forums.ni.com/t5/Academic-Hardware-Products-ELVIS/myRIO-C-Language-Programming/m-p/2715119/hi...

Message 4 of 4
(2,984 Views)