Skip to content

Add optional parameter to spi to select spidev #243

@LaneaLucy

Description

@LaneaLucy

snprintf (spiDev, 31, "/dev/spidev0.%d", channel) ;

Spidev0 is hard coded, but for example the devterm with cm4 uses spidev4 for its printer. In the past, the creators of devterm offered a custom version of wiringpi because of this, but if there would be a optional parameter to the spi functions, to select different spidev's, then you could use a unmodified version of wiringpi.
The modification needed for this shouldn't be that much of work, first remove the hardcoded spidev and make it also a variable, like the channel, get the var from optional function parameter, and last, make the spiFds array bigger or better, make it a two dimensional array.

This would really help in porting a new os to the Devterm without making custom wiringpi versions for everything.

Thx in advance

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions