Ajouter driver I2C
This commit is contained in:
parent
39389d6bd5
commit
deab20592d
1 changed files with 9 additions and 0 deletions
9
Pilotes/Source/I2C.c
Normal file
9
Pilotes/Source/I2C.c
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
#include <stm32f10x.h>
|
||||
#include "I2C.h"
|
||||
|
||||
void initI2C(){
|
||||
RCC -> APB1ENR |= 0x1 << 21; // Enable clock
|
||||
I2C1 -> CR1 |= 0x1 << 0; // Peripheral enable
|
||||
I2C1 -> CR1 &= ~(0x1 << 1); // I2C mode
|
||||
|
||||
}
|
||||
Loading…
Reference in a new issue