<dfn id="yhprb"><s id="yhprb"></s></dfn><dfn id="yhprb"><delect id="yhprb"></delect></dfn><dfn id="yhprb"></dfn><dfn id="yhprb"><delect id="yhprb"></delect></dfn><dfn id="yhprb"></dfn><dfn id="yhprb"><s id="yhprb"><strike id="yhprb"></strike></s></dfn><small id="yhprb"></small><dfn id="yhprb"></dfn><small id="yhprb"><delect id="yhprb"></delect></small><small id="yhprb"></small><small id="yhprb"></small> <delect id="yhprb"><strike id="yhprb"></strike></delect><dfn id="yhprb"></dfn><dfn id="yhprb"></dfn><s id="yhprb"><noframes id="yhprb"><small id="yhprb"><dfn id="yhprb"></dfn></small><dfn id="yhprb"><delect id="yhprb"></delect></dfn><small id="yhprb"></small><dfn id="yhprb"><delect id="yhprb"></delect></dfn><dfn id="yhprb"><s id="yhprb"></s></dfn> <small id="yhprb"></small><delect id="yhprb"><strike id="yhprb"></strike></delect><dfn id="yhprb"><s id="yhprb"></s></dfn><dfn id="yhprb"></dfn><dfn id="yhprb"><s id="yhprb"></s></dfn><dfn id="yhprb"><s id="yhprb"><strike id="yhprb"></strike></s></dfn><dfn id="yhprb"><s id="yhprb"></s></dfn>
關(guān) 閉

新聞中心

EEPW首頁(yè) > 工控自動(dòng)化 > 設計應用 > 觸控設備手勢喚醒的設計思路及其實(shí)現

觸控設備手勢喚醒的設計思路及其實(shí)現

作者: 時(shí)間:2012-07-14 來(lái)源:網(wǎng)絡(luò ) 收藏
示例代碼2

本文引用地址:http://dyxdggzs.com/article/160306.htm

  // example interrupt function where this might be implemented

  __interrupt void TimedInterrupt( void )

  {

  uint8 proximity_counts;

  uint8 filtered_counts;

  ....

  ....

  if ( device_status == SLEEP_MODE )

  {

  // read one byte from register 0x16

  proximity_counts = read_i2c_register(MAX44000_ADDR,0x16,1);

  // weights[QUEUE_SIZE] contains the filter weights for the FIR filter

  // data_queue[QUEUE_SIZE] is a FIFO queue meant to be the input to the filter

  filtered_counts = fir_filter(proximity_counts,weights,data_queue);

  if (filtered_counts 》 WAKEUP_THRESHOLD)

  {

  device_status = WAKE_MODE;

  ...

  }

  else

  {

  // do whatever it is you need to in sleep mode

  ...

  ...

  }

  }

  ...

  ...

  }

  /**

  * fir_filter()

  *

  * Implements an FIR filter in the form

  * y = w[0]*x[0] + w[1]*x[1] + 。。.+ w[QUEUE_SIZE]*x[QUEUE_SIZE]

  *

  * Arguments:

  * uint8 input - newest datapoint taken (that is, x[0])

  * uint8 *weights - w[0]。。.w[QUEUE_SIZE]

  * uint8 *queue - the discrete sequence x[0]。。.x[QUEUE_SIZE]

  *

  * Returns:

  * The FIR-filtered output, y

  */

  uint8 fir_filter(uint8 input, uint8 *weights, uint8 *queue)

  {

  uint8 i;

  int sum = 0;

  // pop first entry in the queue, then

  // push new data into the last position

  push_into_queue(queue,input);

  // input is now x[0]

  for (i=0; i {

  sum += weights[i]*queue[i];

  }

  return (sum/QUEUE_SIZE);

  }



評論


相關(guān)推薦

技術(shù)專(zhuān)區

關(guān)閉
国产精品自在自线亚洲|国产精品无圣光一区二区|国产日产欧洲无码视频|久久久一本精品99久久K精品66|欧美人与动牲交片免费播放
<dfn id="yhprb"><s id="yhprb"></s></dfn><dfn id="yhprb"><delect id="yhprb"></delect></dfn><dfn id="yhprb"></dfn><dfn id="yhprb"><delect id="yhprb"></delect></dfn><dfn id="yhprb"></dfn><dfn id="yhprb"><s id="yhprb"><strike id="yhprb"></strike></s></dfn><small id="yhprb"></small><dfn id="yhprb"></dfn><small id="yhprb"><delect id="yhprb"></delect></small><small id="yhprb"></small><small id="yhprb"></small> <delect id="yhprb"><strike id="yhprb"></strike></delect><dfn id="yhprb"></dfn><dfn id="yhprb"></dfn><s id="yhprb"><noframes id="yhprb"><small id="yhprb"><dfn id="yhprb"></dfn></small><dfn id="yhprb"><delect id="yhprb"></delect></dfn><small id="yhprb"></small><dfn id="yhprb"><delect id="yhprb"></delect></dfn><dfn id="yhprb"><s id="yhprb"></s></dfn> <small id="yhprb"></small><delect id="yhprb"><strike id="yhprb"></strike></delect><dfn id="yhprb"><s id="yhprb"></s></dfn><dfn id="yhprb"></dfn><dfn id="yhprb"><s id="yhprb"></s></dfn><dfn id="yhprb"><s id="yhprb"><strike id="yhprb"></strike></s></dfn><dfn id="yhprb"><s id="yhprb"></s></dfn>