⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 test_iic_led.c

📁 华清远见刘俊先生 嵌入式linux驱动光盘的源代码 embeded-Linux-driver-cdrom.rar
💻 C
字号:
#include <unistd.h>#include <linux/fs.h>#include <sys/types.h>#include <sys/stat.h>#include <fcntl.h>#include <stdio.h>#define LED_SLAVE_ADD	0x70int main(){        int fd = open("/dev/led",O_RDWR);	//can read and write	char null_buf[5]={-1,-1,-1,-1,-1};        if (fd == -1)        {                perror("can't open device led_board!");                exit(1);        }	while(1)	{		write(fd,null_buf,5);		sleep(1);	}      close(fd);}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -