Toggle GPIO from S32G2 linux image

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Toggle GPIO from S32G2 linux image

ソリューションへジャンプ
1,222件の閲覧回数
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,191件の閲覧回数
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,192件の閲覧回数
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,208件の閲覧回数
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,203件の閲覧回数
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 件の賞賛
返信
%3CLINGO-SUB%20id%3D%22lingo-sub-1993386%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ES32G2%20linux%E3%82%A4%E3%83%A1%E3%83%BC%E3%82%B8%E3%81%8B%E3%82%89%E3%81%AEGPIO%E3%81%AE%E5%88%87%E3%82%8A%E6%9B%BF%E3%81%88%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1993386%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3E%E7%9A%86%E3%81%95%E3%82%93%E3%80%81%E3%81%93%E3%82%93%E3%81%AB%E3%81%A1%E3%81%AF%3C%2FP%3E%3CBR%20%2F%3E%3CP%3E%E7%A7%81%E3%81%AFfsl-auto-image%E3%82%92%E4%BD%BF%E7%94%A8%E3%81%97%E3%81%A6%E3%81%8A%E3%82%8A%E3%80%81S32G-VNP%E9%96%8B%E7%99%BA%E3%83%9C%E3%83%BC%E3%83%89%E3%81%AELED%E3%83%94%E3%83%B3%E3%82%92(libgpiod%E3%82%92%E4%BD%BF%E7%94%A8%E3%81%97%E3%81%A6)%E5%88%87%E3%82%8A%E6%9B%BF%E3%81%88%E3%82%8B%E3%81%9F%E3%82%81%E3%81%AB%E4%BD%BF%E7%94%A8%E3%81%A7%E3%81%8D%E3%82%8Bc%E3%83%95%E3%82%A1%E3%82%A4%E3%83%AB%E3%82%92%E6%9B%B8%E3%81%8D%E3%81%9F%E3%81%84%E3%81%A8%E6%80%9D%E3%81%84%E3%81%BE%E3%81%99%E3%80%82%E3%81%A9%E3%82%93%E3%81%AA%E3%83%AA%E3%82%BD%E3%83%BC%E3%82%B9%E3%81%A7%E3%82%82%E5%95%8F%E9%A1%8C%E3%81%82%E3%82%8A%E3%81%BE%E3%81%9B%E3%82%93%E3%80%82%E7%A7%81%E3%81%AF%E5%9F%BA%E6%9C%AC%E7%9A%84%E3%81%AA%E3%83%86%E3%83%B3%E3%83%97%E3%83%AC%E3%83%BC%E3%83%88%E3%82%B9%E3%83%8B%E3%83%9A%E3%83%83%E3%83%88%E3%82%92%E6%8E%A2%E3%81%97%E3%81%A6%E3%81%84%E3%81%BE%E3%81%99%E3%80%81%E7%A7%81%E3%81%AF%E7%B5%84%E3%81%BF%E8%BE%BC%E3%81%BFLinux%E3%81%AB%E3%81%8B%E3%81%AA%E3%82%8A%E6%96%B0%E3%81%97%E3%81%84%E3%81%AE%E3%81%A7%E3%80%81%E3%82%B3%E3%83%BC%E3%83%89%E5%85%A8%E4%BD%93%E3%81%AF%E5%BF%85%E8%A6%81%E3%81%82%E3%82%8A%E3%81%BE%E3%81%9B%E3%82%93%E3%80%82%3C%2FP%3E%3CP%3E%E7%A7%81%E3%81%AF%E3%81%99%E3%81%A7%E3%81%ABNXP%20linux%20BSP%2033%20pdf%E3%81%AEGPIO%E3%82%BB%E3%82%AF%E3%82%B7%E3%83%A7%E3%83%B3%E3%82%92%E8%A6%8B%E3%81%A6%E3%81%8D%E3%81%BE%E3%81%97%E3%81%9F%E3%81%8C%E3%80%81%E3%81%9D%E3%82%8C%E3%82%89%E3%81%AF%E3%82%BF%E3%83%BC%E3%83%9F%E3%83%8A%E3%83%AB%E3%81%8B%E3%82%89%E5%91%BC%E3%81%B3%E5%87%BA%E3%81%99%E5%BF%85%E8%A6%81%E3%81%8C%E3%81%82%E3%82%8B%E3%83%A9%E3%82%A4%E3%83%96%E3%83%A9%E3%83%AAAPI%E3%81%AE%E3%81%BF%E3%82%92%E7%A4%BA%E3%81%97%E3%81%A6%E3%81%84%E3%81%BE%E3%81%99%E3%80%82%3C%2FP%3E%3CP%3E%E3%81%BE%E3%81%9F%E3%80%81%E3%81%9D%E3%82%8C%E3%81%AF%E3%82%B3%E3%83%BC%E3%83%89%E3%81%A0%E3%81%91%E3%81%A7%E3%81%99%E3%81%8B%E3%80%81%E3%81%9D%E3%82%8C%E3%81%A8%E3%82%82dts%E3%81%AB%E3%82%82%E5%A4%89%E6%9B%B4%E3%82%92%E5%8A%A0%E3%81%88%E3%82%8B%E5%BF%85%E8%A6%81%E3%81%8C%E3%81%82%E3%82%8A%E3%81%BE%E3%81%99%E3%81%8B%3F%3C%2FP%3E%3CBR%20%2F%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F24163%22%20target%3D%22_blank%22%3E%40chenyin_h%3C%2FA%3E%E3%81%82%E3%81%AA%E3%81%9F%E3%81%8C%E3%81%84%E3%81%A4%E3%82%82%E3%81%A8%E3%81%A6%E3%82%82%E8%A6%AA%E5%88%87%E3%81%A0%E3%81%A3%E3%81%9F%E3%81%AE%E3%81%A7%E3%80%81%E3%81%82%E3%81%AA%E3%81%9F%E3%82%92%E3%82%BF%E3%82%B0%E4%BB%98%E3%81%91%E3%81%97%E3%81%A6%E3%81%84%E3%81%BE%E3%81%99%E3%80%82%3CBR%20%2F%3E%3CBR%20%2F%3E%E6%9C%80%E8%89%AF%3C%2FP%3E%3CP%3E%E3%83%B4%E3%82%A3%E3%82%B7%E3%83%A5%E3%83%8C%3C%2FP%3E%3C%2FLINGO-BODY%3E