Atmel website | ARM Community | AVR freaks | Technical Support
Banner
 FAQ •  Search •  Register •  Login 

All times are UTC + 1 hour [ DST ]




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: Communication example for I2C Bus
PostPosted: Wed Feb 29, 2012 4:32 pm 
Offline

Joined: Wed Feb 29, 2012 3:50 pm
Posts: 1
I built an interface for I2C bus, but I haven’t enough experience with communication protocol for this bus.
I am looking for a kind soul who can help me showing a communication example (read-write) using bus i2c for AT91SAM9260.
I am using device i2c-0 on original kernel.
Thanks in advance to anyone who can help me!
Mario


Top
 Profile  
 
 Post subject: Re: Communication example for I2C Bus
PostPosted: Wed Feb 29, 2012 10:47 pm 
Offline

Joined: Mon Feb 20, 2012 12:55 pm
Posts: 8
You can start by learning simple i2c client has already been implemented in the kernel, for example i2c DAC - http://lxr.free-electrons.com/source/dr ... 17.c?a=arm.
Main steps:
1. Define i2c_driver structure, which maps client ID to the probe and remove functions.
2. In the init module routine call function i2c_add_driver with filled structure i2c_driver.
3. If a client with given ID will be found on the bus, your probe function will be called and you will receive filled structure i2c_client.
4. If the previous steps will be sucessfully completed you can use i2c_master_send and i2c_master_recv on i2c_client to send/retrieve data.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: