Skip to content

Commit 112babe

Browse files
authored
Merge pull request #79 from Pi4J/spi_provider_details
add SPI capability to linuxfs provider description. in io-example PW…
2 parents ee8846a + 8bb98d2 commit 112babe

File tree

3 files changed

+16
-1
lines changed

3 files changed

+16
-1
lines changed

content/documentation/io-examples/pwm.md

+1
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ As of version 2.6.0 of Pi4J, `linuxfs-pwm` also supports hardware PMW on the Ras
7979
Only hardware PWM is supported.
8080

8181
### PWM GPIOs
82+
The channel number in the following charts are supplied as the buildPwmConfig config value ```address```.
8283

8384
The user must modify `config.txt` to enable PWM.
8485

content/documentation/providers/_index.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ Current supported providers:
2828
* Pro
2929
* Works on Raspberry Pi 5
3030
* Generic for any SoC supporting LinuxFS
31-
* Supports I2C, and PWM Hardware
31+
* Supports I2C, SPI, and PWM Hardware
3232
* Doesn't need `sudo`
3333
* Contra
3434
* Doesn't provide serial and SPI

content/documentation/providers/linuxfs.md

+14
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,20 @@ The buffer size for this SPI implementation is 4096 bytes. This can be configure
7070
* Debian Bullseye OS: `/boot/config.txt`
7171
* Raspberry Pi OS, based on Debian Bookworm: `/boot/firmware/config.txt`
7272

73+
```java
74+
var spiConfig = Spi.newConfigBuilder(pi4j)
75+
.id(SPI_PROVIDER_ID)
76+
.name(SPI_PROVIDER_NAME)
77+
.bus(spiBus)
78+
.chipSelect(chipSelect)
79+
.baud(Spi.DEFAULT_BAUD)
80+
.mode(SpiMode.MODE_0)
81+
.provider("linuxfs-spi")
82+
.build();
83+
var spi = pi4j.create(spiConfig);
84+
85+
```
86+
7387
## PWM
7488

7589
Example on how to use PWM with LinuxFS:

0 commit comments

Comments
 (0)