On Thu, Feb 18, 2010 at 04:56:26PM +0100, Thomas Otto wrote:
> I've created an header file for the I2C sub-system.
> Find it attached.
Thanks a lot, committed with some minor changes, see below.
> /* Bit [7:6] Reserved */
Replaced these with a longer version which states that the bits are
forced to 0 by hardware.
> #define I2C_CR2_FREQ_2MHZ (0x2)
> #define I2C_CR2_FREQ_3MHZ (0x3)
Dropped the parenthesis here, not needed.
> /* PEC Error in Reception */
> #define I2C_SR1_PECERROR (1 << 12)
Changed "PECERROR" to "PECERR" here to match the datasheet name.
Also, I prefixed all bit comments with the bit name as per datasheet,
I'm trying to enforce that on the whole code-base consistently (some of
the existing files still need to be fixed, will do soonish).
Example:
/* Fast mode duty cycle */
#define I2C_CCR_DUTY (1 << 14)
becomes:
/* DUTY: Fast mode duty cycle */
#define I2C_CCR_DUTY (1 << 14)
Cheers, Uwe.
--
http://www.hermann-uwe.de | http://www.randomprojects.org
http://www.crazy-hacks.org | http://www.unmaintained-free-software.org
|