From deab20592d0217271cc9f8d1982416e8e0618369 Mon Sep 17 00:00:00 2001 From: orvik Date: Tue, 2 Dec 2025 11:01:11 +0100 Subject: [PATCH] Ajouter driver I2C --- Pilotes/Source/I2C.c | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 Pilotes/Source/I2C.c diff --git a/Pilotes/Source/I2C.c b/Pilotes/Source/I2C.c new file mode 100644 index 0000000..3e28fea --- /dev/null +++ b/Pilotes/Source/I2C.c @@ -0,0 +1,9 @@ +#include +#include "I2C.h" + +void initI2C(){ + RCC -> APB1ENR |= 0x1 << 21; // Enable clock + I2C1 -> CR1 |= 0x1 << 0; // Peripheral enable + I2C1 -> CR1 &= ~(0x1 << 1); // I2C mode + +} \ No newline at end of file