hi!
is nxp rt1176 suport i2c 10bit address ?
I need to read 2 byte register and read 2 byte value
its dosnt work please help to find out
my code is below
void BOARD_LPI2C_Init(LPI2C_Type *base, uint32_t clkSrc_Hz)
{
lpi2c_master_config_t lpi2cConfig = {0};
LPI2C_MasterGetDefaultConfig(&lpi2cConfig);
lpi2cConfig.debugEnable = false;
lpi2cConfig.ignoreAck = false;
lpi2cConfig.pinConfig = kLPI2C_2PinOpenDrain;
lpi2cConfig.baudRate_Hz = 1000000U;
lpi2cConfig.busIdleTimeout_ns = 0;
lpi2cConfig.pinLowTimeout_ns = 0;
lpi2cConfig.sdaGlitchFilterWidth_ns = 0;
lpi2cConfig.sclGlitchFilterWidth_ns = 0;
LPI2C_MasterInit(base, &lpi2cConfig, clkSrc_Hz);
}
status_t BOARD_LPI2C_Send(LPI2C_Type *base,
uint8_t deviceAddress,
uint32_t subAddress,
uint8_t subAddressSize,
uint8_t *txBuff,
uint8_t txBuffSize)
{
lpi2c_master_transfer_t xfer;
xfer.flags = kLPI2C_TransferDefaultFlag;
xfer.slaveAddress = deviceAddress;
xfer.direction = kLPI2C_Write;
xfer.subaddress = subAddress;
xfer.subaddressSize = subAddressSize;
xfer.data = txBuff;
xfer.dataSize = txBuffSize;
return LPI2C_MasterTransferBlocking(base, &xfer);
}
status_t BOARD_LPI2C_Receive(LPI2C_Type *base,
uint8_t deviceAddress,
uint32_t subAddress,
uint8_t subAddressSize,
uint8_t *rxBuff,
uint8_t rxBuffSize)
{
lpi2c_master_transfer_t xfer;
xfer.flags = kLPI2C_TransferDefaultFlag;
xfer.slaveAddress = deviceAddress;
xfer.direction = kLPI2C_Read;
xfer.subaddress = subAddress;
xfer.subaddressSize = subAddressSize;
xfer.data = rxBuff;
xfer.dataSize = rxBuffSize;
return LPI2C_MasterTransferBlocking(base, &xfer);
}
hi!
Thanks can you show code example ? what register to config to support 10 bit i dont find it in SDK LPI2C config structure.
Regards
We don't have examples for 10-bit addressing.
Please see this link which explains how the 10 bits address is used. Also, the I2C used as master do not need a register configuration to work with 10 bits address.
Best Regards, Miguel.
The LPI2C module supports 7-bit and 10-bit addressing. See chapter 69.2.2 Features from the RT1170 reference manual.
Best Regards, Miguel.
hi!
Thanks can you show code example ? what register to config to support 10 bit i dont find it in SDK LPI2C config structure.
Regards