diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2011-09-18 17:52:00 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2011-09-18 17:52:00 +0000 |
commit | 0ce69264dbb1841b4093c04302c53ccfab02ca48 (patch) | |
tree | 1c324fbc0ad5b3bcbf28818660c322c026914789 /apps/system/i2c/i2ctool.h | |
parent | fd34c2fa9d9d8faff68f5023e27246ac35954c70 (diff) | |
download | nuttx-0ce69264dbb1841b4093c04302c53ccfab02ca48.tar.gz nuttx-0ce69264dbb1841b4093c04302c53ccfab02ca48.tar.bz2 nuttx-0ce69264dbb1841b4093c04302c53ccfab02ca48.zip |
Add I2C trace capability; Fix another STM32 I2C/FSMC bug; add verify command to the I2C tool
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@3961 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'apps/system/i2c/i2ctool.h')
-rw-r--r-- | apps/system/i2c/i2ctool.h | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/apps/system/i2c/i2ctool.h b/apps/system/i2c/i2ctool.h index 56802ffb2..9726f0083 100644 --- a/apps/system/i2c/i2ctool.h +++ b/apps/system/i2c/i2ctool.h @@ -49,6 +49,8 @@ #include <stdbool.h> #include <errno.h> +#include <nuttx/i2c.h> + /**************************************************************************** * Definitions ****************************************************************************/ @@ -139,7 +141,8 @@ struct i2ctool_s uint8_t bus; /* [-b bus] is the I2C bus number */ uint8_t regaddr; /* [-r regaddr] is the I2C device register address */ uint8_t width; /* [-w width] is the data width (8 or 16) */ - bool start; /* [-s|n], send/don't send start between command and data */ + bool start; /* [-s|n], send|don't send start between command and data */ + bool autoincr; /* [-i|j], Auto increment|don't increment regaddr on repititions */ uint32_t freq; /* [-f freq] I2C frequency */ /* Output streams */ @@ -184,10 +187,18 @@ void i2ctool_flush(FAR struct i2ctool_s *i2ctool); /* Command handlers */ -int cmd_bus(FAR struct i2ctool_s *i2ctool, int argc, FAR char **argv); -int cmd_dev(FAR struct i2ctool_s *i2ctool, int argc, FAR char **argv); -int cmd_get(FAR struct i2ctool_s *i2ctool, int argc, FAR char **argv); -int cmd_set(FAR struct i2ctool_s *i2ctool, int argc, FAR char **argv); +int i2ccmd_bus(FAR struct i2ctool_s *i2ctool, int argc, FAR char **argv); +int i2ccmd_dev(FAR struct i2ctool_s *i2ctool, int argc, FAR char **argv); +int i2ccmd_get(FAR struct i2ctool_s *i2ctool, int argc, FAR char **argv); +int i2ccmd_set(FAR struct i2ctool_s *i2ctool, int argc, FAR char **argv); +int i2ccmd_verf(FAR struct i2ctool_s *i2ctool, int argc, FAR char **argv); + +/* I2C access functions */ + +int i2ctool_get(FAR struct i2ctool_s *i2ctool, FAR struct i2c_dev_s *dev, + uint8_t addr, uint16_t *result); +int i2ctool_set(FAR struct i2ctool_s *i2ctool, FAR struct i2c_dev_s *dev, + uint8_t regaddr, uint16_t value); /* Common logic */ |