How to clean all the pins with GPIO_PortClear?

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

How to clean all the pins with GPIO_PortClear?

1,135 次查看
javierhernande1
Contributor IV

Hello,

It's not possible to use GPIO_PortClear so?

GPIO_PortClear((void*)base[i], 0u << pin[i]);

I want to turn off all the leds but that not works, only with 1u but turn on all the leds. I have changed the logic in pin_mux but not works to me.

The 7 segment led display that I'm using is common anode.

BR

标签 (1)
2 回复数

1,061 次查看
mjbcswitzerland
Specialist V

Hi

PIO_PortClear((void*)base[i], 0u << pin[i]);

does nothing because writing a 0 to that register has no effect.

You need

GPIO_PortSet((void*)base[i], 1u << pin[i]);

Regards

Mark

Complete Kinetis solutions, training and support: http://www.utasker.com/kinetis.html

1,060 次查看
javierhernande1
Contributor IV

Thank you!

Works fine.

BR

0 项奖励
回复