This is the way to initialise a channel (The Pi has 2 channels; 0 and 1). The speed parameter is an integer in the range 500,000 through 32,000,000 and represents the SPI clock speed in Hz.
+
C'est la façon dont il faut initialiser un canal SPI (le Pi dispose de 2 canaux; 0 et 1).
−
The returned value is the Linux file-descriptor for the device, or -1 on error. If an error has happened, you may use the standard errno global variable to see why.
+
Paramètres:
+
* '''channel''': Le canal SPI à initialiser.
+
* '''speed''': la vitesse du canal SPI. Un entier (''integer'') dont la valeur varie entre 500,000 et 32,000,000 et représente la vitesse d'horloge du bus SPI en Hz.
+
+
La valeur retournée est un ''file descriptor'' Linux correspondant au périphérique. En cas d'erreur, c'est -1 qui est retourné en qui est retourné et la variable globale ''errno'' est initialisée avec un code d'erreur standard.