Skip to Navigation
Home
  • Company
    • Quick Facts
    • Board of Directors
    • Management Team
    • Press Releases
    • News Coverage
    • Newsletter
    • Careers
    • Articles
    • Ember Chronology
    • Contact Us
  • Products
    • ZigBee Chips
    • ZigBee Software
    • ZigBee Development Tools
    • Documentation
  • Buy
    • Digi-Key (Online)
    • Distributors
  • Applications
    • AMI & AMR
    • Integrated Home Automation
    • Building Automation
    • Others
  • ZigBee
    • About ZigBee
    • Ember & ZigBee
    • ZigBee FAQ
    • Download Specifications
    • ZigBee Events
  • Partners
  • Support
    • Training
  • Events
Home › FAQs

How can I determine the wake source when the EM250 wakes from sleep?

Categories:
  • Software : Embedded
  • EmberZNet PRO
  • EM250

After calling halSleep() or halSleepForQuarterSeconds() and having the code execution resume after sleep, an EM250 application can determine the wake source of the last sleep event by using the halGetWakeInfo() API (defined in micro.h in the EM250 HAL). The description of this API is as follows (from micro.h API documentation):

*If bits[16:0] are set, they correspond to GPIO[16:0] as the wake event(s).
Bit 30 is Sleep Timer Compare A event. Bit 31 is SIF activity.*

An example of this usage in code follows below:

  1. int32u sleepDuration = 240;
  2.  
  3. // Sleep for one minute and then check wake sources
  4. if( halSleepForQuarterSeconds(&sleepDuration) == EMBER_SLEEP_INTERRUPTED )
  5. {
  6. // We woke up early, so check wake source to see if it was GPIO12
  7. if( halGetWakeInfo() == BIT32(12) )
  8. {
  9. // Yes, it was GPIO12 that woke us
  10. }
  11. } else {
  12. // We slept for the whole time, so halGetWakeInfo() == BIT32(30)
  13. }

  • Login to post comments
  • Printer-friendly version

Search

FAQs

  • All (166)
  • Software : Embedded (65)
  • Software : Networking (70)
  • Hardware : Design (22)
  • Hardware : Manufacturing (10)
  • Tools : Dev Boards (2)
  • Tools : ISD, ISA (21)
  • Tools : xIDE (6)
  • Tools : Other (7)
  • ZigBee (1)
  • Change Notification (0)
Primary links
  • Developer Blog
  • Documentation
    • Release Notes
  • Contributed Software
  • FAQs
  • Change Notifications
  • Training
Portal
  • My Account
  • Search
User login
  • Request new password

Company | Products | Buy | Applications | ZigBee | Partners | Support | Events | Contact Us

©2007-2008 Ember Corporation | All rights reserved | Privacy