[英]Userspace Serial communication Library on Linux
I need to develop a (userspace) library to handle serial communication on Linux (on Zynq-Zybo Board: UART, SPI, I2C). 我需要开发一个(用户空间)库来处理Linux上的串行通信(在Zynq-Zybo板上: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. 我浏览了各种网站和资料,并研究了xilinx-linux内核,以及有关O'Reilly Linux Device Drivers的一些参考。
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.). 到目前为止,我发现:Linux已经包含自己的内核模块来处理通信(例如:UART内核模块处理外围设备,以便它们显示在/ dev /中,并且可以通过该设备文件与该设备进行交互。从用户空间使用打开,读取,写入等)。
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 快速搜索中似乎有很多库,所以不确定为什么要发明轮子,例如https://www.acmesystems.it/user_i2c
but anyway if it is new type of bus/device, a user space library is always good approach 但是无论如何,如果它是新型的总线/设备,那么用户空间库始终是一个好方法
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.