导航

    全志在线开发者论坛

    • 注册
    • 登录
    • 搜索
    • 版块
    • 话题
    • 在线文档
    • 社区主页

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

    MR Series
    1
    1
    839
    正在加载更多帖子
    • 从旧到新
    • 从新到旧
    • 最多赞同
    回复
    • 在新帖中回复
    登录后回复
    此主题已被删除。只有拥有主题管理权限的用户可以查看。
    • L
      leomini5 LV 6 最后由 编辑

      这个驱动里面带了个貌似用来测试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 条回复 最后回复 回复 引用 分享 0
      • 1 / 1
      • First post
        Last post

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

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