This is the mail archive of the
ecos-patches@sourceware.org
mailing list for the eCos project.
[Bug 1000763] I2C Driver for at91sam7x
- From: bugzilla-daemon at ecoscentric dot com
- To: ecos-patches at ecos dot sourceware dot org
- Date: Tue, 19 May 2009 13:00:33 +0100
- Subject: [Bug 1000763] I2C Driver for at91sam7x
- References: <bug-1000763-104@http.bugs.ecos.sourceware.org/>
http://bugs.ecos.sourceware.org/show_bug.cgi?id=1000763
--- Comment #8 from vibi <vibi_sreenivasan@cms.com> 2009-05-19 13:00:30 ---
hi,
Lot of thanks for going through this code & giving suggestions.
(In reply to comment #7)
> The code looks better. Thanks for the changes. I have a few more minor
> requests/questions.
>
> // enable multi-drain
> HAL_WRITE_UINT32((AT91_PIOA + AT91_PIO_MDER),(AT91_PIO_PSR_TWD
> |AT91_PIO_PSR_TWCK));
> To make the code more portable to other AT91 platforms, it would be better to
> add a HAL_ARM_AT91_GPIO_MULTIDRAIN(__pin__, __enable__) to var_io.h following
> the HAL_ARM_AT91_GPIO_CFG_PULLUP macro.
Added & i have send that as separate patch.
> HAL_ARM_AT91_GPIO_CFG_PULLUP() takes an AT91_PIN macro, not AT91_PIO_PSR_*
> macro.
changed to
HAL_ARM_AT91_GPIO_CFG_PULLUP(AT91_TWI_TWD,AT91_PIN_PULLUP_DISABLE);
HAL_ARM_AT91_GPIO_CFG_PULLUP(AT91_TWI_TWCK,AT91_PIN_PULLUP_DISABLE);
>
> These macros are important when the pin is actually on PIOB.
>
> As you suggested, breaking up the for loop for waiting for completion would be
> nice. I find the following much more readable (note: Untested):
>
> for (success = COUNT_DOWN, success, success--) {
> IC2_R32(AT91_TWI_SR,stat_reg);
> if (stat_req & sr_mask)
> break;
> }
> // error condition ,ie count down ended before txr complete flag is set
> // return how much data was transferred
> if (!success)
> break;
>
Changed accordingly
>
> Before commiting to anoncvs your cyg_i2c_at91_fram_dev needs removing from both
> the .c and .h file.
>
:) that was for testing..REMOVED
> Apart from these comments the code looks good.
>
Thanks again for spending your valuable time on helping me.
Thanks & Regards
vibi sreenivasan
--
Configure bugmail: http://bugs.ecos.sourceware.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.