//This file is an interface for I2C communication between MSPM0G3507 (Controller) and MSPM0L1304 (Target) #ifndef MCU_SLAVE_INTERACE_H_ #include #include "ti/driverlib/dl_i2c.h" #include "ti_msp_dl_config.h" // Handles I2C command coming into Target MCU: typedef enum{ CMD_SET_CURRENT= 0x05, CMD_GET_MEASUREMENT= 0x06, CMD_GET_BATTERY_STATE= 0x07, CMD_SET_HOV_CLEAR= 0x08 }mcu_I2C_command; //Command structures: typedef struct{ uint8_t slot_id; int16_t current; }SetChargeDischargeCurrent; typedef struct __attribute__((packed)){ uint16_t voltage; int16_t current; uint16_t temperature; }BatteryMeasurementData; void mcu_i2c_handle(I2C_Regs *i2c); #endif