![](https://img-blog.csdnimg.cn/20201014180756724.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Linux编程
donglicaiju76152
这个作者很懒,什么都没留下…
展开
-
Linux下操作串口
背景嵌入式Linux开发,绕不开串口操作。代码#include <stdio.h>#include <string.h>#include <stdlib.h>#include <termios.h>#include <sys/time.h>#include <sys/types.h>#include <...原创 2020-01-18 20:10:56 · 264 阅读 · 0 评论 -
Linux下操作GPIO
背景嵌入式Linux下需要经常操作GPIO管脚,其中一种方式是使用/sys/文件系统下内核暴露出来的gpio文件。代码#include <stdio.h>#include <string.h>#include <stdlib.h>#include <termios.h>#include <sys/time.h>#inclu...原创 2020-01-18 20:07:05 · 279 阅读 · 0 评论 -
setitimer定时器的简单使用
1 函数简介#include int setitimer(int which, const struct itimerval *new_value, struct itimerval *old_value);The system provides each process with three interval timers,原创 2015-10-16 08:58:40 · 636 阅读 · 0 评论 -
Unix Socket - Quick Guide
What is a Socket?Sockets allow communication between two different processes on the same or different machines. To be more precise, it's a way to talk to other computers using standard Unix file des转载 2015-10-08 15:41:43 · 1356 阅读 · 0 评论 -
linux下的时间操作
1由UNIX内核提供的基本时间服务是计算自国际标准时间公元1970年1月1日00:00:00以来经过的秒数。这种秒数是以数据类型time_t表示的,我们称之为日历时间。一旦取得这种以秒计的整型时间值后,通常要调用另一个时间函数将其转换为人们可读的时间和日期,我们称之为分解时间。为了将分解时间以各种形式显示出来,通常要调用一些函数将其转换成相应的字符串。具体转换如下图:2 日历时间2.原创 2015-10-15 12:39:25 · 518 阅读 · 0 评论 -
Linux串口通信
1 概述这儿说的串口包括两种,232和485。其实,二者没有本质的区别,驱动都是一样的,只是232是双工,而485是半双工。所以,485在正常情况下出于接收状态,一旦需要发送数据时,需要设置对于的IO的状态,使其出于发送状态。除此,没有太多区别。下面已485为例具体总结。2 打开串口 fd = open("/dev/s3c2410_serial0", O_RDWR|O_N原创 2015-11-21 10:56:28 · 783 阅读 · 0 评论