Yes could be very interesting also im using only 2 pin for max7219 and i would like to use the remain one for normal gpio ... i share my code ...
Code: Select all
private async Task InitSpi()
{
try
{
var settings = new SpiConnectionSettings((int)chipSelect);
settings.ClockFrequency = 10000000;
settings.Mode = SpiMode.Mode0;
settings.SharingMode = SpiSharingMode.Shared;
string spiAqs = SpiDevice.GetDeviceSelector(SPIControllerName); /* Find the selector string for the SPI bus controller */
var devicesInfo = await DeviceInformation.FindAllAsync(spiAqs); /* Find the SPI bus controller device with our selector string */
SpiDisplay = await SpiDevice.FromIdAsync(devicesInfo[0].Id, settings); /* Create an SpiDevice with our bus controller and SPI settings */
}
/* If initialization fails, display the exception and stop running */
catch (Exception ex)
{
throw new Exception("SPI Initialization Failed", ex);
}
}
regards,
Andrea