RPiPico-Holonome2023/i2c_maitre.h

16 lines
597 B
C
Raw Permalink Normal View History

#include "pico/stdlib.h"
#include "hardware/i2c.h"
2022-12-22 21:35:49 +00:00
enum i2c_resultat_t {
I2C_EN_COURS,
I2C_SUCCES,
I2C_ECHEC
};
2022-12-22 21:35:49 +00:00
void i2c_maitre_init(void);
void i2c_gestion(i2c_inst_t *i2c);
enum i2c_resultat_t i2c_lire_registre_nb(uint8_t adresse_7_bits, uint8_t registre, uint8_t * reception, uint8_t len);
enum i2c_resultat_t i2c_ecrire_registre_nb(uint8_t adresse_7_bits, uint8_t registre, uint8_t * _emission, uint8_t len);
2022-12-22 21:35:49 +00:00
int i2c_ecrire_registre(char adresse_7_bits, char registre, char valeur_registre);
int i2c_lire_registre(char adresse_7_bits, char registre, char * reception, char len);