随笔分类 - 4—Linux_应用
摘要:LInux_SPI_APP #include <stdint.h> #include <unistd.h> #include <stdio.h> #include <stdlib.h> #include <getopt.h> #include <fcntl.h> #include <sys/ioct
阅读全文
摘要:LInux_LCD_APP #include <stdio.h> #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> #include <sys/ioctl.h> #include <linux/fb.h> #include
阅读全文
摘要:RGB565转BMP #include <string.h> #include <stdlib.h> #include <stdio.h> #define BMP_W 120#define BMP_H 80 char bmp_map[] = { } #define BI_BITFIELDS 0x3
阅读全文
摘要:LVGL /* Display flushing */ void my_disp_flush(lv_disp_drv_t *disp, const lv_area_t *area, lv_color_t *color_p) { uint32_t temp_x, temp_y; for(temp_y=
阅读全文
摘要:Linux timer 机制 1. setitimer()setitimer一个进程中只能有一个 下一个会覆盖前一个的定时 想一个进程多个定时器只能自己实现linux系统给每个进程提供了3个定时器,每个定时器在各自不同的域里面计数。当任何一个timer计数到结束了,系统就发送一个信号(signal)
阅读全文
摘要:#include<stdio.h> #define BUG_POWER #ifdef BUG_POWER #define ENTRY 5 #define DEBUG 4 #define INFO 3 #define WARN 2 #define ERROR 1 #define PRINT_LEVEL
阅读全文
摘要:Cmake 开源、跨平台的构建工具,通过编写简单的配置文件去生成本地的Makefile,独立于运行平台和编译器不用亲自去编写Makefile,配置文件可以直接拿到其它平台上使用,无需修改,非常方便 # 版本cmake_minimum_required (VERSION 2.8) #工程 projec
阅读全文
摘要:IO编程 1.标准IO :标准c库提供对文件操作的函数接口 行缓冲:1024byte,截止:存满,调用fflush,程序结束,遇到\n (fgetc/fputc fgets/fputs ) 全缓冲:4096byte,截止:存满,调用fflush,程序结束 (fread/fwrite) 不缓冲:0by
阅读全文
摘要:list.h 链表结构体 struct list_head { struct list_head *next, *prev; }; INIT_LIST_HEAD :创建内核链表 / 初始化头结点 list_for_each :遍历链表 list_add :在链表头插入节点 list_add_tail
阅读全文
摘要:TCP 代码示例:https://www.cnblogs.com/panda-w/p/11063829.html UDP 代码示例:https://www.cnblogs.com/panda-w/p/11063834.html UDP : 1.点对点,无连接,无应答,不根据网络好还调整分组数据大小
阅读全文
摘要:进程线程 进程是资源分配的基本单位, 线程是系统调度的基本单位 1.进程: 孤儿进程,守护进程,僵尸进程 函数:fork ,wait,waitpid, 进程间通讯(IPC): 1. 种类:无名管道,有名管道,信号通讯 消息队列,共享内存,信号量灯 socket 2.目的:实现数据共享 3. 无名管道
阅读全文
摘要:<数据类型> <数据结构> 双向循环链表: 代码示例: 内核链表: 代码示例: 队列: 代码示例:https://www.cnblogs.com/panda-w/p/11081126.html 栈: 代码示例:https://www.cnblogs.com/panda-w/p/11081129.ht
阅读全文