linux驱动GPIO的使用
发表于:2022-03-09 | 分类: Linux

[[toc]]

内核中GPIO的使用

  • gpio_is_valid();
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    /*
    * "valid" GPIO numbers are nonnegative and may be passed to
    * setup routines like gpio_request(). only some valid numbers
    * can successfully be requested and used.
    *
    * Invalid GPIO numbers are useful for indicating no-such-GPIO in
    * platform data and other tables.
    */

    static inline bool gpio_is_valid(int number)
    {
    return number >= 0 && number < ARCH_NR_GPIOS;
    }

上一篇:
将模块编译进Linux内核
下一篇:
platform_device创建过程