Set GPIO

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Set GPIO

Jump to solution
794 Views
stdcerr
Contributor IV

Hi,

 

I'm back at the very basics, why do my GPIOs PORTC15 & PORTC18 not get set high with the following code?

 

 

 

    gpio_pin_config_t ConfigC15 = { .pinDirection = kGPIO_DigitalOutput, .outputLogic = 0 };
    gpio_pin_config_t ConfigC18 = { .pinDirection = kGPIO_DigitalOutput, .outputLogic = 0 };
    GPIO_PinInit(GPIOC,15,&ConfigC15);
    GPIO_PinInit(GPIOC,18,&ConfigC18);
    GPIO_PinWrite(GPIOC,15,1);
    GPIO_PinWrite(GPIOC,18,1);

 

 

 

  What am I missing?

Same resiult when I set the default outputLogic to 1 instead.

Hm, I added

 CLOCK_EnableClock(kCLOCK_PortC);

before the lines above but still no luck.

Labels (1)
0 Kudos
1 Solution
784 Views
nxf56274
NXP Employee
NXP Employee

Hi,

Which mcu do you use? Do you configure the pin multiplexing? Configure the pin as GPIO ? The sdk has gpio example. You can refer it.

Have a great day,
TIC

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

- We are following threads for 7 days after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

View solution in original post

0 Kudos
1 Reply
785 Views
nxf56274
NXP Employee
NXP Employee

Hi,

Which mcu do you use? Do you configure the pin multiplexing? Configure the pin as GPIO ? The sdk has gpio example. You can refer it.

Have a great day,
TIC

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

- We are following threads for 7 days after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 Kudos