


So, ...
Who, or where i can read if OEM or Compatible chip are blocked
I have next function:
bool read_TI046B1_register(uint16_t TenBits_slave_address, uint8_t * registerBuffer, int registerSize, uint8_t * destinationBuffer, uint16_t readSize, bool stopCom)
{
uint16_t slave_address_LSB = TenBits_slave_address & 0x0FF; //0076543210 //8 LSB
uint16_t slave_address_MSB = TenBits_slave_address & 0x300; //9800000000 //2 MSB
//Put the MSB bits to the Left :
slave_address_MSB = slave_address_MSB >> 8; //For example, 0x300 becomes 0x003
//7 bits address equivalent for the begining :
uint8_t SevenBits_compat_address = 0x78 | slave_address_MSB; //TWI library will put send those 7 bits followed by read/write bit.
//Preparation of the write buffer : 8LSB of the slave's address, then 3 bytes writes to call a register read.
uint8_t txBuffer[registerSize + 1];
for(uint8_t i = 0; i < sizeof(txBuffer); i++)
{
if(i==0)
{
txBuffer[i] = slave_address_LSB;
}
else
{
txBuffer[i] = registerBuffer[i-1];
}
}
uint16_t nRet = twi_writeTo(SevenBits_compat_address, txBuffer, sizeof(txBuffer), 1, stopCom);
if (nRet == 1)
{
Serial.println("W1");
return;
}
else if (nRet == 2)
{
Serial.println("W2");
return;
}
else if (nRet == 3)
{
Serial.println("W3");
return;
}
else if (nRet == 4)
{
Serial.println("W4");
return;
}
nRet = twi_readFrom(SevenBits_compat_address, destinationBuffer, readSize, true); //xxx bytes read with a Stop at the end.
if (nRet == 0x00)
{
Serial.println("R1");
return;
}
if (nRet != readSize)
{
Serial.println("R2");
return;
}
if (nRet == readSize)
{
for (uint16_t i=0; i<readSize; i++)
{
//Serial.print("0x");
if (destinationBuffer[i] < 0x10)
{
Serial.print(0, HEX);
Serial.print(destinationBuffer[i], HEX);
}
else
{
Serial.print(destinationBuffer[i], HEX);
}
if(i != readSize) Serial.print(" ");
}
Serial.println("");
return true;
}
}