HI
How to configure these three registers in gpio mode if you want to read the gpio state
0x29 0x30 0x2B
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Hi COCO J,
If you desire to write data to the debouncing registers, then you would need to follow the data format listed in figure 24 with correct device slave address, register address (either 0x29, 0x30, 0x2B), and the data you want to put into the register.
Configuration of these registers is done via the I2C bus on pins 23 and 22.
FYI,
a bit value of 0 enables the debounce feature for that row/col pin, this is the default value.
a bit value of 1 disables the debounce.
Regards,
Tyler
HI ti:
set mode, how to modify the code, we now send the data, only in one case the voltage is all high, and in other cases the voltage is low
static void tca8418_gpio_set(struct gpio_chip *gpiochip, unsigned int offset,
int value)
{
struct tca8418_keypad *keypad_data
= container_of(gpiochip, struct tca8418_keypad, gc);
int byte_offset = offset/8; //2
mutex_lock(&keypad_data->lock);
/*if (value){
keypad_data->gpio_out |= (value << offset);
}else{
keypad_data->gpio_out &= ~(value << offset);
}*/
keypad_data->gpio_out &= ~(1 << offset);
keypad_data->gpio_out |= (value << offset);
tca8418_write_byte(keypad_data,
REG_GPIO_DAT_OUT1+byte_offset,
keypad_data->gpio_out>>(byte_offset*8));
mutex_unlock(&keypad_data->lock);
}
Hi COCO J,
Do you have values that relate to each variable in the code?
Regards,
Tyler