Re: GPIO FRDM_K64F


Maureen Helm
 

Hi Kevin,

The frdm_k64f board supports the Zephyr gpio.h interface with 5 instances of the gpio_mcux.c device driver, which correspond to the 5 gpio ports on the k64 SoC (GPIOA, GPIOB, …, GPIOE). So, first you need to use the board schematic to determine which port and pin you want to use. For example, on frdm_k64f the SW2/INT1 button is routed to the PTC6 SoC pin, which is PORTC/GPIOC pin 6. There are some helper macros in boards/arm/frdm_k64f/board.h for the buttons and LEDs:

 

/* Push button switch 2 */

#define SW2_GPIO_NAME   CONFIG_GPIO_MCUX_PORTC_NAME

#define SW2_GPIO_PIN    6

A good example to start with is samples/basic/button, which uses a falling edge gpio interrupt. The gpio driver also supports rising edge and both edges.

 

Another more complicated example that uses a sensor interrupt is samples/sensor/fxos8700 (and consequently drivers/sensors/fxos8700/fxos8700_trigger.c, which does all the gpio setup and handling).

 

You should also take a look at boards/arm/frdm_k64f/pinmux.c to check if the pin you want to use has been muxed as a gpio. If not, you’ll need to add it there or somewhere in your application.

 

Maureen

 

From: zephyr-devel-bounces@... [mailto:zephyr-devel-bounces@...] On Behalf Of Tomasz Bursztyka
Sent: Wednesday, July 05, 2017 3:51 AM
To: zephyr-devel@...
Subject: Re: [Zephyr-devel] GPIO FRDM_K64F

 

Hi,

It's specific to this board, so you'll have to check its datasheet:
http://cache.freescale.com/files/32bit/doc/user_guide/FRDMK64FUG.pdf

see page 17

Then for the configuration and behavior of a gpio pin, it's up to the µC so I guess you
should be able to find that info somewhere in:
http://cache.freescale.com/files/microcontrollers/doc/ref_manual/K64P144M120SF5RM.pdf

However, I believe it's properly driven already in Zephyr so it's only a matter for you to use the gpio API.

So, inclued/gpio.h and samples/drivers/gpio/src/main.c will help you towards using gpio API.
(and thus configuring the relevant port accordingly).

Tomasz

Hello,
I want to trigger on the rising edge of a sensor (buzzer,PIR,...) but where can I find the Name of the Pin from the NXP Frdm-K64f Board.

 

So how is it possible with this Board to trigger on the rising edge of sensors?

Thanks in Advance

Kevin




_______________________________________________
Zephyr-devel mailing list
Zephyr-devel@...
https://lists.zephyrproject.org/mailman/listinfo/zephyr-devel

 

Join devel@lists.zephyrproject.org to automatically receive all group messages.