Skip to content

Commit

Permalink
add higher I2C freqs for 160MHz core clock
Browse files Browse the repository at this point in the history
  • Loading branch information
John Doe authored and John Doe committed May 30, 2015
1 parent a194024 commit c66919e
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions hardware/esp8266com/esp8266/cores/esp8266/core_esp8266_si2c.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,16 @@ void twi_setClock(unsigned int freq){
if(freq <= 100000) twi_dcount = 19;//about 100KHz
else if(freq <= 200000) twi_dcount = 8;//about 200KHz
else if(freq <= 300000) twi_dcount = 3;//about 300KHz
else if(freq <= 400000) twi_dcount = 1;//about 370KHz
else twi_dcount = 1;//about 450KHz
else if(freq <= 400000) twi_dcount = 1;//about 400KHz
else twi_dcount = 1;//about 400KHz
#else
if(freq <= 100000) twi_dcount = 32;//about 100KHz
else if(freq <= 200000) twi_dcount = 14;//about 200KHz
else if(freq <= 300000) twi_dcount = 8;//about 300KHz
else if(freq <= 400000) twi_dcount = 5;//about 370KHz
else twi_dcount = 2;//about 450KHz
else if(freq <= 400000) twi_dcount = 5;//about 400KHz
else if(freq <= 500000) twi_dcount = 3;//about 500KHz
else if(freq <= 600000) twi_dcount = 2;//about 600KHz
else twi_dcount = 1;//about 700KHz
#endif
}

Expand Down

0 comments on commit c66919e

Please sign in to comment.