I2c read/write


#1

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


#2

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


#3

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.


#4

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


#5

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!


#6

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:


#7

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


#8

[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


#9

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


#10

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?


#11

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


#12

Should that be:

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

Or even:

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

:question:


#13

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)


#14

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