dotnet / iot

This repo includes .NET Core implementations for various IoT boards, chips, displays and PCBs.
MIT License
2.12k stars 574 forks source link

Raspberry Pi4 running WIndows 11 - GPIO #2183

Open vandenplas9aa opened 7 months ago

vandenplas9aa commented 7 months ago

Does:

RaspberryPiDriverTest.cs run on the Raspberry Pi4 running WIndows 11 ?

(I hope the answer is yes!)

I've also installed ms code

Ellerbach commented 7 months ago

This scenario is not supported because there is not yet any Windows driver properly exposed. If one will implement it, then it will properly be able to use it.

vandenplas9aa commented 7 months ago

On the https://worproject.com/faq for GPIO drivers FAO, it points to this site for raspberry pi windows 11 gpio drivers

The driver for windows 11 raspberry pi is located at:

Driver:

https://github.com/raspberrypi/windows-drivers/tree/master/drivers/gpio/bcm2836

alternatively, could a WINE application (win32 application under raspberry Linux) set the GPIOs?

Ellerbach commented 7 months ago

You have example of custom drivers here: https://github.com/dotnet/iot/tree/main/src/devices/Gpio And the main supported ones here: https://github.com/dotnet/iot/tree/main/src/System.Device.Gpio/System/Device/Gpio/Drivers

That can give you an idea on how to add the one you're looking for.

vandenplas9aa commented 7 months ago

big thanks, but again Linux based. It very easy in Linux (the example here looks good), but window 11 seems to be major issue (all it is doing is changing a register!)

I did find: https://github.com/microsoft/Windows-driver-samples/tree/main/gpio/samples

which might be worth a try

It is understand the gpio/bcm2836 driver, I guess..

Ellerbach commented 7 months ago

One of the example, is Windows IoT: https://github.com/dotnet/iot/blob/main/src/System.Device.Gpio/System/Device/Gpio/Drivers/Windows10Driver.cs and : https://github.com/dotnet/iot/blob/main/src/System.Device.Gpio/System/Device/Gpio/Drivers/Windows10DriverPin.cs

So it all depends how the Windows driver is exposed. dllimport will in all cases most likely be your friend here.

driver1998 commented 6 months ago

The Raspberry Pi Windows 11 driver is compatible with the Windows 10 IoT Windows.Devices.Gpio API (not surprising since it is the same driver ported over), Windows10Driver.cs should work.

Also see https://github.com/driver1998/rpi3win10demos for some (C++/WinRT) demos.

pgrawehr commented 6 months ago

@driver1998 That sounds good. Have you managed to install Windows 11 on a Raspberry Pi? I have not yet found working instructions on how to do that.

driver1998 commented 6 months ago

I am one of the testers back then, it is a community-driven project all along. I guess WoR Deployer from https://worproject.com/ should just work.

krwq commented 2 months ago

[Triage] it doesn't seem critical