mirror of
https://github.com/apache/nuttx.git
synced 2026-06-02 01:21:26 +08:00
I2C: Eliminate the I2C_WRITEREAD method
This commit is contained in:
@@ -11370,5 +11370,6 @@
|
|||||||
* drivers/ioexpander/pca9555: Convert to use I2C_TRANSFER vs. I2C_WRITEREAD,
|
* drivers/ioexpander/pca9555: Convert to use I2C_TRANSFER vs. I2C_WRITEREAD,
|
||||||
the former is thread safe while the latter is deprecated (2016-01-26).
|
the former is thread safe while the latter is deprecated (2016-01-26).
|
||||||
* drivers/i2c/i2c_writeread.c: Create a wrapper that uses I2C_TRANSFER
|
* drivers/i2c/i2c_writeread.c: Create a wrapper that uses I2C_TRANSFER
|
||||||
to implement I2C_WRITEREAD functionalit (2016-01-26).
|
to implement I2C_WRITEREAD functionality (2016-01-26).
|
||||||
|
* I2C: Eliminate the I@C_WRITEREAD method (2016-01-26).
|
||||||
|
|
||||||
|
|||||||
@@ -1614,7 +1614,7 @@ o Other drivers (drivers/)
|
|||||||
in a multi-tasking I2C environment:
|
in a multi-tasking I2C environment:
|
||||||
- I2C_SETFREQUENCY: Frequency setting can be overwritten by other
|
- I2C_SETFREQUENCY: Frequency setting can be overwritten by other
|
||||||
I2C usage.
|
I2C usage.
|
||||||
- I2C_SETADDRESS used with I2C_READ, I2C_WRITE, and I2C_WRITEREAD:
|
- I2C_SETADDRESS used with I2C_READ and I2C_WRITE:
|
||||||
Similarly, address can and will be changed by other I2C usage.
|
Similarly, address can and will be changed by other I2C usage.
|
||||||
NOTE also that I2C_SETADDRESS also sets the address width (either
|
NOTE also that I2C_SETADDRESS also sets the address width (either
|
||||||
7 or 10 bits).
|
7 or 10 bits).
|
||||||
@@ -1627,7 +1627,7 @@ o Other drivers (drivers/)
|
|||||||
as is provided with the SPI interface, or (2) make each interface
|
as is provided with the SPI interface, or (2) make each interface
|
||||||
self-contained and atomic: Remove the I2C_FREQUENCY and I2C_ADDRESS
|
self-contained and atomic: Remove the I2C_FREQUENCY and I2C_ADDRESS
|
||||||
methods; Add frequency to all interfaces and add the address to
|
methods; Add frequency to all interfaces and add the address to
|
||||||
I2C_READ, I2C_WRITE, and I2C_WRITEREAD.
|
I2C_READ and I2C_WRITE.
|
||||||
|
|
||||||
o Linux/Cywgin simulation (arch/sim)
|
o Linux/Cywgin simulation (arch/sim)
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|||||||
+1
-1
Submodule arch updated: 17e8a324c8...40aba37060
+1
-1
Submodule configs updated: 927eaf0772...e569b357a2
@@ -13,10 +13,6 @@ config I2C_TRANSFER
|
|||||||
bool "Support the I2C transfer() method"
|
bool "Support the I2C transfer() method"
|
||||||
default n
|
default n
|
||||||
|
|
||||||
config I2C_WRITEREAD
|
|
||||||
bool "Support the I2C writeread() method"
|
|
||||||
default n
|
|
||||||
|
|
||||||
config I2C_POLLED
|
config I2C_POLLED
|
||||||
bool "Polled I2C (no interrupts)"
|
bool "Polled I2C (no interrupts)"
|
||||||
default n
|
default n
|
||||||
|
|||||||
@@ -63,8 +63,8 @@
|
|||||||
/* Prerequisites:
|
/* Prerequisites:
|
||||||
* CONFIG_I2C
|
* CONFIG_I2C
|
||||||
* I2C support is required
|
* I2C support is required
|
||||||
* CONFIG_I2C_WRITEREAD
|
* CONFIG_I2C_TRANSFER
|
||||||
* Support for the I2C writeread method is required.
|
* Support for the I2C transfer method is required.
|
||||||
* CONFIG_IOEXPANDER
|
* CONFIG_IOEXPANDER
|
||||||
* Enables support for the PCA9555 I/O expander
|
* Enables support for the PCA9555 I/O expander
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -334,7 +334,7 @@ int up_rtc_getdatetime(FAR struct tm *tp)
|
|||||||
|
|
||||||
I2C_SETFREQUENCY(g_ds3231.i2c, CONFIG_DS3231_I2C_FREQUENCY);
|
I2C_SETFREQUENCY(g_ds3231.i2c, CONFIG_DS3231_I2C_FREQUENCY);
|
||||||
|
|
||||||
/* Perform the transfer (This could be done with I2C_WRITEREAD()). The
|
/* Perform the transfer (This could be done with i2c_writeread()). The
|
||||||
* transfer may be performed repeatedly of the seconds values decreases,
|
* transfer may be performed repeatedly of the seconds values decreases,
|
||||||
* meaning that that was a rollover in the seconds.
|
* meaning that that was a rollover in the seconds.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -333,7 +333,7 @@ int up_rtc_getdatetime(FAR struct tm *tp)
|
|||||||
|
|
||||||
I2C_SETFREQUENCY(g_pcf85263.i2c, CONFIG_PCF85263_I2C_FREQUENCY);
|
I2C_SETFREQUENCY(g_pcf85263.i2c, CONFIG_PCF85263_I2C_FREQUENCY);
|
||||||
|
|
||||||
/* Perform the transfer (This could be done with I2C_WRITEREAD()). The
|
/* Perform the transfer (This could be done with i2c_writeread()). The
|
||||||
* transfer may be performed repeatedly of the seconds values decreases,
|
* transfer may be performed repeatedly of the seconds values decreases,
|
||||||
* meaning that that was a rollover in the seconds.
|
* meaning that that was a rollover in the seconds.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -195,28 +195,6 @@
|
|||||||
|
|
||||||
#define I2C_READ(d,b,l) ((d)->ops->read(d,b,l))
|
#define I2C_READ(d,b,l) ((d)->ops->read(d,b,l))
|
||||||
|
|
||||||
/****************************************************************************
|
|
||||||
* Name: I2C_WRITEREAD
|
|
||||||
*
|
|
||||||
* Description:
|
|
||||||
* Send a block of data on I2C using the previously selected I2C
|
|
||||||
* frequency and slave address, followed by restarted read access.
|
|
||||||
* It provides a convenient wrapper to the transfer function.
|
|
||||||
*
|
|
||||||
* Input Parameters:
|
|
||||||
* dev - Device-specific state data
|
|
||||||
* wbuffer - A pointer to the read-only buffer of data to be written to device
|
|
||||||
* wbuflen - The number of bytes to send from the buffer
|
|
||||||
* rbuffer - A pointer to a buffer of data to receive the data from the device
|
|
||||||
* rbuflen - The requested number of bytes to be read
|
|
||||||
*
|
|
||||||
* Returned Value:
|
|
||||||
* 0: success, <0: A negated errno
|
|
||||||
*
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
#define I2C_WRITEREAD(d,wb,wl,rb,rl) ((d)->ops->writeread(d,wb,wl,rb,rl))
|
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Name: I2C_TRANSFER
|
* Name: I2C_TRANSFER
|
||||||
*
|
*
|
||||||
@@ -253,11 +231,6 @@ struct i2c_ops_s
|
|||||||
int (*write)(FAR struct i2c_dev_s *dev, const uint8_t *buffer,
|
int (*write)(FAR struct i2c_dev_s *dev, const uint8_t *buffer,
|
||||||
int buflen);
|
int buflen);
|
||||||
int (*read)(FAR struct i2c_dev_s *dev, uint8_t *buffer, int buflen);
|
int (*read)(FAR struct i2c_dev_s *dev, uint8_t *buffer, int buflen);
|
||||||
#ifdef CONFIG_I2C_WRITEREAD
|
|
||||||
int (*writeread)(FAR struct i2c_dev_s *dev,
|
|
||||||
FAR const uint8_t *wbuffer, int wbuflen,
|
|
||||||
FAR uint8_t *rbuffer, int rbuflen);
|
|
||||||
#endif
|
|
||||||
#ifdef CONFIG_I2C_TRANSFER
|
#ifdef CONFIG_I2C_TRANSFER
|
||||||
int (*transfer)(FAR struct i2c_dev_s *dev, FAR struct i2c_msg_s *msgs,
|
int (*transfer)(FAR struct i2c_dev_s *dev, FAR struct i2c_msg_s *msgs,
|
||||||
int count);
|
int count);
|
||||||
|
|||||||
Reference in New Issue
Block a user