Pi-WiringPi-Reference-PiSpecific

De MCHobby - Wiki
Révision datée du 12 octobre 2013 à 15:52 par Admin (discussion | contributions) (Page créée avec « {{Pi-WiringPi-NAV}} == Introduction == These functions are not part of the core wiringPi set, but act specifically on the Raspberry Pi hardware itself. Some external hardwar... »)
(diff) ← Version précédente | Voir la version actuelle (diff) | Version suivante → (diff)
Sauter à la navigation Sauter à la recherche


MCHobby investit du temps et de l'argent dans la réalisation de traduction et/ou documentation. C'est un travail long et fastidieux réalisé dans l'esprit Open-Source... donc gratuit et librement accessible.
SI vous aimez nos traductions et documentations ALORS aidez nous à en produire plus en achetant vos produits chez MCHobby.

Introduction

These functions are not part of the core wiringPi set, but act specifically on the Raspberry Pi hardware itself. Some external hardware driver modules may provide some of this functionality though.

Les fonctions

digitalWriteByte(int value)

void digitalWriteByte (int value) ;

This writes the 8-bit byte supplied to the first 8 GPIO pins. It’s the fastest way to set all 8 bits at once to a particular value, although it still takes two write operations to the Pi’s GPIO hardware.

pwmSetMode(int mode)

pwmSetMode (int mode) ;

The PWM generator can run in 2 modes – “balanced” and “mark:space”. The mark:space mode is traditional, however the default mode in the Pi is “balanced”. You can switch modes by supplying the parameter: PWM_MODE_BAL or PWM_MODE_MS.

pwmSetRange(unsigned int range)

pwmSetRange(unsigned int range);

This sets the range register in the PWM generator. The default is 1024.

pwmSetClock (int divisor)

pwmSetClock (int divisor) ;

This sets the divisor for the PWM clock.

Note: The PWM control functions can not be used when in Sys mode. To understand more about the PWM system, you’ll need to read the Broadcom ARM peripherals manual.

piBoardRev(void)

piBoardRev(void);

This returns the board revision of the Raspberry Pi. It will be either 1 or 2. Some of the BCM_GPIO pins changed number and function when moving from board revision 1 to 2, so if you are using BCM_GPIO pin numbers, then you need to be aware of the differences.

wpiPinToGpio(int wPiPin)

wpiPinToGpio(int wPiPin);

This returns the BCM_GPIO pin number of the supplied wiringPi pin. It takes the board revision into account.

physPinToGpio(int physPin)

physPinToGpio(int physPin);

This returns the BCM_GPIO pin number of the supplied physical pin on the P1 connector.

setPadDrive(int group, int value)

setPadDrive(int group, int value);

This sets the “strength” of the pad drivers for a particular group of pins. There are 3 groups of pins and the drive strength is from 0 to 7. Do not use this unless you know what you are doing.


Source: WiringPi.com. WiringPi est une libraire sous licence GPL écrite par Gordon Henderson. Crédit: wiringpi.com

Traduit de l'anglais par Meurisse D. pour MCHobby.be

Traduit avec l'accord de Gordon Henderson, créateur de wiringPi - Translated with authorization of Gordon Henderson, creator of wiringPi

Toute référence, mention ou extrait de cette traduction doit être explicitement accompagné du texte suivant : «  Traduction par MCHobby (www.MCHobby.be) - Vente de kit et composants » avec un lien vers la source (donc cette page) et ce quelque soit le média utilisé.

L'utilisation commercial de la traduction (texte) et/ou réalisation, même partielle, pourrait être soumis à redevance. Dans tous les cas de figures, vous devez également obtenir l'accord du(des) détenteur initial des droits. Celui de MC Hobby s'arrêtant au travail de traduction proprement dit.