Toggle GPIO from S32G2 linux image

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

Toggle GPIO from S32G2 linux image

跳至解决方案
1,043 次查看
Vishnu3
Contributor III

Hi all,

 

I am using the fsl-auto-image and i would like to write a c file which can be used to toggle the LED pins (using libgpiod) on my S32G-VNP development board. Any resources are also fine. I am looking for a basic template snippet, I don't need the whole code as I am fairly new to embedded linux.

I have already taken a look at the GPIO section in the NXP linux BSP 33 pdf but those only show the library APIs that needs to be called from the terminal.

Also, is it just the code or do I have to also make changes in the dts?

 

@chenyin_h  tagging you because you have been always so very helpful.

Best,

Vishnu

标记 (2)
0 项奖励
回复
1 解答
1,012 次查看
chenyin_h
NXP Employee
NXP Employee

Hello, @Vishnu3 

Thanks for your reply.

On BSP, the libgpiod-tools is supported, which could be used to control the GPIO from user space. directly execute the command from shell could display and control the GPIO status.

If these commands could not fully fulfill your requirements, I suggest reference the code of libgpiod,  to  apply your own modification on it if needed.

https://github.com/brgl/libgpiod

 

BR

Chenyin

 

在原帖中查看解决方案

0 项奖励
回复
3 回复数
1,013 次查看
chenyin_h
NXP Employee
NXP Employee

Hello, @Vishnu3 

Thanks for your reply.

On BSP, the libgpiod-tools is supported, which could be used to control the GPIO from user space. directly execute the command from shell could display and control the GPIO status.

If these commands could not fully fulfill your requirements, I suggest reference the code of libgpiod,  to  apply your own modification on it if needed.

https://github.com/brgl/libgpiod

 

BR

Chenyin

 

0 项奖励
回复
1,029 次查看
chenyin_h
NXP Employee
NXP Employee

Hello, @Vishnu3 

Thanks for your post.

May I know which version BSP you are working with? based on BSP33?

 

BR

Chenyin

0 项奖励
回复
1,024 次查看
Vishnu3
Contributor III

Hi Chenyin,

The BSP image I'm using is version 42. I've been referring to the document version 33, since I couldn't find the document for the latest version.

 

Best,

 

Vishnu

0 项奖励
回复