changed I2C to run directly from IRC
This commit is contained in:
parent
bef51163ce
commit
251687fe37
@ -31,21 +31,20 @@ void i2c0_init(void)
|
|||||||
/* enable input on SCL and SDA pins */
|
/* enable input on SCL and SDA pins */
|
||||||
SCU_SFSI2C0 = SCU_I2C0_NOMINAL;
|
SCU_SFSI2C0 = SCU_I2C0_NOMINAL;
|
||||||
|
|
||||||
/* use PLL1 as clock source for APB1 (including I2C0) */
|
/* use IRC as clock source for APB1 (including I2C0) */
|
||||||
CGU_BASE_APB1_CLK = (CGU_SRC_PLL1 << CGU_BASE_CLK_SEL_SHIFT);
|
CGU_BASE_APB1_CLK = (CGU_SRC_IRC << CGU_BASE_CLK_SEL_SHIFT);
|
||||||
|
|
||||||
/* FIXME assuming we're on IRC at 96 MHz */
|
/* FIXME assuming we're on IRC at 12 MHz */
|
||||||
|
|
||||||
/* 400 kHz I2C */
|
/* 400 kHz I2C */
|
||||||
/*
|
I2C0_SCLH = 15;
|
||||||
I2C0_SCLH = 120;
|
I2C0_SCLL = 15;
|
||||||
I2C0_SCLL = 120;
|
|
||||||
*/
|
|
||||||
|
|
||||||
/* 100 kHz I2C */
|
/* 100 kHz I2C */
|
||||||
I2C0_SCLH = 480;
|
/*
|
||||||
I2C0_SCLL = 480;
|
I2C0_SCLH = 60;
|
||||||
/* FIXME not sure why this appears to run at about 290 kHz */
|
I2C0_SCLL = 60;
|
||||||
|
*/
|
||||||
|
|
||||||
/* clear the control bits */
|
/* clear the control bits */
|
||||||
I2C0_CONCLR = (I2C_CONCLR_AAC | I2C_CONCLR_SIC
|
I2C0_CONCLR = (I2C_CONCLR_AAC | I2C_CONCLR_SIC
|
||||||
|
Loading…
x
Reference in New Issue
Block a user