WO2012106973A1

Uart-based wake-up from sleep method and device

Abstract

Disclosed is a universal asynchronous receiver/transmitter (UART)-based wake up from sleep method. The method comprises: when no data is to be transmitted, a first device notifying via a tx signal line of the UART of self a second device in communication with the first device; when the second device receives the notification and the second device has no data to be transmitted to the first device, notifying the first device via the tx signal line of the UART of self, and putting the UART of self into sleep state; when the first device receives the notification, putting the UART of self into sleep state; the first device and the second device regularly inspect the output state of rx signal lines of selves, when the output state of the rx signal lines of selves is determined to be having data to be received, waking up the UART of selves. Also disclosed is a UART-based wake up from sleep device. Employment of the method and the device allows for reduced power consumption on the device and reduced use of GPIO resource of the device.

WO2012106973A1, drawing sheet 1
Sheet 1 of 2

Term

No projected expiry on record.

  1. Priority
  2. Filed
  3. Published
  4. Today

10 claims: 2 independent, 8 dependent

  1. 1
    权利要求书 1、 一种基于通用异步接收 /发送装置(UART ) 的睡眠唤醒方法, 其特 征在于, 该方法包括: 当没有数据发送时, 第一设备通过自身 UART的 tx信号线通知与所述 第一设备进行通信的第二设备; 所述第二设备收到通知后且自身没有数据发送给所述第一设备时, 通 过自身 UART的 tx信号线通知所述第一设备,并使自身的 UART进入睡眠 状态; 所述第一设备收到通知后, 使自身的 UART进入睡眠状态; 所述第一设备及所述第二设备定时检测自身 rx信号线的输出状态, 确 定自身 rx信号线的输出状态为有数据接收时, 唤醒自身的 UART。
  2. 2
    2、 根据权利要求 1所述的方法, 其特征在于, 所述第一设备通过自身 UART的 tx信号线通知与第一设备进行通信的第二设备, 为: 所述第一设备将自身的 tx信号线设置为中断(break )模式。
  3. 3
    3、 根据权利要求 2所述的方法, 其特征在于, 所述通过自身 UART的 tx信号线通知所述第一设备, 为: 所述第二设备将自身的 tx信号线设置为 break模式。
  4. 4
    4、 根据权利要求 1、 2或 3所述的方法, 其特征在于, 所述定时检测 自身 rx信号线的输出状态,确定自身 rx信号线的输出状态为有数据接收时, 唤醒自身的 UART, 为: 设置定时检测自身 rx信号线引脚状态的函数, 并在定时检测函数的唤 醒处理中增加 UART恢复函数, 通过定时检测函数, 检测设备自身 rx信号 线的输出状态, 并在确定设备自身 rx信号线的电平值为高时, 通过 UART 恢复函数唤醒设备自身的 UART。
  5. 5
    5、 根据权利要求 1、 2或 3所述的方法, 其特征在于, 所述定时检测 自身 rx信号线的输出状态,确定自身 rx信号线的输出状态为有数据接收时, 唤醒自身的 UART, 为: 设置 rx中断,并在中断处理中增加 UART恢复函数,设备自身 rx信号 线的电平值不为低时, 触发所述 rx中断, 并通过 UART恢复函数唤醒设备 自身的 UART。
  6. 6
    6、 根据权利要求 1、 2或 3所述的方法, 其特征在于, 所述定时检测 自身 rx信号线的输出状态,确定自身 rx信号线的输出状态为有数据接收时, 唤醒自身的 UART, 为: 设置通用输入输出 (GPIO ) 中断, 并在中断处理中增加 UART恢复函 数, 设备检测到边沿或电平值为高时, 触发所述 GPIO中断, 并通过 UART 恢复函数唤醒设备自身的 UART。
  7. 7
    7、 根据权利要求 1、 2或 3所述的方法, 其特征在于, 所述确定自身 rx信号线的输出状态为有数据接收时的时机为: 数据发送方发送事先约定的字符; 或者, 数据发送方发送脉沖信号, 延时后再向数据接收方发送事先约定的字 付。
  8. 8
    8、根据权利要求 7所述的方法,其特征在于,在唤醒自身的 UART后, 该方法进一步包括: 向数据发送方返回表示已唤醒的字符。
  9. 9
    9、 一种基于 UART的睡眠唤醒装置, 其特征在于, 该装置包括: 第一 设备及第二设备; 其中, 第一设备, 用于当没有数据发送时, 通过自身 UART的 tx信号线通知 第二设备; 并在收到第二设备的通知后, 使自身的 UART进入睡眠状态; 并定时检测自身 rx信号线的输出状态,确定自身 rx信号线的输出状态为有 数据接收时, 唤醒自身的 UART;第二设备, 用于收到第一设备发送的通知后, 且自身没有数据发送给 第一设备时, 通过自身 UART的 tx信号线通知所述第一设备, 并使自身的 UART进入睡眠状态; 并检测自身 rx信号线的输出状态, 确定自身 rx信号 线的输出状态为有数据接收时, 唤醒自身的 UART。
  10. 10
    10、 根据权利要求 9所述的装置, 其特征在于, 所述第一设备, 还用于睡眠后当有数据发送给第二设备时, 唤醒自身 的 UART, 并通过自身的 tx信号线发送事先约定的字符给第二设备, 并接 收第二设备返回的表示已唤醒的字符; 所述第二设备, 还用于收到第一设备发送的字符后, 通过自身的 tx信 号线向第一设备返回表示已唤醒的字符; 或者, 所述第二设备, 还用于睡眠后当有数据发送给第一设备时, 唤醒自身 的 UART, 并通过自身的 tx信号线发送事先约定的字符给第一设备, 并接 收第一设备返回的表示已唤醒的字符; 所述第一设备, 还用于收到第二设备发送的字符后, 通过自身的 tx信 号线向第二设备返回表示已唤醒的字符。
Independent claims10