您好,欢迎光临!   请登录 免费注册    
  您的位置:电子变压器资讯网 > 资讯中心 >  技术文章 > 正文
触控设备手势唤醒的设计思路及其实现
[发布时间]:2012年7月16日 [来源]:电子发烧友 [点击率]:5402
【导读】: 本文讨论如何唤醒平板电脑等触控装置,无需接触设备,而是采用基本的手势识别及新颖的接近检测传感器。本文讨论了相关设计的物理布局、速度限制、检测门限、系统集成,以及人为因素的影响;给出了软件实时的例程...

  __interrupt void irq_handler( void )

  {

  ...

  // if the hardware interrupt came from the MAX44000 sensor

  // pulling its INT pin low

  if ( irq_source == MAX44000 )

  {

  // if the device is in sleep mode

  if (device_status == SLEEP_MODE)

  {

  device_status = WAKE_MODE; // wake up the device

  ...

  // reconfigure whatever else you need here as the system wakes up

  }

  // otherwise, handle it however it is you wish

  else

  {

  ...

  }

  }

  ...

  }

  /**

  * configure_max44000_for_sleep_mode()

  *

  * Sets up the MAX44000 to trigger a hardware interrupt when the proximity

  * counts go above some set threshold.

  *

  * Arguments:

  * uint8 upper_threshold - the set threshold (8-bit mode)

  *

  * Returns:

  * n/a

  */

  void configure_max44000_for_sleep_mode(uint8 upper_threshold)

  {

  uint8 max44000_thresh_registers[] = {0x0B,0x0C};

  uint8 max44000_upper_thresh[] = {0x40,0};

  max44000_upper_thresh[1] = upper_threshold;

  // do a consecutive write of 0 followed by upper_threshold to

  // registers 0xB and 0xC, respectively

  // MAX44000_ADDR is usually 0x94

  // interrupt will trigger only if proximity value is above the threshold

  write_i2c_register(MAX44000_ADDR,max44000_thresh_registers,

  max44000_upper_thresh,2);

  // write to bits 2 and 3 of register 0x0A here if you wish to set the

  // persist time to anything other than one sample

  // writes to register 0x01 to enable interrupts on the MAX44000

  max44000_enable_interrupt();

  return;

  }

[上一页] [1] [2] [3] [4] [下一页]
投稿箱:
   电子变压器、电感器、磁性材料等磁电元件相关的行业、企业新闻稿件需要发表,或进行资讯合作,欢迎联系本网编辑部QQ: , 邮箱:info%ett-cn.com (%替换成@)。
第一时间获取电子变压行业资讯,请在微信公众账号中搜索“电子变压器资讯”或者“dzbyqzj”,或用手机扫描左方二维码,即可获得电子变压器资讯网每日精华内容推送和最优搜索体验,并参与活动!
温馨提示:回复“1”获取最新资讯。