MSPM0_ValvanoWare  1.0
ECE445L starter code
Functions
I2C.h File Reference

Software driver functions for I2C and MKII boosterpack. More...

Go to the source code of this file.

Functions

void I2C_Init (void)
 Initialize I2C. More...
 
uint8_t I2C_Recv1 (int8_t slave)
 Receive one byte. More...
 
uint16_t I2C_Recv2 (int8_t slave)
 Receive two bytes. More...
 
int I2C_Send (uint8_t slave, uint8_t *pData, uint32_t count)
 write 1 to 8 bytes to I2C. More...
 
int I2C_SendData (uint8_t slave, uint8_t *pData, uint32_t count)
 send large buffer to I2C. More...
 
int I2C_Send1 (int8_t slave, uint8_t data)
 Send one byte. More...
 
int I2C_Send2 (int8_t slave, uint8_t data1, uint8_t data2)
 Send two bytes. More...
 
int I2C_Send3 (int8_t slave, uint8_t data1, uint8_t data2, uint8_t data3)
 Send three bytes. More...
 
void I2C_LightSensor_Init (void)
 Initialize OPT3001. More...
 
uint32_t I2C_LightSensor_Input (void)
 Input from OPT3001. More...
 
void I2C_LightSensor_Start (void)
 Start OPT3001. More...
 
int I2C_LightSensor_End (uint32_t *light)
 Finish OPT3001. More...
 
void I2C_TempSensor_Init (void)
 Initialize TMP006. More...
 
void I2C_TempSensor_Input (int32_t *sensorV, int32_t *localT)
 Input from TMP006. More...
 
void I2C_TempSensor_Start (void)
 Start TMP006. More...
 
int I2C_TempSensor_End (int32_t *sensorV, int32_t *localT)
 Finish TMP006. More...
 

Detailed Description

Software driver functions for I2C and MKII boosterpack.

Light and temperature sensors on MKII
https://www.ti.com/tool/BOOSTXL-EDUMKII
The TMP006 was discontinued in 2017. Therefore, it is no longer populated on the board. Documentation of the TMP006 is unchanged in this user's guide to accommodate users who still have the device populated on the board

Version
ECE319K v1.0
Author
Daniel Valvano and Jonathan Valvano
Warning
AS-IS
Note
For more information see http://users.ece.utexas.edu/~valvano/
Date
June 8, 2024
MKII sensor pins
Pin FunctionDescription
PA27GPIO J1.8 ambient light (OPT3001) interrupt (digital)
PB2 I2C1-SCLJ1.9 ambient light (OPT3001) and temperature sensor (TMP006)
PB3 I2C1-SDAJ1.10 ambient light (OPT3001) and temperature sensor (TMP006)
PB16GPIO J2.11 temperature sensor (TMP006) interrupt (digital)
SSD1306 pins
Pin FunctionDescription
VCC Power +3.3V
PB2 I2C1-SCLJ1.9 SSD1306 SCL, with 1.5k pullup to 3.3V
PB3 I2C1-SDAJ1.10 SSD1306 SDA
GND GND Ground