コード例 #1
0
ファイル: touch.c プロジェクト: thegeek82000/asf
/*! \brief Example configuration for touch keys, rotors and sliders.
 *
 * \retval TOUCH_SUCCESS   Configuration setting successful.
 * \retval TOUCH_INVALID_xx   Invalid input configuration setting.
 */
touch_ret_t
touch_sensors_config (void)
{
    touch_ret_t touch_ret = TOUCH_SUCCESS;
    sensor_id_t sensor_id;

    /* configure touch key. */
    touch_ret =
        touch_qt_sensor_config (SENSOR_TYPE_KEY, (channel_t) 0u,
                                (channel_t) 0u, NO_AKS_GROUP, 15u, HYST_6_25,
                                RES_1_BIT, &sensor_id);
    if (touch_ret != TOUCH_SUCCESS)
    {
        while (1);		/* Check API Error return code. */
    }


    touch_ret =
        touch_qt_sensor_config (SENSOR_TYPE_SLIDER,
                                (channel_t) 1u, (channel_t) 3u, NO_AKS_GROUP, 12u,
                                (hysteresis_t) HYST_6_25, RES_8_BIT, &sensor_id);
    if (touch_ret != TOUCH_SUCCESS)
    {
        while (1);		/* Check API Error return code. */
    }

    return (touch_ret);
}
コード例 #2
0
/*! \brief Example configuration for touch keys, rotors and sliders.
 *
 * \retval TOUCH_SUCCESS   Configuration setting successful.
 * \retval TOUCH_INVALID_xx   Invalid input configuration setting.
 */
touch_ret_t
config_qt_grp_a_touch_sensors (void)
{
  touch_ret_t touch_ret = TOUCH_SUCCESS;
  sensor_id_t sensor_id;

  touch_ret =
    touch_qt_sensor_config (TOUCH_QT_GRP_A, SENSOR_TYPE_ROTOR, (channel_t) 0u,
			    (channel_t) 2u, NO_AKS_GROUP, 20u,
			    (hysteresis_t) HYST_6_25, RES_8_BIT, &sensor_id);
  if (touch_ret != TOUCH_SUCCESS)
    {
      while (1);		/* Check API Error return code. */
    }

  touch_ret =
    touch_qt_sensor_config (TOUCH_QT_GRP_A, SENSOR_TYPE_SLIDER,
			    (channel_t) 3u, (channel_t) 5u, NO_AKS_GROUP, 20u,
			    (hysteresis_t) HYST_6_25, RES_8_BIT, &sensor_id);
  if (touch_ret != TOUCH_SUCCESS)
    {
      while (1);		/* Check API Error return code. */
    }


  /* configure touch key. */
  touch_ret =
    touch_qt_sensor_config (TOUCH_QT_GRP_A, SENSOR_TYPE_KEY, (channel_t) 6u,
			    (channel_t) 6u, NO_AKS_GROUP, 20u, HYST_6_25,
			    RES_1_BIT, &sensor_id);
  if (touch_ret != TOUCH_SUCCESS)
    {
      while (1);		/* Check API Error return code. */
    }

  /* configure touch key. */
  touch_ret =
    touch_qt_sensor_config (TOUCH_QT_GRP_A, SENSOR_TYPE_KEY, (channel_t) 7u,
			    (channel_t) 7u, NO_AKS_GROUP, 20u, HYST_6_25,
			    RES_1_BIT, &sensor_id);
  if (touch_ret != TOUCH_SUCCESS)
    {
      while (1);		/* Check API Error return code. */
    }

  return (touch_ret);
}