# HG changeset patch # User vae # Date 1366993520 0 # Node ID 3c3317a0eeb2273ad8ab87e8358bcf02f9a0f379 # Parent e10148c0a53592b7310a3c7b6fc60de9d8cd0804 Add CYGBLD_I2C_DEVICE_CONST. This will allow driver to modify cyg_i2c_device streucture. [ Bugzilla 1001816 ] diff --git a/packages/io/i2c/current/ChangeLog b/packages/io/i2c/current/ChangeLog --- a/packages/io/i2c/current/ChangeLog +++ b/packages/io/i2c/current/ChangeLog @@ -1,3 +1,8 @@ +2013-04-10 Ilija Kocho * cdl/i2c.cdl, src/i2c.cxx, doc/i2c.sgml: I2C buses now initialize diff --git a/packages/io/i2c/current/include/i2c.h b/packages/io/i2c/current/include/i2c.h --- a/packages/io/i2c/current/include/i2c.h +++ b/packages/io/i2c/current/include/i2c.h @@ -82,6 +82,10 @@ typedef struct cyg_i2c_device { // The information needed for interacting over a particular I2C bus. // Most hardware will only have one bus, but multiple buses are // supported. Thread synchronization happens on a per-bus level. +#ifndef CYGBLD_I2C_DEVICE_CONST +#define CYGBLD_I2C_DEVICE_CONST const +#endif + typedef struct cyg_i2c_bus { cyg_drv_mutex_t i2c_lock; #ifdef CYGDBG_USE_ASSERTS @@ -89,8 +93,8 @@ typedef struct cyg_i2c_bus { #endif // The hardware-specific functions that do the real work void (*i2c_init_fn)(struct cyg_i2c_bus*); - cyg_uint32 (*i2c_tx_fn)(const cyg_i2c_device*, cyg_bool, const cyg_uint8*, cyg_uint32, cyg_bool); - cyg_uint32 (*i2c_rx_fn)(const cyg_i2c_device*, cyg_bool, cyg_uint8*, cyg_uint32, cyg_bool, cyg_bool); + cyg_uint32 (*i2c_tx_fn)(CYGBLD_I2C_DEVICE_CONST cyg_i2c_device*, cyg_bool, const cyg_uint8*, cyg_uint32, cyg_bool); + cyg_uint32 (*i2c_rx_fn)(CYGBLD_I2C_DEVICE_CONST cyg_i2c_device*, cyg_bool, cyg_uint8*, cyg_uint32, cyg_bool, cyg_bool); void (*i2c_stop_fn)(const cyg_i2c_device*); // A spare field for use by the driver void* i2c_extra;