Pulled from ersky9x

This commit is contained in:
bsongis
2014-06-24 11:14:40 +02:00
parent 751027b4ad
commit 7434c28820
+4 -2
View File
@@ -475,11 +475,13 @@ void opentxBootloader();
// Need PA3 and PA4 set to peripheral A // Need PA3 and PA4 set to peripheral A
void i2cInit() void i2cInit()
{ {
register Pio *pioptr ; register Pio *pioptr;
register uint32_t timing ; register uint32_t timing;
PMC->PMC_PCER0 |= 0x00080000L ; // Enable peripheral clock to TWI0 PMC->PMC_PCER0 |= 0x00080000L ; // Enable peripheral clock to TWI0
TWI0->TWI_CR = TWI_CR_SWRST ; // Reset in case we are restarting
/* Configure PIO */ /* Configure PIO */
pioptr = PIOA ; pioptr = PIOA ;
pioptr->PIO_ABCDSR[0] &= ~0x00000018 ; // Peripheral A pioptr->PIO_ABCDSR[0] &= ~0x00000018 ; // Peripheral A