I am developing a small project on the Curiosity LPC Board:
https://www.microchip.com/DevelopmentTools/ProductDetails/PartNO/DM164137
I add a MCP9808 temperature sensor to my code through MPLAB Code Configurator. The code asks me to set the I2C parameters:
- Code: Select all
int8_t MCP9808_MODULE_Initialize(MCP9808_i2c_params i2cParams) {
.
.
.
}
typedef struct _MCP9808_i2c_params {
uint8_t i2cAddress;
uint8_t i2cBusID; // parameter used only by "i2c classic lib"
} MCP9808_i2c_params;
It is what I find from the Board definition:
- Code: Select all
void I2C1_Initialize()
{
SSP1STAT = 0x00;
SSP1CON1 = 0x28;
SSP1CON2 = 0x00;
SSP1ADD = 0x03;
SSP1CON1bits.SSPEN = 0;
}
Can anyone tell me what should be the value of i2cParams?
Thanks for your valuable opinions.