pi4j-v2 icon indicating copy to clipboard operation
pi4j-v2 copied to clipboard

SPI mode1 on spi0. Also flags overwritten

Open taartspi opened this issue 3 years ago • 1 comments
trafficstars

I need mode1 on spi0. The SPI Provider prevents this. The spi provider comment states " // SPI MODE_1 and MODE_2 are not supported on the AUX SPI BUS_1 by PiGPIO" The code does not agree so a simple change let me create the spi.

  1. Need to confirm the comments are correct and make two changes in the if test to conform to the comments
  2. The flags are cleared by flags = (flags & (0xFFFFFFFF ^ SPI_BUS_MASK)) & SPI_BUS_MASK; // clear AUX bit
  3. MODE and BUS appear to use a default value if none supplied by the application. These overwrite what is in the flags.
    A) should these two attributes be required B) use a != null check and only overwrite the flags if they were supplied. This would allow the user to set flags that may not function and create debug nightmare, so I think they being required is better but requires existing user to update code when moving this code level.

taartspi avatar Aug 11 '22 15:08 taartspi

I created a pull request #236 It contains code changes for items 1 and 2. If you agree with this please move it thru the process as I know a user will want this when I provide the ADS1256 code.

Separately item 3. If you agree changes are needed describe which way you prefer and I will do that with another pull request.

thanks Tom

@eitch @FDelporte

taartspi avatar Aug 12 '22 00:08 taartspi

item 3 fixed with PR 248

All items now resolved/integrated

taartspi avatar Feb 01 '23 00:02 taartspi