How to configure tca6416 as a button

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

How to configure tca6416 as a button

1,338 次查看
末班车上的乘客
Contributor II

Hi,everyone

I need tca6416a as input button and output control for my new design,how to configure tca6416 as gpio button and gpio.Is it like below? 

i2c@3 {
#address-cells = <1>;
#size-cells = <0>;
reg = <3>;
tca6416: tca6416@21{
compatible = "ti,tca6416";
reg = <0x21>;
gpio-controller;
#gpio-cells = <2>;
};
};

gpio_keys {
compatible = "gpio-keys";
pinctrl-names = "default";

power-button {
label = "Power Button";
linux,code = <KEY_POWER>;
gpios = <&gpio4 22 GPIO_ACTIVE_LOW>;
};

left{
label = "left";
linux,code = <KEY_RIGHT>;
gpios = <&tca6416 0 GPIO_ACTIVE_LOW>;
};
right {
label = "right";
linux,code = <KEY_LEFT>;
gpios = <&tca6416 1 GPIO_ACTIVE_LOW>;
};
};

leds {
compatible = "gpio-leds";
pinctrl-names = "default";


keybacklight{
label = "keybl";
gpios = <&tca6416 2 GPIO_ACTIVE_HIGH>;
};
};

标签 (4)
0 项奖励
1 回复

1,007 次查看
igorpadykov
NXP Employee
NXP Employee

Hi

seems tca6416 used on wandboard so one can check its configuration :

mx6-wandboard/tca6416-keypad.c at master · smartpathinfosystemsindia/mx6-wandboard · GitHub 

Best regards
igor
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 项奖励