T1-U-HL模组T1-CHL_TuyaOS-3.8.31 sdk如何配置IO口为双沿唤醒

Wi-Fi 设备、Wi-Fi 低功耗设备、Wi-Fi BLE 双模设备、Ethernet设备、Ethernet+Wi-Fi设备等
Post Reply
小螃海
Posts: 49

T1-CHL_TuyaOS-3.8.31 SDK如何配置IO口为上升沿和下降沿两种任何一种触发唤醒?


Tags:
JSHANG
Posts: 43

Re: T1-U-HL模组T1-CHL_TuyaOS-3.8.31 sdk如何配置IO口为双沿唤醒

typedef enum {
TUYA_GPIO_WAKEUP_LOW = 0, //低电平唤醒
TUYA_GPIO_WAKEUP_HIGH, //高电平唤醒
TUYA_GPIO_WAKEUP_RISE, //上升沿唤醒
TUYA_GPIO_WAKEUP_FALL, //下降沿唤醒
TUYA_GPIO_WAKEUP_MAX,
} TUYA_GPIO_WAKE_TYPE_E;

Code: Select all

cfg.source = TUYA_WAKEUP_SOURCE_GPIO;
cfg.wakeup_para.gpio_param.gpio_num = 21;
cfg.wakeup_para.gpio_param.level = TUYA_GPIO_WAKEUP_RISE;  
tkl_wakeup_source_set(&cfg);
Post Reply