shutdown.c
来自「基于linux和s3c2440的gpio驱动程序」· C语言 代码 · 共 29 行
C
29 行
//written by bcng xiyong,2007-7-1//set gpj4 to zero to give a kill signal to chip ltc2950#include <sys/types.h>#include <sys/stat.h>#include <fcntl.h>#include <stdio.h>#include <termios.h>#include <unistd.h>#define GPJCON 0x560000d0#define GPJ4 0x4int main( ){ int fd; unsigned long p[2]; fd=open("/dev/gpio",O_RDWR | O_NOCTTY); if (fd < 0) { printf("can not open gpio!\n"); return -1; } p[0]=GPJCON; //GPJCON p[1]=GPJ4; write(fd,p,0x0); close(fd);}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?