47 i2c_init(I2C_SDA_PORT, I2C_SDA_PIN, I2C_SCL_PORT, I2C_SCL_PIN, I2C_SCL_NORMAL_BUS_SPEED);
62 temp = (buf[0] << 4) + (buf[1] >> 4);
68 return I2C_MASTER_ERR_NONE;
void i2c_init(uint8_t port_sda, uint8_t pin_sda, uint8_t port_scl, uint8_t pin_scl, uint32_t bus_speed)
Initialize the I2C peripheral and pins.
uint8_t i2c_master_error(void)
Return the status register if error occurred during last communication.
uint8_t i2c_burst_receive(uint8_t slave_addr, uint8_t *data, uint8_t len)
Perform all operations to receive multiple bytes from a slave.
uint8_t i2c_single_send(uint8_t slave_addr, uint8_t data)
Perform all operations to send a byte to a slave.
#define TMP102_ADDR
TMP102 slave address.
uint8_t tmp102_read(uint16_t *data)
Get a temperature reading from the TMP102 sensor.
#define TMP102_TEMP
TMP102 temperature data register.
void tmp102_init(void)
Initialiser for the TMP102 sensor driver.
Header file for the TMP102 Sensor Driver.