?? led_test.c
字號:
#include <stdio.h>#include <sys/types.h>#include <sys/stat.h>#include <fcntl.h>#include <unistd.h>#include <string.h>#include <termios.h>#include <errno.h>#include "at91_gpio.h"#include "at91_ioctl.h"#define SYS_LED AT91_PIN_PC10int fd;at91_gpio_arg arg;void sysled_on(){ int fd; arg.pin= SYS_LED; arg.data = 1; ioctl(fd, IOCTL_GPIO_SETOUTPUT, &arg);}void sysled_off(){ arg.pin= SYS_LED; arg.data = 0; ioctl(fd, IOCTL_GPIO_SETOUTPUT, &arg);}int main(int argc, char *argv[]){ fd = open ("/dev/gpio", O_RDWR); while (1){ sysled_on(); sleep(1); sysled_off(); } close(fd); }
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -