public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
* [ECOS] adding a new i2c device
@ 2005-06-15  3:19 clifford.joseph
  2005-06-15  8:08 ` [ECOS] " Jani Monoses
  0 siblings, 1 reply; 2+ messages in thread
From: clifford.joseph @ 2005-06-15  3:19 UTC (permalink / raw)
  To: ecos-discuss

Hi

I am trying to implement an i2c transfer.

I have successfully added the hardware package CYGPKG_IO_I2C to my configuration file. (.ecc)

Iam working on the eb40a evaluation board which has already an i2c device at24c512 eeprom. 

I am using  arm-elf-gcc version 3.2.1

As described I have added this in my plf_io.h

#define HAL_I2C_EXPORTED_DEVICES                    	          \
    extern cyg_i2c_bus                  cyg_i2c_xyzzy_bus;        \
    extern cyg_i2c_device               cyg_i2c_wallclock_ds1307; \
    extern cyg_i2c_device               cyg_i2c_eeprom;

and in my main.cpp file I have implemented the following function

static cyg_bool
hal_alaia_i2c_bitbang(cyg_i2c_bus* bus, cyg_i2c_bitbang_op op)
{
    cyg_bool result    = 0;
    
    switch(op) 
    {

        case CYG_I2C_BITBANG_INIT:
           {
            }
        case CYG_I2C_BITBANG_SCL_HIGH:
            {
            }
…..
…..
….
…..
.
    }
    return result;
}



I am creating a device by using the Macro

CYG_I2C_DEVICE(cyg_i2c_eeprom, cyg_i2c_xyzzy_bus, 0xA0, 0x00,CYG_I2C_DEFAULT_DELAY);

Am I doing it the way it should be done because I get a compile error 

parse error before `.' token 

at the line wherever I call this macros.



thank you
clifford









--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [ECOS]  Re: adding a new i2c device
  2005-06-15  3:19 [ECOS] adding a new i2c device clifford.joseph
@ 2005-06-15  8:08 ` Jani Monoses
  0 siblings, 0 replies; 2+ messages in thread
From: Jani Monoses @ 2005-06-15  8:08 UTC (permalink / raw)
  To: ecos-discuss

>     extern cyg_i2c_bus                  cyg_i2c_xyzzy_bus;        \
...
> I am creating a device by using the Macro
> 
> CYG_I2C_DEVICE(cyg_i2c_eeprom, cyg_i2c_xyzzy_bus, 0xA0, 0x00,CYG_I2C_DEFAULT_DELAY);

The above macro takes a pointer to cyg_i2c_bus. Try this:
CYG_I2C_DEVICE(cyg_i2c_eeprom, &cyg_i2c_xyzzy_bus, 0xA0, 0x00,CYG_I2C_DEFAULT_DELAY);

Jani


-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2005-06-15  8:08 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-06-15  3:19 [ECOS] adding a new i2c device clifford.joseph
2005-06-15  8:08 ` [ECOS] " Jani Monoses

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).