I need to develop a (userspace) library to handle serial communication on Linux (on Zynq-Zybo Board: UART, SPI, I2C).
I explored various websites and stuff, and investigated the xilinx-linux kernel, as well as some references on O'Reilly Linux Device Drivers book.
What I found so far is: Linux already includes its own kernel modules to handle the communication (for example: the UART kernel module handles the peripherals so that they show up in /dev/, and through that device file I can interact with the device from userspace using open, read, write, etc.).
I also read that, as a common pattern, interaction with the device driver is done through a character device driver, which is accessed in user-space and is responsible of the interaction with the device driver (details in the following image)
The ideas which came to my mind are:
My question is: which way should i pursue, and why?
Also, whatever article/book/link on the subject will be highly appreciated.
Thanks in advance!
from a quick search is seem like there is alot of libraries, so not sure why you want to invent the wheel eg https://www.acmesystems.it/user_i2c
but anyway if it is new type of bus/device, a user space library is always good approach
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.