diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2009-03-31 22:30:36 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2009-03-31 22:30:36 +0000 |
commit | a27ca5617f144527b883cbf7e6f15d2dd7aafe2a (patch) | |
tree | 6b586865ba02e4c523e0106e7883c350874b50d3 /nuttx/include | |
parent | 982a18915c775552ff91cff781e8e377c93436f2 (diff) | |
download | px4-nuttx-a27ca5617f144527b883cbf7e6f15d2dd7aafe2a.tar.gz px4-nuttx-a27ca5617f144527b883cbf7e6f15d2dd7aafe2a.tar.bz2 px4-nuttx-a27ca5617f144527b883cbf7e6f15d2dd7aafe2a.zip |
Add macro to make it clear we expect 7-bit addresses
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@1675 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/include')
-rw-r--r-- | nuttx/include/nuttx/i2c.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/nuttx/include/nuttx/i2c.h b/nuttx/include/nuttx/i2c.h index 7b7b1772c..96c3bf735 100644 --- a/nuttx/include/nuttx/i2c.h +++ b/nuttx/include/nuttx/i2c.h @@ -47,6 +47,11 @@ * Definitions ****************************************************************************/ +/* I2C address calculation. Convert 7-bit address to 8-bit read/write address */ + +#define I2C_READADDR(a) (((a) << 1) | 1) +#define I2C_WRITEADDR(a) ((a) << 1) + /* Access macros */ /**************************************************************************** |