Navigation

    全志在线开发者论坛

    • Register
    • Login
    • Search
    • Categories
    • Tags
    • 在线文档
    • 社区主页

    tina ledc驱动里面的这个 led show怎么用呀

    MR Series
    1
    1
    1258
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • L
      leomini5 LV 6 last edited by

      这个驱动里面带了个貌似用来测试led灯的代码

      这个怎么在tina里面调用呀

      static ssize_t led_show(struct class *class,
      			struct class_attribute *attr,
      			char *buf)
      {
      	struct sunxi_led *led = sunxi_led_global;
      
      	sunxi_led_set_all(led, 0, 0);
      	sunxi_led_set_all(led, 1, 0);
      	sunxi_led_set_all(led, 2, 0);
      
      	sunxi_led_set_all(led, 0, 20);
      	msleep(500);
      	sunxi_led_set_all(led, 1, 20);
      	msleep(500);
      	sunxi_led_set_all(led, 2, 20);
      	msleep(500);
      
      	sunxi_led_set_all(led, 0, 0);
      	sunxi_led_set_all(led, 1, 0);
      	sunxi_led_set_all(led, 2, 0);
      
      	return 0;
      }
      
      static struct class_attribute led_class_attrs[] = {
      	__ATTR(light, 0644, led_show, NULL),
      	//__ATTR_NULL,
      };
      
      1 Reply Last reply Reply Quote Share 0
      • 1 / 1
      • First post
        Last post

      Copyright © 2024 深圳全志在线有限公司 粤ICP备2021084185号 粤公网安备44030502007680号

      行为准则 | 用户协议 | 隐私权政策