]> git.feebdaed.xyz Git - 0xmirror/WiringPi.git/commitdiff
Merge branch 'docu-3.16' into patch-1
authormstroh <m.stroh76@gmail.com>
Fri, 6 Jun 2025 17:28:16 +0000 (19:28 +0200)
committerGitHub <noreply@github.com>
Fri, 6 Jun 2025 17:28:16 +0000 (19:28 +0200)
1  2 
documentation/english/functions.md

index c0a39e6cf2d216d042c9d6a80b79ff4d791b8c19,30498f15ab82f5a247dee626b86ac3bee8f68988..981786b1be3f93637f34f14f36c287d6a9fe29bd
@@@ -569,27 -786,26 +786,26 @@@ else 
  
  Functions that start with  ``wiringPiSPIx`` are new since version 3, allowing the SPI bus number to be specified. This is especially useful for the Compute Module, which has multiple SPI buses (0-7). The old functions remain available, but they always refer to SPI bus 0, which is available on the 40 pin GPIO connector.
  
  ### wiringPiSPISetup / wiringPiSPISetupMode / wiringPiSPIxSetupMode
  
- Opens the specified SPI bus.
+ Opens the specified SPI bus. The Raspberry Pi has 2 channels, 0 and 1. The speed parameter is an integer in the range of 500,000 through 32,000,000 and represents the SPI clock speed in Hz.
  
- >>>
  ```C
- int wiringPiSPISetup (int channel, int speed)
- int wiringPiSPISetupMode (int channel, int speed, int mode)
- int wiringPiSPIxSetupMode(const int number, const int channel, const int speed, const int mode)
+ int wiringPiSPISetup (int channel, int speed);
 -int wiringPiSPISetup (int channel, int speed, int mode);
++int wiringPiSPISetupMode (int channel, int speed, int mode);
+ int wiringPiSPIxSetupMode(const int number, const int channel, const int speed, const int mode);
  ```
  
- ``number``: SPI muber (typically 0, on Compute Module 0-7).  
+ ``number``: SPI number (typically 0, on Compute Module 0-7).  
  ``channel``: SPI channel (typically 0 or 1, on Compute Module 0-3).  
- ``speed``: SPI clock.  
- ``mode``: SPI mode (https://www.kernel.org/doc/Documentation/spi/spidev).  
- ``Return Value``:  File handle to the SPI bus
- > -1 ... Error or EXIT (Programm termination)
+ ``speed``: SPI clock speed in Hz (500,000 to 32,000,000).  
+ ``mode``: SPI mode ([www.kernel.org/doc/Documentation/spi/spidev](https://www.kernel.org/doc/Documentation/spi/spidev)).  
+ ``Return Value``:  File handle to the SPI bus, or -1 on error.
+ **Example**  
  
- **Example**
- >>>
  ```C
  const int spiChannel = 1;
  const int spiSpeedInit = 250000; // Hz