-
|
Hello, I am pretty new to cFS, and I've gone throguh the tutorials. What's the general approach in cFS when it comes to working with hardware modules? Say I had an i2c module that I would like a cFS app to interface with. cFS does not provide i2c APIs from what I can tell, so should we:
Doing option 1 is the most straightforward way, but it would break the whole abstraction aspect of using cFS in the first place. Option 2 is possible, but then that API would probably be mission specific unless it gets included upstream, so it's not too abstract in the end. I'm using i2c as an example but this could apply to any interface really, like SPI, RS-422, Spacewire, etc. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 4 replies
-
|
Hi! This is the intent of the "iodriver" API. That is - it is a generic PSP API for device access, similar to Currently there is just one example of a device driver, which reads the CPU load on linux and is used by HS app for reporting the current system load. |
Beta Was this translation helpful? Give feedback.
-
|
This cFS Raspberry Pi LED Control project uses a cFS library to communicate with the GPIO and a cFS app to perform the LED control. |
Beta Was this translation helpful? Give feedback.
-
|
I don’t think the RPI example violates the architectural layering, it just results in a non-portable lib/app as show in the figure below.
|
Beta Was this translation helpful? Give feedback.

Hi! This is the intent of the "iodriver" API. That is - it is a generic PSP API for device access, similar to
ioctl(). Device actions are enumerated so they can be extended without actually adding new function calls, and also allows for transparently changing underlying devices with others that have more (or less) functionality. There are several general classes of device defined and an i2c bus (raw access) would be the datagram type. You can also implement a device access module for whatever is connected via i2c, such as an ADC or DAC.Currently there is just one example of a device driver, which reads the CPU load on linux and is used by HS app for reporting the current system load.