gpio.py 文件源码

python
阅读 32 收藏 0 点赞 0 评论 0

项目:PyLetMeCreate 作者: CreatorDev 项目源码 文件源码
def get_type(gpio_pin):
    """Returns the type of the GPIO

    Some GPIO's on the Mikrobus has some type (AN, PWM, INT, RST or CS). Other
    GPIO's don't have a type.

    Note: An exception is thrown if the type of the gpio cannot be found.
    """
    pin_type = ctypes.c_uint8(0)
    ret = _LIB.gpio_get_type(gpio_pin, ctypes.byref(pin_type))
    if ret < 0:
        raise Exception("gpio get type failed")
    return pin_type.value
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号