Jeremy Soller 6d7f2807d5
Add lemp9
2020-01-09 20:16:05 -07:00

25 lines
509 B
C

#include <board/smbus.h>
#include <ec/i2c.h>
void smbus_init(void) {
// 9.2 MHz * 4.7 us = 43.24
SMB4P7USL = 43;
// 9.2 MHz * 4.0 us = 36.8
SMB4P0USL = 37;
// 9.2 MHz * 300 ns = 2.76
SMB300NS = 3;
// 9.2 MHz * 250 ns = 2.3
SMB250NS = 2;
// 1.024 KHz * 25 ms = 25.6
SMB25MS = 26;
// 9.2 MHz * 45.3 us = 416.76 (0x01A1)
SMB45P3USL = 0xA1;
SMB45P3USH = 0x01;
// Clock set to 50 KHz
// SCLKTSA = 1;
// Set up for i2c usage
i2c_reset(true);
}