当前位置:首页>Linux>Linux设备驱动 -- DS18B20驱动编程

Linux设备驱动 -- DS18B20驱动编程

  • 2026-03-23 20:13:38
Linux设备驱动 -- DS18B20驱动编程

野火imx6ull开发板硬件接口

  • DS18B20是一款单总线的温度传感器。
  • 每个总线上可以挂载多个DS18B20,每个DS18B20具备唯一的ID,所以可以根据ID选择访问的DS18B20
  • 若只有一个DS18B20,则不需要选择ID

DS18B20的驱动流程

总流程:

  • 启动温度转换
  • 读取温度

启动温度转换流程:

  • 发出Start信号
  • 得到回应
  • 发出8位的数据,用于选择某个DS18B20
  • 发出温度转换命令
  • 等待温度转换完毕

如何读取温度:

  • 发出Start信号
  • 得到回应
  • 发出8位的数据,用于选择某个DS18B20
  • 发出读暂存器的命令
  • 读温度低8位
  • 读温度高8位

DS18B20硬件时序信号

复位初始化时序

  • 必须要拉低至少480us,这是复位信号;
  • 然后拉高释放总线,等待15~60us之后,
  • 若存在DS18B20,其会拉低总线60~240us表示DS18B20初始化复位成功。

写一个bit时序

  • 写0,拉低至少60us,写周期为60-120us
  • 写1,拉低1us,写周期至少60us
  • 整个读周期需要在15us内完成
  • 主机拉低总线至少1us,接着读取总线电平,为0表示读到的bit数据为0,若为1则表示读到数据是1

DS18B20驱动实现

设备树编写

根节点下添加节点:

    ds18b20 {        compatible = "xgj,ds18b20";        pinctrl-names = "default";        pinctrl-0 = <&pinctrl_ds18b20>;        ds18b20-gpios = <&gpio1 2 GPIO_ACTIVE_HIGH>;         status = "okay"    };

在iomuxc节点添加DS18B20相关的pinctrl节点

/*ds18b20*/    pinctrl_ds18b20: ds18b20grp {        fsl,pins = <            MX6UL_PAD_GPIO1_IO02__GPIO1_IO02    0x10b0        >;    }; 
  • pinctrl节点可以不设置,因为imx6ull的引脚默认状态下一般都是GPIO功能。

设备树编译:

ares@ubuntu:~/work/ebf_linux_kernel-ebf_4.19.35_imx6ul$ cat make_dtb.sh#!/bin/shmake ARCH=arm -j4 CROSS_COMPILE=arm-linux-gnueabihf- dtbs

将设备树拷贝系统目录:

debian@npi:~/nfs_root/driver$ cat cp_dtb_to_linux.sh#!/bin/shsudo cp imx6ull-mmc-npi.dtb /usr/lib/linux-image-4.19.35-carp-imx6/
  • /usr/lib/linux-image-4.19.35-carp-imx6/  ,系统存放设备树的目录

重启系统设备树生效:

sudo reboot

驱动编写

DS18B20的驱动:

#define CMD_CONVERT_TEMP         0x44#define CMD_READ_DATA            0xBE#define CMD_SKIP_ROM_ID          0xCC#define CMD_MATCH_ROM_ID         0x55#define CMD_READ_ROM_ID          0x33#define CMD_SEARCH_ROM_ID        0xF0#define DS18B20_IO_OUT()    gpio_direction_output(ds18b20_dev.gpio, 1)#define DS18B20_IO_IN()     gpio_direction_input(ds18b20_dev.gpio)#define DS18B20_WRITE(bit)  gpio_set_value(ds18b20_dev.gpio, bit)#define DS18B20_READ()      gpio_get_value(ds18b20_dev.gpio)staticstructds18b20ds18b20_dev;/* ds18b20复位,既检测ds18b20是否存在 0 - ds18b20存在, 1 - ds18b20不存在 */staticintds18b20_reset(void){int ret = 1;unsignedlong flags;    spin_lock_irqsave(&ds18b20_dev.lock, flags);    DS18B20_IO_OUT();     /* 设置为输出 */    DS18B20_WRITE(0);    udelay(480);                                         /* udelay 延时可能不准 */    DS18B20_WRITE(1);    udelay(75);    DS18B20_IO_IN();    /* 设置为输入 */    ret = DS18B20_READ();    udelay(10);    DS18B20_IO_OUT();    DS18B20_WRITE(1);       /* 释放总线 */    spin_unlock_irqrestore(&ds18b20_dev.lock, flags);return ret;}staticvoid _ds18b20_write_bit(uint8_t bit)   {    DS18B20_IO_OUT();     /* 设置为输出 */    bit = bit > 1 ? 1 : bit;    DS18B20_WRITE(0);    udelay(1);      DS18B20_WRITE(bit);    udelay(60);           /* 65 us */    DS18B20_WRITE(1);   /* 释放总线 */    udelay(16);}/* 整个读周期最少需要60us,启动读开始信号后必须15us内读取IO电平,否则就会被上拉拉高 */staticuint8_t _ds18b20_read_bit(void){uint8_t bit;    DS18B20_IO_OUT();     /* 设置为输出 */    DS18B20_WRITE(0);    udelay(1);     DS18B20_IO_IN();    /* 设置为输入 */    udelay(5);    bit = DS18B20_READ();    /* 读取结果 */    udelay(55);return bit;}staticvoidds18b20_wrte_byte(uint8_t byte){int i;unsignedlong flags;    spin_lock_irqsave(&ds18b20_dev.lock, flags);for (i = 0; i < 8; i++)     {// _ds18b20_write_bit(byte & 0x01);  //(byte >> i) & 0x01// byte = byte >> 1;          _ds18b20_write_bit((byte >> i) & 0x01);      }    spin_unlock_irqrestore(&ds18b20_dev.lock, flags);}staticuint8_tds18b20_read_byte(void){int i;uint8_t bit;uint8_t byte = 0;unsignedlong flags;    spin_lock_irqsave(&ds18b20_dev.lock, flags);for (i = 0; i < 8; i++)    {        bit = _ds18b20_read_bit();if (bit) byte |= (0x01 << i);    }    spin_unlock_irqrestore(&ds18b20_dev.lock, flags);return byte;}   
  • 这部分代码和Linux驱动框架完全没关系,跟单片机下的驱动DS18B20的代码没什么区别。

DS18B20的Linux驱动框架实现:

#include<linux/init.h>#include<linux/module.h>#include<linux/fs.h>#include<linux/cdev.h>#include<linux/uaccess.h>#include<linux/types.h>#include<linux/kernel.h>#include<linux/delay.h>#include<linux/ide.h>#include<linux/errno.h>#include<linux/gpio.h>#include<asm/mach/map.h>#include<linux/of.h>#include<linux/of_address.h>#include<linux/of_gpio.h>#include<asm/io.h>#include<linux/device.h>#include<linux/timer.h>// #include #include<linux/jiffies.h>#include<linux/platform_device.h>#include<linux/of_irq.h>#include<linux/wait.h>#include<linux/sched/signal.h>#include<linux/poll.h>#include<linux/atomic.h>#define DEV_DTS_NODE_PATH    "/ds18b20"/* 设备树节点的路径,在根节点下 */#define DEV_PIN_DTS_NAME     "ds18b20-gpios"/* GPIO引脚的属性名 */#define DEV_NAME             "ds18b20"/* 设备名  /dev/ds18b20 */#define DEV_DTS_COMPATIBLE   "xgj,ds18b20"/* 设备匹配属性 compatible */#define USE_GPIO_LIB        0structds18b20 {int gpio;                       /* gpio */dev_t dev_no;                   /* 设备号 */structcdevchrdev;structclass *class;spinlock_t lock;};staticstructds18b20ds18b20_dev;/* 使设备只能被一个进程打开 */staticint _drv_open (struct inode *node, struct file *file){    printk("ds18b20 open\n");return0;}staticssize_t _drv_read(struct file *filp, char __user *buf, size_t size, loff_t *offset){int ret;uint8_t temp_L = 0, temp_H = 0;short temp = 0;if (ds18b20_reset() != 0)    {        printk("%d ds18b20 reset failed", __LINE__);return -EFAULT;    }    ds18b20_wrte_byte(CMD_SKIP_ROM_ID);    ds18b20_wrte_byte(CMD_CONVERT_TEMP);    msleep(750);            /* 等待一段时间,让DS18B20进行温度转换 */if (ds18b20_reset() != 0)    {        printk("%d ds18b20 reset failed", __LINE__);return -EFAULT;    }    ds18b20_wrte_byte(CMD_SKIP_ROM_ID);       ds18b20_wrte_byte(CMD_READ_DATA);      /* 发送读数据命令 */    temp_L =  ds18b20_read_byte();    temp_H =  ds18b20_read_byte(); /* 组合温度数据 */    temp = temp_H << 8;    temp += temp_L;if (temp < 0)    /* 负温度 */    {        temp = ~temp + 1;       /* 转换得到负数源码的绝对值 */    }if (copy_to_user(buf, &temp, sizeof(temp)))     {        ret = -EFAULT;    } else    {        ret = sizeof(temp);    }return ret;}/* 使驱动支持多路复用IO */static__poll_t _drv_poll(struct file *filp, struct poll_table_struct *wait){__poll_t mask = 0;// // wait_event_interruptible// mutex_lock(&sr04.m_lock);// poll_wait(filp, &sr04.wq, wait); // if (sr04_val)// {//     mask |= POLLIN | POLLRDNORM;// }// mutex_unlock(&sr501.m_lock);return mask;}staticint _drv_release(struct inode *node, struct file *file){    printk("ds18b20 release\n");return0;}staticstructfile_operationsdrv_file_ops = {     .owner    = THIS_MODULE,    .open   = _drv_open,    .read   = _drv_read,    .poll   = _drv_poll,    .release = _drv_release,};/* 设备树的匹配列表 */staticstructof_device_iddts_match_table[] = {    {.compatible = DEV_DTS_COMPATIBLE, },                     /* 通过设备树来匹配 */};staticint _driver_probe(struct platform_device *pdev)int err;structdevice *ds_dev;structdevice_node *dev_node;structdevice_node *node = pdev->dev.of_node;if (!node) {                  printk("hc-sr501 dts node can not found!\r\n");    return -EINVAL;     }// count = of_gpio_count(node);  // printk("gpio count %d\r\n", count);  #if USE_GPIO_LIB    sr04.trig_gpio = gpiod_get(&pdev->dev, "trig", GPIOD_OUT_LOW);if (IS_ERR(sr04.trig_gpio)) {                      dev_err(&pdev->dev, "Failed to get trig-gpio for hc-sr04\n");             return PTR_ERR(sr04.trig_gpio);          }// gpiod_direction_output(sr04.trig_gpio, 0);// gpiod_direction_input(sr04.echo_gpio);// sr04.irq = gpiod_to_irq(sr04.echo_gpio);#else    dev_node = of_find_node_by_path(DEV_DTS_NODE_PATH);       /* 找到ds18b20的设备树节点  */if (IS_ERR(dev_node)) {                  printk("hc-sr04 DTS Node not found!\r\n"); return PTR_ERR(dev_node);     }    ds18b20_dev.gpio = of_get_named_gpio(dev_node, DEV_PIN_DTS_NAME, 0);   /* 获取ds18b20 的gpio编号 */if ( ds18b20_dev.gpio < 0) {        printk("trig-gpio not found!\r\n"); return -EINVAL;    }    err = gpio_request(ds18b20_dev.gpio, DEV_PIN_DTS_NAME);  if(err)     {        printk("gpio_request gpio is failed!\n");return -EINVAL;    }    printk("ds18b20 gpio %d\n", ds18b20_dev.gpio);#endif/* 内核自动分配设备号 */    err = alloc_chrdev_region(&ds18b20_dev.dev_no, 01, DEV_NAME);        if (err < 0) {        pr_err("Error: failed to register mbochs_dev, err: %d\n", err);return err;    }    cdev_init(&ds18b20_dev.chrdev, &drv_file_ops);    cdev_add(&ds18b20_dev.chrdev, ds18b20_dev.dev_no, 1);    ds18b20_dev.class = class_create(THIS_MODULE, DEV_NAME);if (IS_ERR(ds18b20_dev.class)) {           err = PTR_ERR(ds18b20_dev.class);goto failed1;    }/* 创建设备节点 */    ds_dev = device_create(ds18b20_dev.class , NULL, ds18b20_dev.dev_no, NULL, DEV_NAME); if (IS_ERR(ds_dev)) {       /* 判断指针是否合法 */        err = PTR_ERR(ds_dev);goto failed2;    }    spin_lock_init(&ds18b20_dev.lock);   /* 初始化自旋锁 */    printk("ds18b20 probe success\r\n");return0;failed2:    device_destroy(ds18b20_dev.class, ds18b20_dev.dev_no);    class_destroy(ds18b20_dev.class);failed1:    unregister_chrdev_region(ds18b20_dev.dev_no, 1);    cdev_del(&ds18b20_dev.chrdev);    gpio_free(ds18b20_dev.gpio);return err;}staticint _driver_remove(struct platform_device *pdev){    device_destroy(ds18b20_dev.class, ds18b20_dev.dev_no);    class_destroy(ds18b20_dev.class);    unregister_chrdev_region(ds18b20_dev.dev_no, 1);    cdev_del(&ds18b20_dev.chrdev);    gpio_free(ds18b20_dev.gpio);    printk(KERN_INFO"ds18b20 remove success\n");return0;}staticstructplatform_driver _platform_driver = {      .probe = _driver_probe,      .remove = _driver_remove,      .driver = {        .name = DEV_DTS_COMPATIBLE,        .owner = THIS_MODULE,        .of_match_table = dts_match_table,         /* 通过设备树匹配 */      },};/* 入口函数 */staticint __init _driver_init(void){int ret;    printk("ds18b20 %s\n", __FUNCTION__);    ret = platform_driver_register(&_platform_driver);   //注册platform驱动return ret;}/*  出口函数 */staticvoid __exit _driver_exit(void){    printk("ds18b20  %s\n", __FUNCTION__);    platform_driver_unregister(&_platform_driver);}module_init(_driver_init);module_exit(_driver_exit);MODULE_AUTHOR("Ares");MODULE_LICENSE("GPL");

驱动编译makefile

KERNEL_DIR = /home/ares/work/ebf_linux_kernel-ebf_4.19.35_imx6ulobj-m := ds18b20_drv.oall:    $(MAKE) -C $(KERNEL_DIR) M=$(CURDIR) modules.PHONY:cleanclean:    $(MAKE) -C $(KERNEL_DIR) M=$(CURDIR) clean
  • 执行命令make编译

测试程序编写

#include<sys/types.h>#include<sys/stat.h>#include<fcntl.h>#include<unistd.h>#include<stdio.h>#include<string.h>#include<sys/ioctl.h>#include<poll.h>#define DEV_NAME   "/dev/ds18b20"voidsleep_ms(unsignedint ms){structtimevaldelay;    delay.tv_sec = 0;    delay.tv_usec = ms * 1000    select(0NULLNULLNULL, &delay);}intmain(int argc, char **argv){int fd;int ret;structpollfdfds[1];/* 2. 打开文件 */    fd = open(DEV_NAME, O_RDWR);   // | O_NONBLOCKif (fd < 0)    {printf("can not open file %s, %d\n", DEV_NAME, fd);return-1;    }short temp;while (1)    {if ((ret = read(fd, &temp, sizeof(temp))) == sizeof(temp))        {float temperature = temp * 0.0625;printf("temp %f\r\n", temperature);        }else        {printf("not get temp, err %d\r\n", ret);        }        sleep_ms(10);    }}
  • float temperature = temp * 0.0625,根据DS18B20相关手册可知,获取到DS18B20寄存器中的数据还不是真正的温度,还需要乘以0.0625

安装执行:

sudo insmod ds18b20_drv.kosudo ./ds18b20_test

最新文章

随机文章

基本 文件 流程 错误 SQL 调试
  1. 请求信息 : 2026-03-27 11:42:15 HTTP/2.0 GET : https://f.mffb.com.cn/a/481842.html
  2. 运行时间 : 0.234766s [ 吞吐率:4.26req/s ] 内存消耗:4,926.77kb 文件加载:140
  3. 缓存信息 : 0 reads,0 writes
  4. 会话信息 : SESSION_ID=1d48b6121cedb777be671c0f23dbd814
  1. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/public/index.php ( 0.79 KB )
  2. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/autoload.php ( 0.17 KB )
  3. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/autoload_real.php ( 2.49 KB )
  4. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/platform_check.php ( 0.90 KB )
  5. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/ClassLoader.php ( 14.03 KB )
  6. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/autoload_static.php ( 4.90 KB )
  7. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/helper.php ( 8.34 KB )
  8. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-validate/src/helper.php ( 2.19 KB )
  9. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/helper.php ( 1.47 KB )
  10. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/stubs/load_stubs.php ( 0.16 KB )
  11. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Exception.php ( 1.69 KB )
  12. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-container/src/Facade.php ( 2.71 KB )
  13. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/deprecation-contracts/function.php ( 0.99 KB )
  14. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/polyfill-mbstring/bootstrap.php ( 8.26 KB )
  15. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/polyfill-mbstring/bootstrap80.php ( 9.78 KB )
  16. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/var-dumper/Resources/functions/dump.php ( 1.49 KB )
  17. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-dumper/src/helper.php ( 0.18 KB )
  18. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/var-dumper/VarDumper.php ( 4.30 KB )
  19. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/App.php ( 15.30 KB )
  20. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-container/src/Container.php ( 15.76 KB )
  21. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/container/src/ContainerInterface.php ( 1.02 KB )
  22. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/provider.php ( 0.19 KB )
  23. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Http.php ( 6.04 KB )
  24. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/helper/Str.php ( 7.29 KB )
  25. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Env.php ( 4.68 KB )
  26. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/common.php ( 0.03 KB )
  27. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/helper.php ( 18.78 KB )
  28. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Config.php ( 5.54 KB )
  29. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/app.php ( 0.95 KB )
  30. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/cache.php ( 0.78 KB )
  31. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/console.php ( 0.23 KB )
  32. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/cookie.php ( 0.56 KB )
  33. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/database.php ( 2.48 KB )
  34. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/facade/Env.php ( 1.67 KB )
  35. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/filesystem.php ( 0.61 KB )
  36. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/lang.php ( 0.91 KB )
  37. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/log.php ( 1.35 KB )
  38. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/middleware.php ( 0.19 KB )
  39. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/route.php ( 1.89 KB )
  40. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/session.php ( 0.57 KB )
  41. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/trace.php ( 0.34 KB )
  42. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/view.php ( 0.82 KB )
  43. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/event.php ( 0.25 KB )
  44. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Event.php ( 7.67 KB )
  45. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/service.php ( 0.13 KB )
  46. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/AppService.php ( 0.26 KB )
  47. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Service.php ( 1.64 KB )
  48. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Lang.php ( 7.35 KB )
  49. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/lang/zh-cn.php ( 13.70 KB )
  50. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/initializer/Error.php ( 3.31 KB )
  51. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/initializer/RegisterService.php ( 1.33 KB )
  52. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/services.php ( 0.14 KB )
  53. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/service/PaginatorService.php ( 1.52 KB )
  54. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/service/ValidateService.php ( 0.99 KB )
  55. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/service/ModelService.php ( 2.04 KB )
  56. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-trace/src/Service.php ( 0.77 KB )
  57. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Middleware.php ( 6.72 KB )
  58. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/initializer/BootService.php ( 0.77 KB )
  59. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/Paginator.php ( 11.86 KB )
  60. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-validate/src/Validate.php ( 63.20 KB )
  61. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/Model.php ( 23.55 KB )
  62. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/Attribute.php ( 21.05 KB )
  63. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/AutoWriteData.php ( 4.21 KB )
  64. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/Conversion.php ( 6.44 KB )
  65. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/DbConnect.php ( 5.16 KB )
  66. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/ModelEvent.php ( 2.33 KB )
  67. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/RelationShip.php ( 28.29 KB )
  68. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/contract/Arrayable.php ( 0.09 KB )
  69. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/contract/Jsonable.php ( 0.13 KB )
  70. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/contract/Modelable.php ( 0.09 KB )
  71. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Db.php ( 2.88 KB )
  72. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/DbManager.php ( 8.52 KB )
  73. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Log.php ( 6.28 KB )
  74. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Manager.php ( 3.92 KB )
  75. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/log/src/LoggerTrait.php ( 2.69 KB )
  76. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/log/src/LoggerInterface.php ( 2.71 KB )
  77. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Cache.php ( 4.92 KB )
  78. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/simple-cache/src/CacheInterface.php ( 4.71 KB )
  79. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/helper/Arr.php ( 16.63 KB )
  80. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/cache/driver/File.php ( 7.84 KB )
  81. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/cache/Driver.php ( 9.03 KB )
  82. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/CacheHandlerInterface.php ( 1.99 KB )
  83. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/Request.php ( 0.09 KB )
  84. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Request.php ( 55.78 KB )
  85. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/middleware.php ( 0.25 KB )
  86. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Pipeline.php ( 2.61 KB )
  87. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-trace/src/TraceDebug.php ( 3.40 KB )
  88. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/middleware/SessionInit.php ( 1.94 KB )
  89. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Session.php ( 1.80 KB )
  90. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/session/driver/File.php ( 6.27 KB )
  91. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/SessionHandlerInterface.php ( 0.87 KB )
  92. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/session/Store.php ( 7.12 KB )
  93. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Route.php ( 23.73 KB )
  94. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/RuleName.php ( 5.75 KB )
  95. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/Domain.php ( 2.53 KB )
  96. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/RuleGroup.php ( 22.43 KB )
  97. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/Rule.php ( 26.95 KB )
  98. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/RuleItem.php ( 9.78 KB )
  99. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/route/app.php ( 1.72 KB )
  100. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/facade/Route.php ( 4.70 KB )
  101. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/dispatch/Controller.php ( 4.74 KB )
  102. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/Dispatch.php ( 10.44 KB )
  103. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/controller/Index.php ( 4.81 KB )
  104. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/BaseController.php ( 2.05 KB )
  105. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/facade/Db.php ( 0.93 KB )
  106. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/connector/Mysql.php ( 5.44 KB )
  107. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/PDOConnection.php ( 52.47 KB )
  108. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/Connection.php ( 8.39 KB )
  109. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/ConnectionInterface.php ( 4.57 KB )
  110. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/builder/Mysql.php ( 16.58 KB )
  111. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/Builder.php ( 24.06 KB )
  112. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/BaseBuilder.php ( 27.50 KB )
  113. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/Query.php ( 15.71 KB )
  114. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/BaseQuery.php ( 45.13 KB )
  115. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/TimeFieldQuery.php ( 7.43 KB )
  116. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/AggregateQuery.php ( 3.26 KB )
  117. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/ModelRelationQuery.php ( 20.07 KB )
  118. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/ParamsBind.php ( 3.66 KB )
  119. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/ResultOperation.php ( 7.01 KB )
  120. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/WhereQuery.php ( 19.37 KB )
  121. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/JoinAndViewQuery.php ( 7.11 KB )
  122. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/TableFieldInfo.php ( 2.63 KB )
  123. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/Transaction.php ( 2.77 KB )
  124. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/log/driver/File.php ( 5.96 KB )
  125. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/LogHandlerInterface.php ( 0.86 KB )
  126. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/log/Channel.php ( 3.89 KB )
  127. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/event/LogRecord.php ( 1.02 KB )
  128. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/Collection.php ( 16.47 KB )
  129. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/facade/View.php ( 1.70 KB )
  130. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/View.php ( 4.39 KB )
  131. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Response.php ( 8.81 KB )
  132. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/response/View.php ( 3.29 KB )
  133. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Cookie.php ( 6.06 KB )
  134. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-view/src/Think.php ( 8.38 KB )
  135. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/TemplateHandlerInterface.php ( 1.60 KB )
  136. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-template/src/Template.php ( 46.61 KB )
  137. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-template/src/template/driver/File.php ( 2.41 KB )
  138. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-template/src/template/contract/DriverInterface.php ( 0.86 KB )
  139. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/runtime/temp/067d451b9a0c665040f3f1bdd3293d68.php ( 11.98 KB )
  140. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-trace/src/Html.php ( 4.42 KB )
  1. CONNECT:[ UseTime:0.001312s ] mysql:host=127.0.0.1;port=3306;dbname=f_mffb;charset=utf8mb4
  2. SHOW FULL COLUMNS FROM `fenlei` [ RunTime:0.001703s ]
  3. SELECT * FROM `fenlei` WHERE `fid` = 0 [ RunTime:0.000756s ]
  4. SELECT * FROM `fenlei` WHERE `fid` = 63 [ RunTime:0.000713s ]
  5. SHOW FULL COLUMNS FROM `set` [ RunTime:0.001358s ]
  6. SELECT * FROM `set` [ RunTime:0.000622s ]
  7. SHOW FULL COLUMNS FROM `article` [ RunTime:0.001524s ]
  8. SELECT * FROM `article` WHERE `id` = 481842 LIMIT 1 [ RunTime:0.001448s ]
  9. UPDATE `article` SET `lasttime` = 1774582935 WHERE `id` = 481842 [ RunTime:0.023831s ]
  10. SELECT * FROM `fenlei` WHERE `id` = 67 LIMIT 1 [ RunTime:0.000720s ]
  11. SELECT * FROM `article` WHERE `id` < 481842 ORDER BY `id` DESC LIMIT 1 [ RunTime:0.001095s ]
  12. SELECT * FROM `article` WHERE `id` > 481842 ORDER BY `id` ASC LIMIT 1 [ RunTime:0.001594s ]
  13. SELECT * FROM `article` WHERE `id` < 481842 ORDER BY `id` DESC LIMIT 10 [ RunTime:0.003035s ]
  14. SELECT * FROM `article` WHERE `id` < 481842 ORDER BY `id` DESC LIMIT 10,10 [ RunTime:0.003036s ]
  15. SELECT * FROM `article` WHERE `id` < 481842 ORDER BY `id` DESC LIMIT 20,10 [ RunTime:0.005762s ]
0.238529s