Ligne 3 : |
Ligne 3 : |
| == Librairie SPI == | | == Librairie SPI == |
| | | |
− | WiringPi includes a library which can make it easier to use the Raspberry Pi’s on-board SPI interface. | + | WiringPi inclus une librairie qui facilite l'utilisation du bus SPI du Raspberry Pi. |
| | | |
− | Before you can use SPI interface, you may need to use the gpio utility to load the SPI drivers into the kernel:
| + | Avant de pouvoir utiliser l'interface SPI, vous pourriez avoir besoin d'utiliser l'utilitaire '''gpio''' pour charger le pilote SPI dans le noyaux (Kernel): |
| | | |
− | gpio load spi | + | gpio load spi |
| | | |
− | If you need a buffer size of greater than 4KB, then you can specify the size (in KB) on the command line:
| + | Si vous avez besoin d'une mémoire tampon (''buffer'') supérieur à 4KB alors vous devez spécifier la taille (en KB) dans la ligne de commande: |
| | | |
− | gpio load spi 100 | + | gpio load spi 100 |
| | | |
− | will allocate a 100KB buffer. (You should rarely need this though, the default is more than enough for most applications).
| + | allouera une mémoire tampon de 100KB. Vous aurez rarement besoin d'une taille taille de buffer, la valeur par défaut sera plus qu'assez pour la plupart des application. |
| | | |
− | To use the SPI library, you need to:
| + | Pour utiliser la librairie SPI, vous devez ajouter la ligne suivante dans votre programme: |
| | | |
− | #include <wiringPiSPI.h> | + | <nowiki>#include <wiringPiSPI.h></nowiki> |
| | | |
− | in your program. Programs need to be linked with -lwiringPi as usual.
| + | Comme d'habitude, le programme doit être linké avec le paramètre '''-lwiringPi''' . |
| | | |
| == Fonctions == | | == Fonctions == |