Hello I managed to send one byte over the ic2 from DA to another host processor using this function :
bool
i2c_slave_send(uint8_t data)
{
if(i2c_slave_read_requested()) {
SetWord16(I2C_DATA_CMD_REG, data);
GetWord16(I2C_CLR_RD_REQ_REG);
return true;
}
return false;
}
Now I want to extend it to be able to send multiple bytes. I did the fallowing :
bool
i2c_slave_send(uint8_t *data, uint8_t len)
{
GLOBAL_INT_DISABLE();
if(i2c_slave_read_requested()) {
SEND_I2C_COMMAND(*data & 0xFF);
GetWord16(I2C_CLR_RD_REQ_REG);
len --;
data++;
}
while(len){
if(i2c_slave_read_requested()) {
SEND_I2C_COMMAND((*data & 0xFF));
GetWord16(I2C_CLR_RD_REQ_REG);
len--;
data++;
}
}
GLOBAL_INT_RESTORE();
if(len == 0){
return true;
}
return false;
}
but This is not working at all, I can not find what other registers I should clear or use ?
Could you please help me ?

In My System, DA14580 act as the Slave Devic, I want Send data to it and can Read Dataform it too. In I2C Protocal, for Examle I want set Da1480's REG , I send (Addr+Write)+RegAddr+Data1+Data2 to Da14580, But where I can read the Data in DA14580?
嗨HeYQ yassin.bennceur,
Sorry, but I2C in slave mode, although supported by the hardware, isn't widely used, so there is no support from dialog in the SDK about this kind of mode.
Thanks MT_dialog
Okay, on seeing this and after today's entire day trying to get the SDK (or should I say, demo kit) working... I've just hit my limit for what's acceptable from a vendor.
You are not getting into my product. Not supporting something as simple and useful as an I2C slave-mode device because you don't feel like it is pretty ******. Having a website that makes finding your SDK impossible without watching the "intro video" which doesn't even show how to use your software is ******. As a developer, I'm just going to go to Nordic or someone else who has their product together.
Thanks for our feedback. I've sent you a message to your registered email . BR JE_Dialog
Did you found any solution yet?
I'm having the same problem and they gave me the same idiotic answer (we are not supporting ...)
Usually I2C slave should be interrupt driven due asynchronous requests. I successfully implemented I2C slave device in my design and everything is working as expected.
It's not clear what's doing function "i2c_slave_read_requested()" in your source.
Can you send some data or function or even something to start with?
Because I did try and it's not that easy and I really don't think that developers should deal with that. All of other manufacturer are doing it!!