[Bug 1001397] I2C driver for Kinetis microcontrollers

[email protected]
Newsgroups gmane.os.ecos.patches
Message-ID <[email protected]/>
Please do not reply to this email, use the link below.

http://bugs.ecos.sourceware.org/show_bug.cgi?id=1001397

Ilija Kocho <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Attachment #2183|0                           |1
        is obsolete|                            |
   Attachment #2185|0                           |1
        is obsolete|                            |

--- Comment #54 from Ilija Kocho <[email protected]> ---
Created attachment 2188
  --> http://bugs.ecos.sourceware.org/attachment.cgi?id=2188&action=edit
I2C driver 130420

Mike

Summing up our discussion here I attach the driver with following updates:

    - Aggressive clocking is implemented and configurable by:
       - CDL (for default setting)
       - Macro FREESCALE_I2C_DELAY_CFG(delay, fit, agr) - for individual
devices

    - SMB has been removed for the time being

Examples for FREESCALE_I2C_DELAY_CFG:

Following device will look aggressively for 200kHz (5000 [ns])

CYG_I2C_DEVICE(i2c_dev,
               &cyg_i2c0_bus,
               0x4cu,
               0,
               FREESCALE_I2C_DELAY_CFG(5000, 0, 1)
);

Following device will look conservatively for 100kHz (10000 [ns])

CYG_I2C_DEVICE(i2c_dev,
               &cyg_i2c0_bus,
               0x4cu,
               0,
               FREESCALE_I2C_DELAY_CFG(10000, 0, 0)
);

Which is equivalent to:

CYG_I2C_DEVICE(i2c_dev,
               &cyg_i2c0_bus,
               0x4cu,
               0,
               10000
);

(In reply to comment #52)

> > I would like to test default clock speed, meaning the frequency in the CDL.
> > How do I write code that uses the default rather than .i2c_delay. Yes, I am
> > being lazy and not digging into the code.

I took care of this
Now if you enter 0 for delay, the device shall use default value.

Example:

Following device will look conservatively for 100kHz (10000 [ns])

CYG_I2C_DEVICE(i2c_dev,
               &cyg_i2c0_bus,
               0x4cu,
               0,
               0
);

Please test this and if you are happy I think I could commit.

Ilija

-- 
You are receiving this mail because:
You are on the CC list for the bug.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.