FRDM-K64 PIN Digital Read

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

FRDM-K64 PIN Digital Read

967 次查看
antonioangelm24
Contributor I

Hi.

I have a simple question. How do I use the DigtialRead function from Arduino in my FRMD K64 in C?. I need to read either high or low (1 | 0). I was trying this with the GPIOx_PDIR function but this doesn't write you a Logic 0 when the read is 0.

Can anyone help me out?

Thank you very much. 

标签 (1)
2 回复数

840 次查看
mjbcswitzerland
Specialist V

Hi Antonio

If a pin is configured as GPIO (with clock gated to it) and its GPIOx_PDDR is '0' you can read its state in the GPIOx_PDIR register.

I don't have the impression that developers using the NXP forum use Arduino so you may find more suitable answers to your environment at the Teensy forum - the TEENSY 3.5 uses the K64.

In case you are making a transition from the Arduino world you can try the uTasker project (open source on Git Hub) since it also supports TEENSy 3.5 (and FRDM-K64F etc.), including simulation of the device/board so that you can more easily learn the internal workings. It doesn't constrain you to a certain environment since it is neutral and includes project for most common IDEs (MCUXpresso, CW, KDS, IAR, Keil, Rowley, Atollic, etc...).

Regards

Mark

840 次查看
antonioangelm24
Contributor I

Hello Mark,

Thank you for your answer. I'll get to that, and will check the uTasker you mencioned.

Thanks.

0 项奖励
回复