Activate a single GPIO

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

Activate a single GPIO

跳至解决方案
957 次查看
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 项奖励
1 解答
929 次查看
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 项奖励
4 回复数
947 次查看
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 项奖励
930 次查看
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 项奖励
952 次查看
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.
-------------------------------------------------------------------------------

938 次查看
GorkaC
Contributor I

Hi Jeremy,

The iled_blinky demo didn't work.

0 项奖励