Activate a single GPIO

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

Activate a single GPIO

Jump to solution
1,476 Views
GorkaC
Contributor I

Hi,

 

I'm working with the SLN-LOCAL-IOT Audio Kit and the SLN-LOCAL2-IOT-preRC5(SDK) version.

The thing is, it is recommended to use a function that comes with the firmware but I don't find a function that activates a single GPIO. 

By the way, I see that the function "GPIO_PinWrite(GPIO_Type *base, uint32_t pin, uint8_t output)"  is used to write in output pins but I don't know which are the parameters needed this function. 

 

Thanks very much, hope you help me with this problem.

0 Kudos
Reply
1 Solution
1,448 Views
jeremyzhou
NXP Employee
NXP Employee

Hi,
Thanks for your reply.
According to the above code, I didn't find the initialization code of the GPIO pin, and I guess your issue is related to missing the initialization code.
In the BOARD_InitPins() function, it illustrates how to configure the pin as the GPIO pin, please refer to 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 weeks 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
Reply
4 Replies
1,466 Views
GorkaC
Contributor I

Hi Jeremy,

Thanks for your quick reply. We tried the blinky led demo (iled_blinky) on our Kit but it does not blink the RED LED like it is supposed to do. 

Code:

GorkaC_0-1623069260847.png

And the defines:

GorkaC_1-1623069370656.png

GorkaC_2-1623069456679.png

We are working with a MIMXRT106SDVL6B.

How can I know the number of each pin of the micro if that's the problem? (Number of the pin related to the number of the parameters in the blinky function).

0 Kudos
Reply
1,449 Views
jeremyzhou
NXP Employee
NXP Employee

Hi,
Thanks for your reply.
According to the above code, I didn't find the initialization code of the GPIO pin, and I guess your issue is related to missing the initialization code.
In the BOARD_InitPins() function, it illustrates how to configure the pin as the GPIO pin, please refer to 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 weeks 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
Reply
1,471 Views
jeremyzhou
NXP Employee
NXP Employee

Hi,
Thank you for your interest in NXP Semiconductor products and for the opportunity to serve you.
Below is the comments of the GPIO_PinWrite(GPIO_Type *base, uint32_t pin, uint8_t output) function.

 

/*!
* brief Sets the output level of the individual GPIO pin to logic 1 or 0.
*
* param base GPIO base pointer.
* param pin GPIO port pin number.
* param output GPIOpin output logic level.
* - 0: corresponding pin output low-logic level.
* - 1: corresponding pin output high-logic level.
*/

 

And I'd like to suggest you refer to iled_blinky demo in the SDK library to learn to configure a pin as the GPIO output pin.
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 weeks 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.
-------------------------------------------------------------------------------

1,457 Views
GorkaC
Contributor I

Hi Jeremy,

The iled_blinky demo didn't work.

0 Kudos
Reply