Re: FRDM-K64 GPIO driver name


Idupsle <idupsle@...>
 

diff --git a/drivers/gpio/gpio_k64.c b/drivers/gpio/gpio_k64.c
index 2d6a355..011eb52 100644
--- a/drivers/gpio/gpio_k64.c
+++ b/drivers/gpio/gpio_k64.c
@@ -111,6 +111,9 @@ static int gpio_k64_config(struct device *dev, int
access_op,
}
}

+ /* Ensure pin is configured as GPIO */
+ setting |= K64_PINMUX_FUNC_GPIO;
+
/* write pull-up/-down and, if set, interrupt configuration
settings */

if (access_op == GPIO_ACCESS_BY_PIN) {
Hi, quite well, with your patch, I got the output! Now I'm wondering how I can
manually set the pins to FUNC_GPIO = K64_PINMUX_ALT_1 = (0x1 << 8).
If I write something like

#include <device.h>
#include <gpio.h>
#include <sys_io.h>
#include <pinmux.h>
#include <zephyr.h>

#define GPIO_1 CONFIG_PINMUX_K64_GPIO_B_NAME
void main(void)
{
struct device *gpio_dev_1;
gpio_dev_1 = device_get_binding(GPIO_1);
uint32_t set = (0x1<<8);
pinmux_pin_set(gpio_dev_1,22, set);

int set_res = 0;
int* set_res_ptr = 0;
pinmux_pin_get(gpio_dev_1, 22, set_res_ptr);
printk("Pin 22 is set to: %u \n",set_res);

while(1){}
}

Nothing happens. Debugging tells me, that the command
pinmux_pin_set(gpio_dev_1,22, set)
is not executed at all. It should call:
static int _fsl_k64_set_pin(struct device *dev, uint32_t pin_id,
uint32_t func)
but doesn't.
pinmux_pin_get() Executes as excepted.
Any clue, why?

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