예제 #1
0
void CLumenCapsense::init() {
	uint8_t data[10];
	twi_master_init();

	lumen_capsense_ambient_setpoint = 200;

	mpr121_soft_reset();
	nrf_delay_us(100);
	mpr121_config_prox_touch_0();
	nrf_delay_us(100000);
	mpr121_read_register(MPR121_OOR_0_7, data);
}
예제 #2
0
/* B0P18 is #IRQ line of the touchpad */
void button_init_device(void)
{
    mpr121_init(0xb4);
    mpr121_soft_reset();
    mpr121_set_config(&config);

    queue_init(&mpr121_queue, true);
    create_thread(mpr121_thread, mpr121_stack, sizeof(mpr121_stack), 0,
        mpr121_thread_name IF_PRIO(, PRIORITY_USER_INTERFACE) IF_COP(, CPU));
    /* enable interrupt */
    imx233_pinctrl_acquire(0, 18, "mpr121_int");
    imx233_pinctrl_set_function(0, 18, PINCTRL_FUNCTION_GPIO);
    imx233_pinctrl_enable_gpio(0, 18, false);
    imx233_pinctrl_setup_irq(0, 18, true, true, false, &mpr121_irq_cb, 0);
    /* generic part */
    imx233_button_init();
}