Ligne 172 : |
Ligne 172 : |
| {{traduction}} | | {{traduction}} |
| | | |
− | The following methods implement the standard I2C master read and write operations that target a given slave device.
| + | Les méthodes suivantes implémente les opérations standard du Maître (Leader) du bus I2C. Cela concerne les opération de lecture (''read'') et d'écriture (''write'') à destination d'un périphérique Esclave (Suiveur). |
| | | |
| ==== I2C.readfrom(...) ==== | | ==== I2C.readfrom(...) ==== |
| i2c.readfrom(addr, nbytes, stop=True) | | i2c.readfrom(addr, nbytes, stop=True) |
| | | |
− | Read {{fname|nbytes}} from the slave specified by {{fname|addr}}. If {{fname|stop}} is {{fname|True}} then a STOP condition is generated at the end of the transfer.
| + | Lecture de {{fname|nbytes}} octets depuis l'esclave identifié par son adresses {{fname|addr}}. Si le paramètre {{fname|stop}} est {{fname|True}} alors la condition d'arrêt (STOP) est générée à la fin du transfert. |
| | | |
− | Returns a {{fname|bytes}} object with the data read.
| + | Retourne un objet {{fname|bytes}} avec les données lue sur le bus. |
| | | |
| * '''addr''' est l'adresse du périphérique I2C. | | * '''addr''' est l'adresse du périphérique I2C. |
− | * '''nbytes''' xxx . | + | * '''nbytes''' le nombre d'octets à lire. |
− | * '''stop''' xxx . | + | * '''stop''' placer une condition d'arrêt en fin de transation. |
| | | |
| ==== I2C.readfrom_into(...) ==== | | ==== I2C.readfrom_into(...) ==== |
| i2c.readfrom_into(addr, buf, stop=True) | | i2c.readfrom_into(addr, buf, stop=True) |
| | | |
| + | {{translate}} |
| Read into {{fname|buf}} from the slave specified by {{fname|addr}}. The number of bytes read will be the length of buf. | | Read into {{fname|buf}} from the slave specified by {{fname|addr}}. The number of bytes read will be the length of buf. |
| | | |