o_exit);MODULE_AUTHOR("hyg");MODULE_DESCRIPTION("BUTTONLEDDriver");MODULE_LICENSE("GPL");2.应用程序demo.c#include<stdio.h>#include<stdlib.h>#include<unistd.h>#include<sys/types.h>#include<sys/ioctl.h>#include<sys/time.h>#include<sys/ioctl.h>#include<errno.h>#include<fcntl.h>structgpio_config{ intbutton_num; intout_num; intled_num; intled1_num; inthumidity; inttemperature;};intmain(intargc,char**argv){ intfd; floath; floatt; structgpio_configconfig; config.button_num=26;//人体感应传感器引脚 config.led_num=3;//led引脚 config.out_num=5;//dht11引脚 config.led1_num=6;//未使用 config.humidity=0;//湿度 config.temperature=0;//温度 fd=open("/dev/Demo",O_RDWR); if(fd<0){ perror("/dev/Demo"); exit(0); } ioctl(fd,0,&config);//分配引脚传入内核态 while(1) {