How to clean all the pins with GPIO_PortClear?

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

How to clean all the pins with GPIO_PortClear?

1,218件の閲覧回数
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,144件の閲覧回数
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,143件の閲覧回数
javierhernande1
Contributor IV

Thank you!

Works fine.

BR

0 件の賞賛
返信