I2c read/write

Hi to all,
i am using extstorage_iic.c for reading /writing on I2C and it is working.
but for that i have to write a command AT+WRITE=0,0 on remote shell and same for reading i have to write a command.

Is there any other way for writing on i2c bus because i have to write a bulk of data.
tell me if there is any API that writes on I2C.
anxiously waiting for reply
thanks in advance

Well of course there is - extstorage_iic.c is an illustration (example) of using that very API! :unamused:

and to perhaps answer an unasked question.
no, there is no way to use I2C via AT-commands unless you write your own program to handle that.

that what i am asking!
Has any1 write his own program to write on 12c instead of using extstorage_iic.c …

Well, I used extstorage_spi.c as the starting-point for my SPI program;

So I’d use extstorage_i2c.c as the starting-point if I were writing an I2C program.

That’s the whole point of having sample programs!

I did write code which interfaced with i2c slave. But it freezes randomly the entire module on reading sequence so I said goodbye to it (and also disappointed in wavecom as Wireless Processor ™) :wink:

i only had problems with certain hardware, with two led-drivers @full speed, i never had any problems

[quote=“blackyblack”]
I did write code which interfaced with i2c slave. But it freezes randomly the entire module on reading sequence so I said goodbye to it (and also disappointed in wavecom as Wireless Processor ™) :wink:

I am writing a code for i2c SLAVE too.
Please send me your code for help.
thanks in advance

But he said it didn’t work - so how will that help?! :laughing:

I have versions for OASIS and OpenAT 4.26. Which one do you need?
Also wavecom does not support I2C slave mode - only master. Did you actually mean that you are interfacing I2C slave?

Where to send the code?

It is realy a problem.

With the sample, the adl_write-Function returns allways -2, ADL_RET_ERR_PARAM but i don’t know why

Edit: removed Code because of bugs

Should that be:

(void*)(buf->Data) );

Or even:

(void*)&(buf->Data) );

:question:

Yes, should be (void*)(buf->Data), but that’s not the Problem here, it’s just a typecast.

after the first “ADL_RET_ERR_PARAM”, it reports no error any more

Output: 0x18W b4A - 0x18W a5A - 0x18W a5A - 0x18W a5A

Where 0x18 the Chip adress (DS2482_CHIP_ADR), 0xb4 the Reset-Cmd (ONE_WIRE_RESET) and 0xa5 the SendData-Cmd(SEND_DATA)

It works now,
have still some errors but it works.

Perhaps it’s a Wavecom-bug

code in a few Minutes

Edit: The code is to specific for the One-Wire-Product i use, you can send me a PM if you’d like to have the code