How to access I2c and GPIO on Windows IoT

Bjalv
Bjalv New Member Posts: 4
edited March 2019 in UP Squared Windows

The following code will open up the I2c without issue on the Raspberry Pi, but on Up Squared it results in an exception.

string advancedQuerySyntaxString = I2cDevice.GetDeviceSelector("I2C1"); 
var deviceInformationCollection = await DeviceInformation.FindAllAsync(advancedQuerySyntaxString);
_device = await I2cDevice.FromIdAsync(deviceInformationCollection[0].Id, settings);

It seems to not find any I2c, and thus "deviceInformationCollection" is empty.
It throws the following exception:

System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values.
Parameter name: index
at System.Runtime.InteropServices.WindowsRuntime.IVectorViewToIReadOnlyListAdapter.Indexer_Get[T](Int32 index)
at Communication.Vehicle.VehicleCommunication.d__5.MoveNext()

How should the BIOS be configured to get I2c and GPIO working in Windows IoT?
Are there any additional changes that must be done elsewhere?

Comments

Privacy Policy