None
int32 touch
combo adr
// Register values are tuned for electrode geometry.
// Here are some reasonable defaults, but you may need
// to tune these values for your specific application.
// See: https://www.nxp.com/docs/en/data-sheet/MPR121.pdf
const struct mpr121_cfg config[34] = {
{MPR121_TOUCH_THRESHOLD(0), 6},
{MPR121_TOUCH_THRESHOLD(1), 6},
{MPR121_TOUCH_THRESHOLD(2), 6},
{MPR121_TOUCH_THRESHOLD(3), 6},
{MPR121_TOUCH_THRESHOLD(4), 6},
{MPR121_TOUCH_THRESHOLD(5), 6},
{MPR121_TOUCH_THRESHOLD(6), 6},
{MPR121_TOUCH_THRESHOLD(7), 6},
{MPR121_TOUCH_THRESHOLD(8), 6},
{MPR121_TOUCH_THRESHOLD(9), 6},
{MPR121_TOUCH_THRESHOLD(10), 6},
{MPR121_TOUCH_THRESHOLD(11), 6},
{MPR121_RELEASE_THRESHOLD(0), 12},
{MPR121_RELEASE_THRESHOLD(1), 12},
{MPR121_RELEASE_THRESHOLD(2), 12},
{MPR121_RELEASE_THRESHOLD(3), 12},
{MPR121_RELEASE_THRESHOLD(4), 12},
{MPR121_RELEASE_THRESHOLD(5), 12},
{MPR121_RELEASE_THRESHOLD(6), 12},
{MPR121_RELEASE_THRESHOLD(7), 12},
{MPR121_RELEASE_THRESHOLD(8), 12},
{MPR121_RELEASE_THRESHOLD(9), 12},
{MPR121_RELEASE_THRESHOLD(10), 12},
{MPR121_RELEASE_THRESHOLD(11), 12},
{MPR121_MHD_RISING, 0x01},
{MPR121_NHD_RISING, 0x01},
{MPR121_NCL_RISING, 0x0E},
{MPR121_MHD_FALLING, 0x01},
{MPR121_NHD_FALLING, 0x05},
{MPR121_NCL_FALLING, 0x01},
{MPR121_CDC_CONFIG, 0x10}, // default, 16uA charge current
{MPR121_CDT_CONFIG, 0x20}, // 0.5uS encoding, 1ms period
{MPR121_ELECTRODE_CONFIG,
0x8F}, // start with first 5 bits of baseline tracking
{0xff, 0} // end-of-list
};
struct mpr121_state state;
mpr121_init(&state, &config[0], attr_adr);
mpr121_krate_int(&state, &outlet_touch);
mpr121_dispose(&state);