Increase smbus frequency to 400KHz

This commit is contained in:
Jeremy Soller 2019-11-05 14:32:06 -07:00
parent de1f553e19
commit aee44bbce0
No known key found for this signature in database
GPG Key ID: E988B49EE78A7FB1
2 changed files with 6 additions and 6 deletions

View File

@ -9,8 +9,8 @@ uint8_t smbus_read(uint8_t address, uint8_t command, uint16_t * data) {
// Clear result
HOSTAA = HOSTAA;
// Clock down to 50 KHz
SCLKTSA = 1;
// Clock to 400 KHz
SCLKTSA = 3;
// Enable host interface
HOCTL2A = 1 << 0;
@ -54,8 +54,8 @@ uint8_t smbus_write(uint8_t address, uint8_t command, uint16_t data) {
// Clear result
HOSTAA = HOSTAA;
// Clock down to 50 KHz
SCLKTSA = 1;
// Clock to 400 KHz
SCLKTSA = 3;
// Enable host interface
HOCTL2A = 1 << 0;

View File

@ -10,8 +10,8 @@ void i2c_write(unsigned char value) {
// Clear result
HOSTAA = HOSTAA;
// Clock down to 50 KHz
SCLKTSA = 1;
// Clock to 400 KHz
SCLKTSA = 3;
// Enable host interface with i2c compatibility
HOCTL2A = (1 << 1) | (1 << 0);