diff --git a/Documentation b/Documentation index b7d0b9c21a8..bd05adddce9 160000 --- a/Documentation +++ b/Documentation @@ -1 +1 @@ -Subproject commit b7d0b9c21a8f8990810c2db4ff5dbd1b747e3d03 +Subproject commit bd05adddce9f801523a2b77363a8dddb01c952b3 diff --git a/arch b/arch index ce5362e2daf..5ea918534ae 160000 --- a/arch +++ b/arch @@ -1 +1 @@ -Subproject commit ce5362e2daf21444768b5219eb0eca6fa7929ea1 +Subproject commit 5ea918534aef71cdff40f56081c70de8818cb5bc diff --git a/configs b/configs index 6b24789ace5..c4eea61723a 160000 --- a/configs +++ b/configs @@ -1 +1 @@ -Subproject commit 6b24789ace585ef78778cff3a3c894ad11db6166 +Subproject commit c4eea61723a32ae07781338cd9a80637dec07822 diff --git a/drivers/audio/wm8904.c b/drivers/audio/wm8904.c index a240aa7703e..0742db50723 100644 --- a/drivers/audio/wm8904.c +++ b/drivers/audio/wm8904.c @@ -2464,7 +2464,7 @@ static void wm8904_hw_reset(FAR struct wm8904_dev_s *priv) ****************************************************************************/ FAR struct audio_lowerhalf_s * - wm8904_initialize(FAR struct i2c_dev_s *i2c, FAR struct i2s_dev_s *i2s, + wm8904_initialize(FAR struct i2c_master_s *i2c, FAR struct i2s_dev_s *i2s, FAR const struct wm8904_lower_s *lower) { FAR struct wm8904_dev_s *priv; diff --git a/drivers/audio/wm8904.h b/drivers/audio/wm8904.h index 8aeb5bce635..e51d247c5f3 100644 --- a/drivers/audio/wm8904.h +++ b/drivers/audio/wm8904.h @@ -1067,7 +1067,7 @@ struct wm8904_dev_s /* Our specific driver data goes here */ const FAR struct wm8904_lower_s *lower; /* Pointer to the board lower functions */ - FAR struct i2c_dev_s *i2c; /* I2C driver to use */ + FAR struct i2c_master_s *i2c; /* I2C driver to use */ FAR struct i2s_dev_s *i2s; /* I2S driver to use */ struct dq_queue_s pendq; /* Queue of pending buffers to be sent */ struct dq_queue_s doneq; /* Queue of sent buffers to be returned */ diff --git a/drivers/i2c/i2c_read.c b/drivers/i2c/i2c_read.c index 04052c44478..1d7c16b8cb5 100644 --- a/drivers/i2c/i2c_read.c +++ b/drivers/i2c/i2c_read.c @@ -68,7 +68,8 @@ * ****************************************************************************/ -int i2c_read(FAR struct i2c_dev_s *dev, FAR const struct i2c_config_s *config, +int i2c_read(FAR struct i2c_master_s *dev, + FAR const struct i2c_config_s *config, FAR uint8_t *buffer, int buflen) { struct i2c_msg_s msg; diff --git a/drivers/i2c/i2c_write.c b/drivers/i2c/i2c_write.c index d8eceb610cc..725e150ce48 100644 --- a/drivers/i2c/i2c_write.c +++ b/drivers/i2c/i2c_write.c @@ -68,7 +68,8 @@ * ****************************************************************************/ -int i2c_write(FAR struct i2c_dev_s *dev, FAR const struct i2c_config_s *config, +int i2c_write(FAR struct i2c_master_s *dev, + FAR const struct i2c_config_s *config, FAR const uint8_t *buffer, int buflen) { struct i2c_msg_s msg; diff --git a/drivers/i2c/i2c_writeread.c b/drivers/i2c/i2c_writeread.c index cfb9a127cbf..571fa1b3057 100644 --- a/drivers/i2c/i2c_writeread.c +++ b/drivers/i2c/i2c_writeread.c @@ -69,7 +69,8 @@ * ****************************************************************************/ -int i2c_writeread(FAR struct i2c_dev_s *dev, FAR const struct i2c_config_s *config, +int i2c_writeread(FAR struct i2c_master_s *dev, + FAR const struct i2c_config_s *config, FAR const uint8_t *wbuffer, int wbuflen, FAR uint8_t *rbuffer, int rbuflen) { diff --git a/drivers/input/mxt.c b/drivers/input/mxt.c index 0d89a1abfbf..f5ebec8e89d 100644 --- a/drivers/input/mxt.c +++ b/drivers/input/mxt.c @@ -165,7 +165,7 @@ struct mxt_dev_s * lower half configuration data. */ - FAR struct i2c_dev_s *i2c; + FAR struct i2c_master_s *i2c; FAR const struct mxt_lower_s *lower; /* This is the allocated array of object information */ @@ -1850,7 +1850,7 @@ errout_with_objtab: * ****************************************************************************/ -int mxt_register(FAR struct i2c_dev_s *i2c, +int mxt_register(FAR struct i2c_master_s *i2c, FAR const struct mxt_lower_s * const lower, int minor) { FAR struct mxt_dev_s *priv; diff --git a/drivers/input/stmpe811.h b/drivers/input/stmpe811.h index d96944f4c40..dea9f3a0a86 100644 --- a/drivers/input/stmpe811.h +++ b/drivers/input/stmpe811.h @@ -138,7 +138,7 @@ struct stmpe811_dev_s #ifdef CONFIG_STMPE811_SPI FAR struct spi_dev_s *spi; /* Saved SPI driver instance */ #else - FAR struct i2c_dev_s *i2c; /* Saved I2C driver instance */ + FAR struct i2c_master_s *i2c; /* Saved I2C driver instance */ #endif uint8_t inuse; /* STMPE811 pins in use */ diff --git a/drivers/input/stmpe811_base.c b/drivers/input/stmpe811_base.c index d10462e8fb5..9a9ad6caac0 100644 --- a/drivers/input/stmpe811_base.c +++ b/drivers/input/stmpe811_base.c @@ -287,7 +287,7 @@ static void stmpe811_reset(FAR struct stmpe811_dev_s *priv) STMPE811_HANDLE stmpe811_instantiate(FAR struct spi_dev_s *dev, FAR struct stmpe811_config_s *config) #else -STMPE811_HANDLE stmpe811_instantiate(FAR struct i2c_dev_s *dev, +STMPE811_HANDLE stmpe811_instantiate(FAR struct i2c_master_s *dev, FAR struct stmpe811_config_s *config) #endif { diff --git a/drivers/input/tsc2007.c b/drivers/input/tsc2007.c index 31d17a031a2..9bc56706e7e 100644 --- a/drivers/input/tsc2007.c +++ b/drivers/input/tsc2007.c @@ -165,7 +165,7 @@ struct tsc2007_dev_s sem_t waitsem; /* Used to wait for the availability of data */ FAR struct tsc2007_config_s *config; /* Board configuration data */ - FAR struct i2c_dev_s *i2c; /* Saved I2C driver instance */ + FAR struct i2c_master_s *i2c; /* Saved I2C driver instance */ struct work_s work; /* Supports the interrupt handling "bottom half" */ struct tsc2007_sample_s sample; /* Last sampled touch point data */ @@ -1210,7 +1210,7 @@ errout: * ****************************************************************************/ -int tsc2007_register(FAR struct i2c_dev_s *dev, +int tsc2007_register(FAR struct i2c_master_s *dev, FAR struct tsc2007_config_s *config, int minor) { FAR struct tsc2007_dev_s *priv; diff --git a/drivers/ioexpander/pca9555.c b/drivers/ioexpander/pca9555.c index 91a2f3e2239..f405a4a311d 100644 --- a/drivers/ioexpander/pca9555.c +++ b/drivers/ioexpander/pca9555.c @@ -587,7 +587,7 @@ static int pca9555_interrupt(int irq, FAR void *context) * ****************************************************************************/ -FAR struct ioexpander_dev_s *pca9555_initialize(FAR struct i2c_dev_s *i2cdev, +FAR struct ioexpander_dev_s *pca9555_initialize(FAR struct i2c_master_s *i2cdev, FAR struct pca9555_config_s *config) { FAR struct pca9555_dev_s *pcadev; diff --git a/drivers/ioexpander/pca9555.h b/drivers/ioexpander/pca9555.h index 0eb07101eca..c7d24676744 100644 --- a/drivers/ioexpander/pca9555.h +++ b/drivers/ioexpander/pca9555.h @@ -116,14 +116,14 @@ struct pca9555_dev_s { - struct ioexpander_dev_s dev; /* Nested structure to allow casting as public gpio expander. */ + struct ioexpander_dev_s dev; /* Nested structure to allow casting as public gpio expander. */ #ifdef CONFIG_PCA9555_MULTIPLE - FAR struct pca9555_dev_s * flink; /* Supports a singly linked list of drivers */ + FAR struct pca9555_dev_s *flink; /* Supports a singly linked list of drivers */ #endif FAR struct pca9555_config_s *config; /* Board configuration data */ - FAR struct i2c_dev_s * i2c; /* Saved I2C driver instance */ + FAR struct i2c_master_s *i2c; /* Saved I2C driver instance */ }; diff --git a/drivers/lcd/ssd1306.h b/drivers/lcd/ssd1306.h index b75672936e6..6c008e7a9b5 100644 --- a/drivers/lcd/ssd1306.h +++ b/drivers/lcd/ssd1306.h @@ -234,7 +234,7 @@ struct ssd1306_dev_s #ifdef CONFIG_LCD_SSD1306_SPI FAR struct spi_dev_s *spi; /* Cached SPI device reference */ #else - FAR struct i2c_dev_s *i2c; /* Cached SPI device reference */ + FAR struct i2c_master_s *i2c; /* Cached SPI device reference */ uint8_t addr; /* 7-bit I2C address */ #endif uint8_t contrast; /* Current contrast setting */ diff --git a/drivers/lcd/ssd1306_base.c b/drivers/lcd/ssd1306_base.c index b7d76eb9ec8..95394e66093 100644 --- a/drivers/lcd/ssd1306_base.c +++ b/drivers/lcd/ssd1306_base.c @@ -807,7 +807,7 @@ static int ssd1306_setcontrast(struct lcd_dev_s *dev, unsigned int contrast) #ifdef CONFIG_LCD_SSD1306_SPI FAR struct lcd_dev_s *ssd1306_initialize(FAR struct spi_dev_s *dev, unsigned int devno) #else -FAR struct lcd_dev_s *ssd1306_initialize(FAR struct i2c_dev_s *dev, unsigned int devno) +FAR struct lcd_dev_s *ssd1306_initialize(FAR struct i2c_master_s *dev, unsigned int devno) #endif { FAR struct ssd1306_dev_s *priv = &g_oleddev; diff --git a/drivers/leds/pca9635pw.c b/drivers/leds/pca9635pw.c index 92f8baaa941..d07b10baab9 100644 --- a/drivers/leds/pca9635pw.c +++ b/drivers/leds/pca9635pw.c @@ -54,7 +54,7 @@ struct pca9635pw_dev_s { - FAR struct i2c_dev_s *i2c; + FAR struct i2c_master_s *i2c; uint8_t i2c_addr; }; @@ -351,7 +351,7 @@ static int pca9635pw_ioctl(FAR struct file *filep, int cmd, unsigned long arg) * ****************************************************************************/ -int pca9635pw_register(FAR const char *devpath, FAR struct i2c_dev_s *i2c, +int pca9635pw_register(FAR const char *devpath, FAR struct i2c_master_s *i2c, uint8_t const pca9635pw_i2c_addr) { /* Sanity check */ diff --git a/drivers/mtd/at24xx.c b/drivers/mtd/at24xx.c index 8f76e54f65c..ef6abe53225 100644 --- a/drivers/mtd/at24xx.c +++ b/drivers/mtd/at24xx.c @@ -150,15 +150,15 @@ struct at24c_dev_s { - struct mtd_dev_s mtd; /* MTD interface */ - FAR struct i2c_dev_s *dev; /* Saved I2C interface instance */ - bool initd; /* True: The device has been initialize */ + struct mtd_dev_s mtd; /* MTD interface */ + FAR struct i2c_master_s *dev; /* Saved I2C interface instance */ + bool initd; /* True: The device has been initialize */ #ifdef CONFIG_AT24XX_EXTENDED - bool extended; /* True: use extended memory region */ + bool extended; /* True: use extended memory region */ #endif - uint8_t addr; /* I2C address */ - uint16_t pagesize; /* 32, 63 */ - uint16_t npages; /* 128, 256, 512, 1024 */ + uint8_t addr; /* I2C address */ + uint16_t pagesize; /* 32, 63 */ + uint16_t npages; /* 128, 256, 512, 1024 */ }; /************************************************************************************ @@ -547,9 +547,9 @@ static int at24c_ioctl(FAR struct mtd_dev_s *dev, int cmd, unsigned long arg) ************************************************************************************/ #ifdef CONFIG_AT24XX_MULTI -FAR struct mtd_dev_s *at24c_initialize(FAR struct i2c_dev_s *dev, uint8_t address) +FAR struct mtd_dev_s *at24c_initialize(FAR struct i2c_master_s *dev, uint8_t address) #else -FAR struct mtd_dev_s *at24c_initialize(FAR struct i2c_dev_s *dev) +FAR struct mtd_dev_s *at24c_initialize(FAR struct i2c_master_s *dev) #endif { FAR struct at24c_dev_s *priv; diff --git a/drivers/power/bq2425x.c b/drivers/power/bq2425x.c index bf9d3e86da4..ad73f9f8cae 100644 --- a/drivers/power/bq2425x.c +++ b/drivers/power/bq2425x.c @@ -93,13 +93,13 @@ struct bq2425x_dev_s /* The common part of the battery driver visible to the upper-half driver */ FAR const struct battery_charger_operations_s *ops; /* Battery operations */ - sem_t batsem; /* Enforce mutually exclusive access */ + sem_t batsem; /* Enforce mutually exclusive access */ /* Data fields specific to the lower half BQ2425x driver follow */ - FAR struct i2c_dev_s *i2c; /* I2C interface */ - uint8_t addr; /* I2C address */ - uint32_t frequency; /* I2C frequency */ + FAR struct i2c_master_s *i2c; /* I2C interface */ + uint8_t addr; /* I2C address */ + uint32_t frequency; /* I2C frequency */ }; /**************************************************************************** @@ -715,8 +715,9 @@ static int bq2425x_current(struct battery_charger_dev_s *dev, int value) * ****************************************************************************/ -FAR struct battery_charger_dev_s *bq2425x_initialize(FAR struct i2c_dev_s *i2c, - uint8_t addr, uint32_t frequency) +FAR struct battery_charger_dev_s * + bq2425x_initialize(FAR struct i2c_master_s *i2c, uint8_t addr, + uint32_t frequency) { FAR struct bq2425x_dev_s *priv; int ret; diff --git a/drivers/power/max1704x.c b/drivers/power/max1704x.c index 73fd5b38ca8..ff358bda178 100644 --- a/drivers/power/max1704x.c +++ b/drivers/power/max1704x.c @@ -178,13 +178,13 @@ struct max1704x_dev_s /* The common part of the battery driver visible to the upper-half driver */ FAR const struct battery_gauge_operations_s *ops; /* Battery operations */ - sem_t batsem; /* Enforce mutually exclusive access */ + sem_t batsem; /* Enforce mutually exclusive access */ /* Data fields specific to the lower half MAX1704x driver follow */ - FAR struct i2c_dev_s *i2c; /* I2C interface */ - uint8_t addr; /* I2C address */ - uint32_t frequency; /* I2C frequency */ + FAR struct i2c_master_s *i2c; /* I2C interface */ + uint8_t addr; /* I2C address */ + uint32_t frequency; /* I2C frequency */ }; /**************************************************************************** @@ -520,7 +520,7 @@ static int max1704x_capacity(struct battery_gauge_dev_s *dev, b16_t *value) * ****************************************************************************/ -FAR struct battery_gauge_dev_s *max1704x_initialize(FAR struct i2c_dev_s *i2c, +FAR struct battery_gauge_dev_s *max1704x_initialize(FAR struct i2c_master_s *i2c, uint8_t addr, uint32_t frequency) { diff --git a/drivers/sensors/adxl345.h b/drivers/sensors/adxl345.h index 9a87e9e131f..e91fc6b0744 100644 --- a/drivers/sensors/adxl345.h +++ b/drivers/sensors/adxl345.h @@ -120,7 +120,7 @@ struct adxl345_dev_s #ifdef CONFIG_ADXL345_SPI FAR struct spi_dev_s *spi; /* Saved SPI driver instance */ #else - FAR struct i2c_dev_s *i2c; /* Saved I2C driver instance */ + FAR struct i2c_master_s *i2c; /* Saved I2C driver instance */ #endif uint8_t status; /* See ADXL345_STAT_* definitions */ diff --git a/drivers/sensors/adxl345_base.c b/drivers/sensors/adxl345_base.c index 4b2f95fbde0..ff5789e3397 100644 --- a/drivers/sensors/adxl345_base.c +++ b/drivers/sensors/adxl345_base.c @@ -384,7 +384,7 @@ static void adxl345_reset(FAR struct adxl345_dev_s *priv) ADXL345_HANDLE adxl345_instantiate(FAR struct spi_dev_s *dev, FAR struct adxl345_config_s *config) #else -ADXL345_HANDLE adxl345_instantiate(FAR struct i2c_dev_s *dev, +ADXL345_HANDLE adxl345_instantiate(FAR struct i2c_master_s *dev, FAR struct adxl345_config_s *config) #endif { diff --git a/drivers/sensors/as5048b.c b/drivers/sensors/as5048b.c index cd56af85a14..7ee52e1f0ff 100644 --- a/drivers/sensors/as5048b.c +++ b/drivers/sensors/as5048b.c @@ -57,9 +57,9 @@ struct as5048b_dev_s { - struct qe_lowerhalf_s lower; /* AS5048B quadrature encoder lower half */ - FAR struct i2c_dev_s *i2c; /* I2C interface */ - uint8_t addr; /* I2C address */ + struct qe_lowerhalf_s lower; /* AS5048B quadrature encoder lower half */ + FAR struct i2c_master_s *i2c; /* I2C interface */ + uint8_t addr; /* I2C address */ }; /**************************************************************************** @@ -577,7 +577,7 @@ static int as5048b_ioctl(FAR struct qe_lowerhalf_s *lower, int cmd, * ****************************************************************************/ -FAR struct qe_lowerhalf_s *as5048b_initialize(FAR struct i2c_dev_s *i2c, +FAR struct qe_lowerhalf_s *as5048b_initialize(FAR struct i2c_master_s *i2c, uint8_t addr) { FAR struct as5048b_dev_s *priv; diff --git a/drivers/sensors/bmp180.c b/drivers/sensors/bmp180.c index 8ffc326c264..ce16dd94e47 100644 --- a/drivers/sensors/bmp180.c +++ b/drivers/sensors/bmp180.c @@ -110,10 +110,10 @@ struct bmp180_dev_s { - FAR struct i2c_dev_s *i2c; /* I2C interface */ - uint8_t addr; /* BMP180 I2C address */ - int freq; /* BMP180 Frequency <= 3.4MHz */ - int16_t bmp180_cal_ac1; /* Calibration coefficients */ + FAR struct i2c_master_s *i2c; /* I2C interface */ + uint8_t addr; /* BMP180 I2C address */ + int freq; /* BMP180 Frequency <= 3.4MHz */ + int16_t bmp180_cal_ac1; /* Calibration coefficients */ int16_t bmp180_cal_ac2; int16_t bmp180_cal_ac3; uint16_t bmp180_cal_ac4; @@ -124,8 +124,8 @@ struct bmp180_dev_s int16_t bmp180_cal_mb; int16_t bmp180_cal_mc; int16_t bmp180_cal_md; - int32_t bmp180_utemp; /* Uncompensated temperature read from BMP180 */ - int32_t bmp180_upress; /* Uncompensated pressure read from BMP180 */ + int32_t bmp180_utemp; /* Uncompensated temperature read from BMP180 */ + int32_t bmp180_upress; /* Uncompensated pressure read from BMP180 */ }; /**************************************************************************** @@ -569,7 +569,7 @@ static ssize_t bmp180_write(FAR struct file *filep, FAR const char *buffer, * ****************************************************************************/ -int bmp180_register(FAR const char *devpath, FAR struct i2c_dev_s *i2c) +int bmp180_register(FAR const char *devpath, FAR struct i2c_master_s *i2c) { FAR struct bmp180_dev_s *priv; int ret; diff --git a/drivers/sensors/lis331dl.c b/drivers/sensors/lis331dl.c index 4087579fd6f..7802eb086a2 100644 --- a/drivers/sensors/lis331dl.c +++ b/drivers/sensors/lis331dl.c @@ -93,7 +93,7 @@ struct lis331dl_dev_s { - struct i2c_dev_s *i2c; + struct i2c_master_s *i2c; uint8_t address; struct lis331dl_vector_s a; uint8_t cr1; @@ -217,7 +217,7 @@ static int lis331dl_readregs(FAR struct lis331dl_dev_s *dev) * Public Functions ****************************************************************************/ -FAR struct lis331dl_dev_s *lis331dl_init(FAR struct i2c_dev_s *i2c, +FAR struct lis331dl_dev_s *lis331dl_init(FAR struct i2c_master_s *i2c, uint16_t address) { FAR struct lis331dl_dev_s * dev; diff --git a/drivers/sensors/lm75.c b/drivers/sensors/lm75.c index 05f6f890efb..609377f69e3 100644 --- a/drivers/sensors/lm75.c +++ b/drivers/sensors/lm75.c @@ -67,9 +67,9 @@ struct lm75_dev_s { - FAR struct i2c_dev_s *i2c; /* I2C interface */ - uint8_t addr; /* I2C address */ - bool fahrenheit; /* true: temperature will be reported in fahrenheit */ + FAR struct i2c_master_s *i2c; /* I2C interface */ + uint8_t addr; /* I2C address */ + bool fahrenheit; /* true: temperature will be reported in fahrenheit */ }; /**************************************************************************** @@ -503,7 +503,7 @@ static int lm75_ioctl(FAR struct file *filep, int cmd, unsigned long arg) * ****************************************************************************/ -int lm75_register(FAR const char *devpath, FAR struct i2c_dev_s *i2c, uint8_t addr) +int lm75_register(FAR const char *devpath, FAR struct i2c_master_s *i2c, uint8_t addr) { FAR struct lm75_dev_s *priv; int ret; diff --git a/drivers/sensors/lm92.c b/drivers/sensors/lm92.c index 31593337214..432445e30c9 100644 --- a/drivers/sensors/lm92.c +++ b/drivers/sensors/lm92.c @@ -69,9 +69,9 @@ struct lm92_dev_s { - FAR struct i2c_dev_s *i2c; /* I2C interface */ - uint8_t addr; /* I2C address */ - bool fahrenheit; /* true: temperature will be reported in Fahrenheit */ + FAR struct i2c_master_s *i2c; /* I2C interface */ + uint8_t addr; /* I2C address */ + bool fahrenheit; /* true: temperature will be reported in Fahrenheit */ }; /**************************************************************************** @@ -595,7 +595,7 @@ static int lm92_ioctl(FAR struct file *filep, int cmd, unsigned long arg) * ****************************************************************************/ -int lm92_register(FAR const char *devpath, FAR struct i2c_dev_s *i2c, +int lm92_register(FAR const char *devpath, FAR struct i2c_master_s *i2c, uint8_t addr) { FAR struct lm92_dev_s *priv; diff --git a/drivers/sensors/lsm9ds1.c b/drivers/sensors/lsm9ds1.c index 047591052a1..bdde5cdc35f 100644 --- a/drivers/sensors/lsm9ds1.c +++ b/drivers/sensors/lsm9ds1.c @@ -500,7 +500,7 @@ struct lsm9ds1_ops_s struct lsm9ds1_dev_s { - FAR struct i2c_dev_s *i2c; /* I2C interface */ + FAR struct i2c_master_s *i2c; /* I2C interface */ uint8_t addr; /* I2C address */ FAR const struct lsm9ds1_ops_s *ops; @@ -567,7 +567,7 @@ static int lsm9ds1_ioctl(FAR struct file *filep, int cmd, /* Common Register Function */ static int lsm9ds1_register(FAR const char *devpath, - FAR struct i2c_dev_s *i2c, uint8_t addr, + FAR struct i2c_master_s *i2c, uint8_t addr, FAR const struct lsm9ds1_ops_s *ops, uint8_t datareg); @@ -1413,7 +1413,7 @@ static int lsm9ds1_ioctl(FAR struct file *filep, int cmd, unsigned long arg) ****************************************************************************/ static int lsm9ds1_register(FAR const char *devpath, - FAR struct i2c_dev_s *i2c, uint8_t addr, + FAR struct i2c_master_s *i2c, uint8_t addr, FAR const struct lsm9ds1_ops_s *ops, uint8_t datareg) { @@ -1486,7 +1486,7 @@ static int lsm9ds1_register(FAR const char *devpath, * ****************************************************************************/ -int lsm9ds1accel_register(FAR const char *devpath, FAR struct i2c_dev_s *i2c, +int lsm9ds1accel_register(FAR const char *devpath, FAR struct i2c_master_s *i2c, uint8_t addr) { /* Sanity check */ @@ -1513,7 +1513,7 @@ int lsm9ds1accel_register(FAR const char *devpath, FAR struct i2c_dev_s *i2c, * ****************************************************************************/ -int lsm9ds1gyro_register(FAR const char *devpath, FAR struct i2c_dev_s *i2c, +int lsm9ds1gyro_register(FAR const char *devpath, FAR struct i2c_master_s *i2c, uint8_t addr) { /* Sanity check */ @@ -1540,7 +1540,7 @@ int lsm9ds1gyro_register(FAR const char *devpath, FAR struct i2c_dev_s *i2c, * ****************************************************************************/ -int lsm9ds1mag_register(FAR const char *devpath, FAR struct i2c_dev_s *i2c, +int lsm9ds1mag_register(FAR const char *devpath, FAR struct i2c_master_s *i2c, uint8_t addr) { /* Sanity check */ diff --git a/drivers/sensors/mb7040.c b/drivers/sensors/mb7040.c index 22ed726eae8..3741761ca23 100644 --- a/drivers/sensors/mb7040.c +++ b/drivers/sensors/mb7040.c @@ -57,8 +57,8 @@ struct mb7040_dev_s { - FAR struct i2c_dev_s *i2c; /* I2C interface */ - uint8_t addr; /* I2C address */ + FAR struct i2c_master_s *i2c; /* I2C interface */ + uint8_t addr; /* I2C address */ }; /**************************************************************************** @@ -336,7 +336,7 @@ static int mb7040_ioctl(FAR struct file *filep, int cmd, unsigned long arg) * ****************************************************************************/ -int mb7040_register(FAR const char *devpath, FAR struct i2c_dev_s *i2c, +int mb7040_register(FAR const char *devpath, FAR struct i2c_master_s *i2c, uint8_t addr) { FAR struct mb7040_dev_s *priv; diff --git a/drivers/sensors/mcp9844.c b/drivers/sensors/mcp9844.c index 92f738d6fb5..b8e5c908516 100644 --- a/drivers/sensors/mcp9844.c +++ b/drivers/sensors/mcp9844.c @@ -56,8 +56,8 @@ struct mcp9844_dev_s { - FAR struct i2c_dev_s *i2c; /* I2C interface */ - uint8_t addr; /* I2C address */ + FAR struct i2c_master_s *i2c; /* I2C interface */ + uint8_t addr; /* I2C address */ }; /**************************************************************************** @@ -317,7 +317,7 @@ static int mcp9844_ioctl(FAR struct file *filep, int cmd, unsigned long arg) * ****************************************************************************/ -int mcp9844_register(FAR const char *devpath, FAR struct i2c_dev_s *i2c, +int mcp9844_register(FAR const char *devpath, FAR struct i2c_master_s *i2c, uint8_t addr) { /* Sanity check */ diff --git a/drivers/sensors/ms58xx.c b/drivers/sensors/ms58xx.c index 58d9ec8b32f..36c6ac07ef0 100644 --- a/drivers/sensors/ms58xx.c +++ b/drivers/sensors/ms58xx.c @@ -75,18 +75,18 @@ struct ms58xx_dev_s { - FAR struct i2c_dev_s *i2c; /* I2C interface */ - uint8_t addr; /* I2C address */ + FAR struct i2c_master_s *i2c; /* I2C interface */ + uint8_t addr; /* I2C address */ enum ms58xx_model_e model; uint8_t crcindex; uint8_t crcshift; - int32_t temp; /* Uncompensated temperature (degrees Centigrade) */ - int32_t press; /* Uncompensated pressure (millibar) */ + int32_t temp; /* Uncompensated temperature (degrees Centigrade) */ + int32_t press; /* Uncompensated pressure (millibar) */ - uint8_t osr; /* Oversampling ratio bits */ - useconds_t delay; /* Oversampling ratio delay */ + uint8_t osr; /* Oversampling ratio bits */ + useconds_t delay; /* Oversampling ratio delay */ /* Calibration coefficients */ @@ -838,7 +838,7 @@ static int ms58xx_ioctl(FAR struct file *filep, int cmd, unsigned long arg) * ****************************************************************************/ -int ms58xx_register(FAR const char *devpath, FAR struct i2c_dev_s *i2c, +int ms58xx_register(FAR const char *devpath, FAR struct i2c_master_s *i2c, uint8_t addr, uint16_t osr, enum ms58xx_model_e model) { FAR struct ms58xx_dev_s *priv; diff --git a/drivers/timers/ds3231.c b/drivers/timers/ds3231.c index aede53b9d2a..0dd27bc754a 100644 --- a/drivers/timers/ds3231.c +++ b/drivers/timers/ds3231.c @@ -108,7 +108,7 @@ struct ds3231_dev_s { - FAR struct i2c_dev_s *i2c; /* Contained reference to the I2C bus driver */ + FAR struct i2c_master_s *i2c; /* Contained reference to the I2C bus driver */ }; /************************************************************************************ @@ -237,7 +237,7 @@ static int rtc_bcd2bin(uint8_t value) * ************************************************************************************/ -int dsxxxx_rtc_initialize(FAR struct i2c_dev_s *i2c) +int dsxxxx_rtc_initialize(FAR struct i2c_master_s *i2c) { /* Remember the i2c device and claim that the RTC is enabled */ diff --git a/drivers/timers/pcf85263.c b/drivers/timers/pcf85263.c index 5d50240f7b9..ac6359c9da3 100644 --- a/drivers/timers/pcf85263.c +++ b/drivers/timers/pcf85263.c @@ -108,7 +108,7 @@ struct pcf85263_dev_s { - FAR struct i2c_dev_s *i2c; /* Contained reference to the I2C bus driver */ + FAR struct i2c_master_s *i2c; /* Contained reference to the I2C bus driver */ }; /************************************************************************************ @@ -237,7 +237,7 @@ static int rtc_bcd2bin(uint8_t value) * ************************************************************************************/ -int pcf85263_rtc_initialize(FAR struct i2c_dev_s *i2c) +int pcf85263_rtc_initialize(FAR struct i2c_master_s *i2c) { /* Remember the i2c device and claim that the RTC is enabled */ diff --git a/drivers/video/ov2640.c b/drivers/video/ov2640.c index 58b38f974f4..67322ff3b7c 100644 --- a/drivers/video/ov2640.c +++ b/drivers/video/ov2640.c @@ -286,16 +286,16 @@ struct ovr2640_reg_s /* OV2640 register operations */ -static int ov2640_putreg(FAR struct i2c_dev_s *i2c, uint8_t regaddr, +static int ov2640_putreg(FAR struct i2c_master_s *i2c, uint8_t regaddr, uint8_t regval); -static uint8_t ov2640_getreg(FAR struct i2c_dev_s *i2c, uint8_t regaddr); -static int ov2640_putreglist(FAR struct i2c_dev_s *i2c, +static uint8_t ov2640_getreg(FAR struct i2c_master_s *i2c, uint8_t regaddr); +static int ov2640_putreglist(FAR struct i2c_master_s *i2c, FAR const struct ovr2640_reg_s *reglist, size_t nentries); /* Initialization */ -static int ovr2640_chipid(FAR struct i2c_dev_s *i2c); -static int ov2640_reset(FAR struct i2c_dev_s *i2c); +static int ovr2640_chipid(FAR struct i2c_master_s *i2c); +static int ov2640_reset(FAR struct i2c_master_s *i2c); /**************************************************************************** * Private Data @@ -687,7 +687,7 @@ static const struct ovr2640_reg_s g_ov2640_jpeg_uxga_resolution[] = * ****************************************************************************/ -static int ov2640_putreg(FAR struct i2c_dev_s *i2c, uint8_t regaddr, +static int ov2640_putreg(FAR struct i2c_master_s *i2c, uint8_t regaddr, uint8_t regval) { uint8_t buffer[2]; @@ -731,7 +731,7 @@ static int ov2640_putreg(FAR struct i2c_dev_s *i2c, uint8_t regaddr, * ****************************************************************************/ -static uint8_t ov2640_getreg(FAR struct i2c_dev_s *i2c, uint8_t regaddr) +static uint8_t ov2640_getreg(FAR struct i2c_master_s *i2c, uint8_t regaddr) { uint8_t regval; int ret; @@ -780,7 +780,7 @@ static uint8_t ov2640_getreg(FAR struct i2c_dev_s *i2c, uint8_t regaddr) * ****************************************************************************/ -static int ov2640_putreglist(FAR struct i2c_dev_s *i2c, +static int ov2640_putreglist(FAR struct i2c_master_s *i2c, FAR const struct ovr2640_reg_s *reglist, size_t nentries) { @@ -815,7 +815,7 @@ static int ov2640_putreglist(FAR struct i2c_dev_s *i2c, * ****************************************************************************/ -static int ovr2640_chipid(FAR struct i2c_dev_s *i2c) +static int ovr2640_chipid(FAR struct i2c_master_s *i2c) { uint8_t pidl; uint8_t pidh; @@ -870,7 +870,7 @@ static int ovr2640_chipid(FAR struct i2c_dev_s *i2c) * ****************************************************************************/ -static int ov2640_reset(FAR struct i2c_dev_s *i2c) +static int ov2640_reset(FAR struct i2c_master_s *i2c) { int ret; @@ -903,7 +903,7 @@ static int ov2640_reset(FAR struct i2c_dev_s *i2c) * ****************************************************************************/ -int ov2640_initialize(FAR struct i2c_dev_s *i2c) +int ov2640_initialize(FAR struct i2c_master_s *i2c) { int ret; diff --git a/include/nuttx/audio/wm8904.h b/include/nuttx/audio/wm8904.h index 983a205e3da..a10c69739ec 100644 --- a/include/nuttx/audio/wm8904.h +++ b/include/nuttx/audio/wm8904.h @@ -214,12 +214,12 @@ extern "C" * ****************************************************************************/ -struct i2c_dev_s; /* Forward reference. Defined in include/nuttx/i2c/i2c_master.h */ +struct i2c_master_s; /* Forward reference. Defined in include/nuttx/i2c/i2c_master.h */ struct i2s_dev_s; /* Forward reference. Defined in include/nuttx/audio/i2s.h */ struct audio_lowerhalf_s; /* Forward reference. Defined in nuttx/audio/audio.h */ FAR struct audio_lowerhalf_s * - wm8904_initialize(FAR struct i2c_dev_s *i2c, FAR struct i2s_dev_s *i2s, + wm8904_initialize(FAR struct i2c_master_s *i2c, FAR struct i2s_dev_s *i2s, FAR const struct wm8904_lower_s *lower); /**************************************************************************** diff --git a/include/nuttx/i2c/i2c_master.h b/include/nuttx/i2c/i2c_master.h index 2216026340b..a90beda0c36 100644 --- a/include/nuttx/i2c/i2c_master.h +++ b/include/nuttx/i2c/i2c_master.h @@ -47,17 +47,6 @@ /**************************************************************************** * Pre-processor Definitions ****************************************************************************/ -/* If a dynamic timeout is selected, then a non-negative, non-zero micro- - * seconds per byte value must be provided as well. - */ - -#ifdef CONFIG_STM32_I2C_DYNTIMEO -# if CONFIG_STM32_I2C_DYNTIMEO_USECPERBYTE < 1 -# warning "Ignoring CONFIG_STM32_I2C_DYNTIMEO because of CONFIG_STM32_I2C_DYNTIMEO_USECPERBYTE" -# undef CONFIG_STM32_I2C_DYNTIMEO -# endif -#endif - /* I2C address calculation. Convert 7- and 10-bit address to 8-bit and * 16-bit read/write address */ @@ -95,7 +84,7 @@ * * Description: * Set the I2C frequency. This frequency will be retained in the struct - * i2c_dev_s instance and will be used with all transfers. Required. + * i2c_master_s instance and will be used with all transfers. Required. * * Input Parameters: * dev - Device-specific state data @@ -113,7 +102,7 @@ * * Description: * Set the I2C slave address. This frequency will be retained in the struct - * i2c_dev_s instance and will be used with all transfers. Required. + * i2c_master_s instance and will be used with all transfers. Required. * * Input Parameters: * dev - Device-specific state data @@ -127,32 +116,6 @@ #define I2C_SETADDRESS(d,a,n) ((d)->ops->setaddress(d,a,n)) -/**************************************************************************** - * Name: I2C_SETOWNADDRESS - * - * Description: - * Set our own I2C address. Calling this function enables Slave mode and - * disables Master mode on given instance (note that I2C is a bus, where - * multiple masters and slave may be handled by one device driver). - * - * One may register a callback to be notified about reception. During the - * slave mode reception, the function READ and WRITE must be used to - * to handle reads and writes from a master. - * - * Input Parameters: - * dev - Device-specific state data - * address - Our own slave address; If it is 0x00, then the device driver - * listens to general call - * nbits - The number of address bits provided (7 or 10) - * - * Returned Value: - * OK on valid address and if the same address has not been assigned - * to another instance sharing the same port. Otherwise ERROR is returned. - * - ****************************************************************************/ - -#define I2C_SETOWNADDRESS(d,a,n) ((d)->ops->setownaddress(d,a,n)) - /**************************************************************************** * Name: I2C_WRITE * @@ -222,25 +185,20 @@ /* The I2C vtable */ -struct i2c_dev_s; +struct i2c_master_s; struct i2c_msg_s; struct i2c_ops_s { - uint32_t (*setfrequency)(FAR struct i2c_dev_s *dev, uint32_t frequency); - int (*setaddress)(FAR struct i2c_dev_s *dev, int addr, int nbits); - int (*write)(FAR struct i2c_dev_s *dev, FAR const uint8_t *buffer, + uint32_t (*setfrequency)(FAR struct i2c_master_s *dev, uint32_t frequency); + int (*setaddress)(FAR struct i2c_master_s *dev, int addr, int nbits); + int (*write)(FAR struct i2c_master_s *dev, FAR const uint8_t *buffer, int buflen); - int (*read)(FAR struct i2c_dev_s *dev, FAR uint8_t *buffer, + int (*read)(FAR struct i2c_master_s *dev, FAR uint8_t *buffer, int buflen); #ifdef CONFIG_I2C_TRANSFER - int (*transfer)(FAR struct i2c_dev_s *dev, FAR struct i2c_msg_s *msgs, + int (*transfer)(FAR struct i2c_master_s *dev, FAR struct i2c_msg_s *msgs, int count); #endif -#ifdef CONFIG_I2C_SLAVE - int (*setownaddress)(FAR struct i2c_dev_s *dev, int addr, int nbits); - int (*registercallback)(FAR struct i2c_dev_s *dev, - int (*callback)(FAR void *arg), FAR void *arg); -#endif }; /* This structure contains the full state of I2C as needed for a specific @@ -273,7 +231,7 @@ struct i2c_msg_s * add additional, device specific fields after the vtable. */ -struct i2c_dev_s +struct i2c_master_s { const struct i2c_ops_s *ops; /* I2C vtable */ }; @@ -296,7 +254,7 @@ extern "C" * * Description: * Initialize the selected I2C port. And return a unique instance of struct - * struct i2c_dev_s. This function may be called to obtain multiple + * struct i2c_master_s. This function may be called to obtain multiple * instances of the interface, each of which may be set up with a * different frequency and slave address. * @@ -308,7 +266,7 @@ extern "C" * ****************************************************************************/ -FAR struct i2c_dev_s *up_i2cinitialize(int port); +FAR struct i2c_master_s *up_i2cinitialize(int port); /**************************************************************************** * Name: up_i2cuninitialize @@ -325,7 +283,7 @@ FAR struct i2c_dev_s *up_i2cinitialize(int port); * ****************************************************************************/ -int up_i2cuninitialize(FAR struct i2c_dev_s *dev); +int up_i2cuninitialize(FAR struct i2c_master_s *dev); /************************************************************************************ * Name: up_i2creset @@ -336,7 +294,7 @@ int up_i2cuninitialize(FAR struct i2c_dev_s *dev); ************************************************************************************/ #ifdef CONFIG_I2C_RESET -int up_i2creset(FAR struct i2c_dev_s *dev); +int up_i2creset(FAR struct i2c_master_s *dev); #endif /**************************************************************************** @@ -360,7 +318,7 @@ int up_i2creset(FAR struct i2c_dev_s *dev); ****************************************************************************/ #ifdef CONFIG_I2C_TRANSFER -int i2c_writeread(FAR struct i2c_dev_s *dev, FAR const struct i2c_config_s *config, +int i2c_writeread(FAR struct i2c_master_s *dev, FAR const struct i2c_config_s *config, FAR const uint8_t *wbuffer, int wbuflen, FAR uint8_t *rbuffer, int rbuflen); #endif @@ -385,7 +343,7 @@ int i2c_writeread(FAR struct i2c_dev_s *dev, FAR const struct i2c_config_s *conf ****************************************************************************/ #ifdef CONFIG_I2C_TRANSFER -int i2c_write(FAR struct i2c_dev_s *dev, FAR const struct i2c_config_s *config, +int i2c_write(FAR struct i2c_master_s *dev, FAR const struct i2c_config_s *config, FAR const uint8_t *buffer, int buflen); #endif @@ -409,7 +367,7 @@ int i2c_write(FAR struct i2c_dev_s *dev, FAR const struct i2c_config_s *config, ****************************************************************************/ #ifdef CONFIG_I2C_TRANSFER -int i2c_read(FAR struct i2c_dev_s *dev, FAR const struct i2c_config_s *config, +int i2c_read(FAR struct i2c_master_s *dev, FAR const struct i2c_config_s *config, FAR uint8_t *buffer, int buflen); #endif diff --git a/include/nuttx/input/mxt.h b/include/nuttx/input/mxt.h index aecc042c336..4498be11c22 100644 --- a/include/nuttx/input/mxt.h +++ b/include/nuttx/input/mxt.h @@ -199,7 +199,7 @@ extern "C" * ****************************************************************************/ -int mxt_register(FAR struct i2c_dev_s *i2c, +int mxt_register(FAR struct i2c_master_s *i2c, FAR const struct mxt_lower_s *lower, int minor); #undef EXTERN diff --git a/include/nuttx/input/stmpe811.h b/include/nuttx/input/stmpe811.h index 4c64b4005db..6cf96e6a7fd 100644 --- a/include/nuttx/input/stmpe811.h +++ b/include/nuttx/input/stmpe811.h @@ -549,7 +549,7 @@ extern "C" STMPE811_HANDLE stmpe811_instantiate(FAR struct spi_dev_s *dev, FAR struct stmpe811_config_s *config); #else -STMPE811_HANDLE stmpe811_instantiate(FAR struct i2c_dev_s *dev, +STMPE811_HANDLE stmpe811_instantiate(FAR struct i2c_master_s *dev, FAR struct stmpe811_config_s *config); #endif diff --git a/include/nuttx/input/tsc2007.h b/include/nuttx/input/tsc2007.h index 468878f8307..1517fd488a5 100644 --- a/include/nuttx/input/tsc2007.h +++ b/include/nuttx/input/tsc2007.h @@ -160,7 +160,7 @@ extern "C" * ****************************************************************************/ -int tsc2007_register(FAR struct i2c_dev_s *dev, +int tsc2007_register(FAR struct i2c_master_s *dev, FAR struct tsc2007_config_s *config, int minor); #undef EXTERN diff --git a/include/nuttx/ioexpander/pca9555.h b/include/nuttx/ioexpander/pca9555.h index 2a0e4200d1f..aa0b3c28635 100644 --- a/include/nuttx/ioexpander/pca9555.h +++ b/include/nuttx/ioexpander/pca9555.h @@ -110,7 +110,7 @@ extern "C" * ********************************************************************************************/ -FAR struct ioexpander_dev_s* pca9555_initialize(FAR struct i2c_dev_s *dev, +FAR struct ioexpander_dev_s* pca9555_initialize(FAR struct i2c_master_s *dev, FAR struct pca9555_config_s *config); #ifdef __cplusplus diff --git a/include/nuttx/lcd/ssd1306.h b/include/nuttx/lcd/ssd1306.h index ea80189c461..286c573e3af 100644 --- a/include/nuttx/lcd/ssd1306.h +++ b/include/nuttx/lcd/ssd1306.h @@ -243,7 +243,7 @@ struct spi_dev_s; /* See include/nuttx/spi/spi.h */ #ifdef CONFIG_LCD_SSD1306_SPI FAR struct lcd_dev_s *ssd1306_initialize(FAR struct spi_dev_s *dev, unsigned int devno); #else -FAR struct lcd_dev_s *ssd1306_initialize(FAR struct i2c_dev_s *dev, unsigned int devno); +FAR struct lcd_dev_s *ssd1306_initialize(FAR struct i2c_master_s *dev, unsigned int devno); #endif /************************************************************************************************ diff --git a/include/nuttx/leds/pca9635pw.h b/include/nuttx/leds/pca9635pw.h index a65610ca15f..9872cb1b8b5 100644 --- a/include/nuttx/leds/pca9635pw.h +++ b/include/nuttx/leds/pca9635pw.h @@ -157,7 +157,7 @@ struct pca9635pw_setled_brightness_arg_s * Forward declarations ****************************************************************************/ -struct i2c_dev_s; +struct i2c_master_s; /**************************************************************************** * Public Types @@ -189,7 +189,7 @@ extern "C" * ****************************************************************************/ -int pca9635pw_register(FAR const char *devpath, FAR struct i2c_dev_s *i2c, +int pca9635pw_register(FAR const char *devpath, FAR struct i2c_master_s *i2c, uint8_t const pca9635pw_i2c_addr); #undef EXTERN diff --git a/include/nuttx/mtd/mtd.h b/include/nuttx/mtd/mtd.h index 39803509f81..f17b7d3b703 100644 --- a/include/nuttx/mtd/mtd.h +++ b/include/nuttx/mtd/mtd.h @@ -381,13 +381,13 @@ FAR struct mtd_dev_s *at45db_initialize(FAR struct spi_dev_s *dev); * ****************************************************************************/ -struct i2c_dev_s; /* Forward reference */ +struct i2c_master_s; /* Forward reference */ #ifdef CONFIG_AT24XX_MULTI -FAR struct mtd_dev_s *at24c_initialize(FAR struct i2c_dev_s *dev, +FAR struct mtd_dev_s *at24c_initialize(FAR struct i2c_master_s *dev, uint8_t address); #else -FAR struct mtd_dev_s *at24c_initialize(FAR struct i2c_dev_s *dev); +FAR struct mtd_dev_s *at24c_initialize(FAR struct i2c_master_s *dev); #endif /************************************************************************************ diff --git a/include/nuttx/power/battery_charger.h b/include/nuttx/power/battery_charger.h index a2ce96196d7..d90db10154b 100644 --- a/include/nuttx/power/battery_charger.h +++ b/include/nuttx/power/battery_charger.h @@ -217,9 +217,9 @@ int battery_charger_register(FAR const char *devpath, ****************************************************************************/ #if defined(CONFIG_I2C) && defined(CONFIG_I2C_BQ2425X) -struct i2c_dev_s; /* Forward reference */ +struct i2c_master_s; /* Forward reference */ -FAR struct battery_charger_dev_s *bq2425x_initialize(FAR struct i2c_dev_s *i2c, +FAR struct battery_charger_dev_s *bq2425x_initialize(FAR struct i2c_master_s *i2c, uint8_t addr, uint32_t frequency); #endif diff --git a/include/nuttx/power/battery_gauge.h b/include/nuttx/power/battery_gauge.h index d087f2213c2..8351faee8ce 100644 --- a/include/nuttx/power/battery_gauge.h +++ b/include/nuttx/power/battery_gauge.h @@ -198,9 +198,9 @@ int battery_gauge_register(FAR const char *devpath, ****************************************************************************/ #if defined(CONFIG_I2C) && defined(CONFIG_I2C_MAX1704X) -struct i2c_dev_s; /* Forward reference */ +struct i2c_master_s; /* Forward reference */ -FAR struct battery_gauge_dev_s *max1704x_initialize(FAR struct i2c_dev_s *i2c +FAR struct battery_gauge_dev_s *max1704x_initialize(FAR struct i2c_master_s *i2c uint8_t addr, uint32_t frequency); #endif diff --git a/include/nuttx/sensors/adxl345.h b/include/nuttx/sensors/adxl345.h index 9655e84f69e..23409efe805 100644 --- a/include/nuttx/sensors/adxl345.h +++ b/include/nuttx/sensors/adxl345.h @@ -325,7 +325,7 @@ struct adxl345_config_s typedef FAR void *ADXL345_HANDLE; -struct i2c_dev_s; +struct i2c_master_s; struct spi_dev_s; /******************************************************************************************** @@ -361,7 +361,7 @@ extern "C" ADXL345_HANDLE adxl345_instantiate(FAR struct spi_dev_s *dev, FAR struct adxl345_config_s *config); #else -ADXL345_HANDLE adxl345_instantiate(FAR struct i2c_dev_s *dev, +ADXL345_HANDLE adxl345_instantiate(FAR struct i2c_master_s *dev, FAR struct adxl345_config_s *config); #endif diff --git a/include/nuttx/sensors/as5048b.h b/include/nuttx/sensors/as5048b.h index 6a6de4eef02..9a274d90ae5 100644 --- a/include/nuttx/sensors/as5048b.h +++ b/include/nuttx/sensors/as5048b.h @@ -99,7 +99,7 @@ * Public Types ****************************************************************************/ -struct i2c_dev_s; +struct i2c_master_s; /**************************************************************************** * Public Function Prototypes @@ -129,7 +129,7 @@ extern "C" * ****************************************************************************/ -FAR struct qe_lowerhalf_s *as5048b_initialize(FAR struct i2c_dev_s *i2c, +FAR struct qe_lowerhalf_s *as5048b_initialize(FAR struct i2c_master_s *i2c, uint8_t addr); #undef EXTERN diff --git a/include/nuttx/sensors/bmp180.h b/include/nuttx/sensors/bmp180.h index 505aa724888..0c12e242265 100644 --- a/include/nuttx/sensors/bmp180.h +++ b/include/nuttx/sensors/bmp180.h @@ -59,7 +59,7 @@ * Public Types ****************************************************************************/ -struct i2c_dev_s; +struct i2c_master_s; /******************************************************************************************** * Public Function Prototypes @@ -89,7 +89,7 @@ extern "C" * ****************************************************************************/ -int bmp180_register(FAR const char *devpath, FAR struct i2c_dev_s *i2c); +int bmp180_register(FAR const char *devpath, FAR struct i2c_master_s *i2c); #undef EXTERN #ifdef __cplusplus diff --git a/include/nuttx/sensors/lis331dl.h b/include/nuttx/sensors/lis331dl.h index 60062884636..db4c4317d99 100644 --- a/include/nuttx/sensors/lis331dl.h +++ b/include/nuttx/sensors/lis331dl.h @@ -71,7 +71,7 @@ struct lis331dl_vector_s int8_t z; }; -struct i2c_dev_s; +struct i2c_master_s; /************************************************************************************ * Public Function Prototypes @@ -100,7 +100,7 @@ struct i2c_dev_s; * ************************************************************************************/ -FAR struct lis331dl_dev_s *lis331dl_init(FAR struct i2c_dev_s * i2c, +FAR struct lis331dl_dev_s *lis331dl_init(FAR struct i2c_master_s * i2c, uint16_t address); /************************************************************************************ diff --git a/include/nuttx/sensors/lm75.h b/include/nuttx/sensors/lm75.h index a343a54874a..827620adab9 100644 --- a/include/nuttx/sensors/lm75.h +++ b/include/nuttx/sensors/lm75.h @@ -99,7 +99,7 @@ * Public Types ****************************************************************************/ -struct i2c_dev_s; +struct i2c_master_s; /**************************************************************************** * Public Function Prototypes @@ -131,7 +131,7 @@ extern "C" * ****************************************************************************/ -int lm75_register(FAR const char *devpath, FAR struct i2c_dev_s *i2c, +int lm75_register(FAR const char *devpath, FAR struct i2c_master_s *i2c, uint8_t addr); #undef EXTERN diff --git a/include/nuttx/sensors/lm92.h b/include/nuttx/sensors/lm92.h index 16266568a88..8b49a0da936 100644 --- a/include/nuttx/sensors/lm92.h +++ b/include/nuttx/sensors/lm92.h @@ -106,7 +106,7 @@ * Public Types ****************************************************************************/ -struct i2c_dev_s; +struct i2c_master_s; /**************************************************************************** * Public Function Prototypes @@ -139,7 +139,7 @@ extern "C" * ****************************************************************************/ -int lm92_register(FAR const char *devpath, FAR struct i2c_dev_s *i2c, +int lm92_register(FAR const char *devpath, FAR struct i2c_master_s *i2c, uint8_t addr); #undef EXTERN diff --git a/include/nuttx/sensors/lsm9ds1.h b/include/nuttx/sensors/lsm9ds1.h index d69ca9e808a..cf3ef1b3c76 100644 --- a/include/nuttx/sensors/lsm9ds1.h +++ b/include/nuttx/sensors/lsm9ds1.h @@ -75,7 +75,7 @@ * Public Types ****************************************************************************/ -struct i2c_dev_s; +struct i2c_master_s; /**************************************************************************** * Public Function Prototypes @@ -102,7 +102,7 @@ extern "C" * ****************************************************************************/ -int lsm9ds1accel_register(FAR const char *devpath, FAR struct i2c_dev_s *i2c, +int lsm9ds1accel_register(FAR const char *devpath, FAR struct i2c_master_s *i2c, uint8_t addr); /**************************************************************************** @@ -121,7 +121,7 @@ int lsm9ds1accel_register(FAR const char *devpath, FAR struct i2c_dev_s *i2c, * ****************************************************************************/ -int lsm9ds1gyro_register(FAR const char *devpath, FAR struct i2c_dev_s *i2c, +int lsm9ds1gyro_register(FAR const char *devpath, FAR struct i2c_master_s *i2c, uint8_t addr); /**************************************************************************** @@ -140,7 +140,7 @@ int lsm9ds1gyro_register(FAR const char *devpath, FAR struct i2c_dev_s *i2c, * ****************************************************************************/ -int lsm9ds1mag_register(FAR const char *devpath, FAR struct i2c_dev_s *i2c, +int lsm9ds1mag_register(FAR const char *devpath, FAR struct i2c_master_s *i2c, uint8_t addr); #ifdef __cplusplus diff --git a/include/nuttx/sensors/mb7040.h b/include/nuttx/sensors/mb7040.h index f3359ea1f35..0280ecadb6f 100644 --- a/include/nuttx/sensors/mb7040.h +++ b/include/nuttx/sensors/mb7040.h @@ -78,7 +78,7 @@ * Public Types ****************************************************************************/ -struct i2c_dev_s; +struct i2c_master_s; /**************************************************************************** * Public Function Prototypes @@ -108,7 +108,7 @@ extern "C" * ****************************************************************************/ -int mb7040_register(FAR const char *devpath, FAR struct i2c_dev_s *i2c, +int mb7040_register(FAR const char *devpath, FAR struct i2c_master_s *i2c, uint8_t addr); #undef EXTERN diff --git a/include/nuttx/sensors/mcp9844.h b/include/nuttx/sensors/mcp9844.h index 68276b84875..97a8f2bda32 100644 --- a/include/nuttx/sensors/mcp9844.h +++ b/include/nuttx/sensors/mcp9844.h @@ -86,7 +86,7 @@ enum mcp9844_resolution_e RES_0_0625 = MCP9844_RESO_REG_BIT_1 | MCP9844_RESO_REG_BIT_0 }; -struct i2c_dev_s; +struct i2c_master_s; /**************************************************************************** * Public Function Prototypes @@ -116,7 +116,7 @@ extern "C" * ****************************************************************************/ -int mcp9844_register(FAR const char *devpath, FAR struct i2c_dev_s *i2c, +int mcp9844_register(FAR const char *devpath, FAR struct i2c_master_s *i2c, uint8_t addr); #undef EXTERN diff --git a/include/nuttx/sensors/ms58xx.h b/include/nuttx/sensors/ms58xx.h index 3ad6bd31072..fb20a3b2124 100644 --- a/include/nuttx/sensors/ms58xx.h +++ b/include/nuttx/sensors/ms58xx.h @@ -87,7 +87,7 @@ enum ms58xx_model_e MS58XX_MODEL_MS5837_30 = 7 }; -struct i2c_dev_s; +struct i2c_master_s; /**************************************************************************** * Public Function Prototypes @@ -119,7 +119,7 @@ extern "C" * ****************************************************************************/ -int ms58xx_register(FAR const char *devpath, FAR struct i2c_dev_s *i2c, +int ms58xx_register(FAR const char *devpath, FAR struct i2c_master_s *i2c, uint8_t addr, uint16_t osr, enum ms58xx_model_e model); #undef EXTERN diff --git a/include/nuttx/timers/cs2100-cp.h b/include/nuttx/timers/cs2100-cp.h index 8ef8bb726c5..dcff2851e06 100644 --- a/include/nuttx/timers/cs2100-cp.h +++ b/include/nuttx/timers/cs2100-cp.h @@ -163,13 +163,13 @@ struct cs2100_config_s { - FAR struct i2c_dev_s *i2c; /* Instance of an I2C interface */ - uint32_t refclk; /* RefClk/XTAL frequency */ - uint32_t clkin; /* Frequency CLK_IN provided to the CS2100-CP */ - uint32_t clkout; /* Desired CLK_OUT frequency */ - uint8_t i2caddr; /* CP2100-CP I2C address */ - uint8_t loopbw; /* Minimum loop bandwidth: 1-128 */ - bool xtal; /* false: Refclck, true: Crystal on XTI/XTO */ + FAR struct i2c_master_s *i2c; /* Instance of an I2C interface */ + uint32_t refclk; /* RefClk/XTAL frequency */ + uint32_t clkin; /* Frequency CLK_IN provided to the CS2100-CP */ + uint32_t clkout; /* Desired CLK_OUT frequency */ + uint8_t i2caddr; /* CP2100-CP I2C address */ + uint8_t loopbw; /* Minimum loop bandwidth: 1-128 */ + bool xtal; /* false: Refclck, true: Crystal on XTI/XTO */ }; /******************************************************************************************** @@ -188,7 +188,7 @@ extern "C" * Public Function Prototypes ********************************************************************************************/ -struct i2c_dev_s; /* Forward reference */ +struct i2c_master_s; /* Forward reference */ /******************************************************************************************** * Name: cs2100_enable diff --git a/include/nuttx/timers/ds3231.h b/include/nuttx/timers/ds3231.h index b3f239e3ade..2aa0cfcf548 100644 --- a/include/nuttx/timers/ds3231.h +++ b/include/nuttx/timers/ds3231.h @@ -78,8 +78,8 @@ extern "C" * ************************************************************************************/ -struct i2c_dev_s; /* Forward reference */ -int dsxxxx_rtc_initialize(FAR struct i2c_dev_s *i2c); +struct i2c_master_s; /* Forward reference */ +int dsxxxx_rtc_initialize(FAR struct i2c_master_s *i2c); #undef EXTERN #ifdef __cplusplus diff --git a/include/nuttx/timers/pcf85263.h b/include/nuttx/timers/pcf85263.h index fdda2b815e8..4018e1ca658 100644 --- a/include/nuttx/timers/pcf85263.h +++ b/include/nuttx/timers/pcf85263.h @@ -78,8 +78,8 @@ extern "C" * ************************************************************************************/ -struct i2c_dev_s; /* Forward reference */ -int pcf85263_rtc_initialize(FAR struct i2c_dev_s *i2c); +struct i2c_master_s; /* Forward reference */ +int pcf85263_rtc_initialize(FAR struct i2c_master_s *i2c); #undef EXTERN #ifdef __cplusplus diff --git a/include/nuttx/video/ov2640.h b/include/nuttx/video/ov2640.h index 4c037fdea29..b398994d973 100644 --- a/include/nuttx/video/ov2640.h +++ b/include/nuttx/video/ov2640.h @@ -77,8 +77,8 @@ extern "C" * ****************************************************************************/ -struct i2c_dev_s; -int ov2640_initialize(FAR struct i2c_dev_s *i2c); +struct i2c_master_s; +int ov2640_initialize(FAR struct i2c_master_s *i2c); #undef EXTERN #ifdef __cplusplus