使用BBB板子,AM335X的GPMC_AD8 到GPMC_AD15 ,配置为GPIO 做KEY ,设备树配置,上拉100K到3.3V ,结果发现,上电后,KEY就被激活
测试IO电压 ,固定电平为0.65V…..修改上拉电阻为10K ,变为2.25V。。。。查看硬件,这8个IO,都是独立引出来的,设备树也没有其它占用。
gpio_keys: gpio_keys_s0 {
pinctrl-single,pins = <
0x20 (PIN_INPUT_PULLUP | MUX_MODE7) /* conf_gpmc_ad8.gpio0_22 */
0x24 (PIN_INPUT_PULLUP | MUX_MODE7) /* conf_gpmc_ad9.gpio0_23 */
0x28 (PIN_INPUT_PULLUP | MUX_MODE7) /* conf_gpmc_ad10.gpio0_26 */
0x2c (PIN_INPUT_PULLUP | MUX_MODE7) /* conf_gpmc_ad11.gpio0_27 */
0x30 (PIN_INPUT_PULLUP | MUX_MODE7) /* conf_gpmc_ad12.gpio1_12 */
0x34 (PIN_INPUT_PULLUP | MUX_MODE7) /* conf_gpmc_ad13.gpio1_13 */
0x38 (PIN_INPUT_PULLUP | MUX_MODE7) /* conf_gpmc_ad14.gpio1_14 */
0x3c (PIN_INPUT_PULLUP | MUX_MODE7) /* conf_gpmc_ad15.gpio1_15 */
>;
};
gpio_keypad{
compatible = "gpio-keys";
#address-cells = <1>;
#size-cells = <0>;
autorepeat;
switch@1 {
label = "up";
linux,code = <103>;
gpios = <&gpio0 22 GPIO_ACTIVE_LOW>;
gpio-key,wakeup;
};
switch@2 {
label = "down";
linux,code = <108>;
gpios = <&gpio0 23 GPIO_ACTIVE_LOW>;
gpio_key,wakeup;
};
switch@3 {
label = "left";
linux,code = <105>;
gpios = <&gpio0 26 GPIO_ACTIVE_LOW>;
gpio_key,wakeup;
};
switch@4 {
label = "right";
linux,code = <106>;
gpios = <&gpio0 27 GPIO_ACTIVE_LOW>;
gpio_key,wakeup;
};
};
不知道为啥,同样的设备树,用其它IO就正常。。求指点。。
xiyuan ma:
回复 Denny%20Yang99373:
谢谢了,咨询下,怎么在系统里看寄存器内容呀? 有专门的命令吗?还是要写代码查看?
xiyuan ma:
解决了,设备树不熟悉,GPIO的配置 为pinmux的子系统就可以了