changeset 1972:87342fcfea2d

Apply misc fixes provided by Peter Korsgaard, and another doc fix. Add a CYG_HAL_TABLE_TYPE to the bus data structure to allow for architectures with alignments > 4 bytes
author bartv
date Sat, 14 May 2005 09:31:02 +0000
parents 915ac9ca447f
children d00e4aed2aa2
files packages/io/i2c/current/ChangeLog packages/io/i2c/current/doc/i2c.sgml packages/io/i2c/current/include/i2c.h packages/io/i2c/current/src/i2c.cxx
diffstat 4 files changed, 36 insertions(+), 16 deletions(-) [+]
line wrap: on
line diff
--- a/packages/io/i2c/current/ChangeLog
+++ b/packages/io/i2c/current/ChangeLog
@@ -1,3 +1,23 @@
+2005-05-11  Bart Veer  <bartv@ecoscentric.com>
+
+	* include/i2c.h: add a CYG_HAL_TABLE_TYPE to the bus data
+	structure to allow for architectures with alignments > 4 bytes.
+
+2005-04-28  Peter Korsgaard  <jacmet@sunsite.dk>
+
+	* doc/i2c.sgml: Corrected cyg_i2c_rx, cyg_i2c_transaction_rx and	
+	xyzzy_i2c_rx prototype. Removed continuation character in
+	CYG_I2C_DEVICE example.
+
+2005-04-28  Peter Korsgaard  <jacmet@sunsite.dk>
+ 
+ 	* src/i2c.cxx: Corrected DEBUG macro.
+ 
+2005-04-28  Peter Korsgaard  <jacmet@sunsite.dk>
+ 
+ 	* src/i2c.cxx: Renamed cyg_i2c_stop to cyg_i2c_transaction_stop to
+ 	match header file.	
+ 
 2005-04-21  Andrew Lunn  <andrew.lunn@ascom.ch>
 
 	* doc/i2c.sgml: Replaced a _ with a - to keep jade happy.
--- a/packages/io/i2c/current/doc/i2c.sgml
+++ b/packages/io/i2c/current/doc/i2c.sgml
@@ -231,7 +231,7 @@ application code.
       <funcprototype>
         <funcdef>cyg_uint32 <function>cyg_i2c_rx</function></funcdef>
         <paramdef>const cyg_i2c_device* <parameter>device</parameter></paramdef>
-        <paramdef>const cyg_uint8* <parameter>tx_data</parameter></paramdef>
+        <paramdef>cyg_uint8* <parameter>rx_data</parameter></paramdef>
         <paramdef>cyg_uint32 <parameter>count</parameter></paramdef>
       </funcprototype>
       <funcprototype>
@@ -254,7 +254,7 @@ application code.
         <funcdef>cyg_uint32 <function>cyg_i2c_transaction_rx</function></funcdef>
         <paramdef>const cyg_i2c_device* <parameter>device</parameter></paramdef>
         <paramdef>cyg_bool <parameter>send_start</parameter></paramdef>
-        <paramdef>const cyg_uint8* <parameter>tx_data</parameter></paramdef>
+        <paramdef>cyg_uint8* <parameter>rx_data</parameter></paramdef>
         <paramdef>cyg_uint32 <parameter>count</parameter></paramdef>
         <paramdef>cyg_bool <parameter>send_nack</parameter></paramdef>
         <paramdef>cyg_bool <parameter>send_stop</parameter></paramdef>
@@ -641,16 +641,16 @@ provided by <filename class="headerfile"
     <programlisting width=72>
 #include &lt;cyg/io/i2c.h&gt;
 
-CYG_I2C_DEVICE(cyg_i2c_wallclock_ds1307,            \
-               &amp;hal_alaia_i2c_bus,                  \
-               0x68,                                \
-               0x00,                                \
+CYG_I2C_DEVICE(cyg_i2c_wallclock_ds1307,
+               &amp;hal_alaia_i2c_bus,
+               0x68,
+               0x00,
                CYG_I2C_DEFAULT_DELAY);
 
-CYG_I2C_DEVICE(hal_alaia_i2c_fs6377,                \
-               &amp;hal_alaia_i2c_bus,                  \
-               0x58,                                \
-               0x00,                                \
+CYG_I2C_DEVICE(hal_alaia_i2c_fs6377,
+               &amp;hal_alaia_i2c_bus,
+               0x58,
+               0x00,
                CYG_I2C_DEFAULT_DELAY);
     </programlisting>
     <para>
@@ -906,10 +906,10 @@ xyzzy_i2c_tx(const cyg_i2c_device* dev,
 }
 
 static cyg_uint32
-xyzzy_i2c_tx(const cyg_i2c_device* dev,
+xyzzy_i2c_rx(const cyg_i2c_device* dev,
              cyg_bool send_start,
-             const cyg_uint8* tx_data, cyg_uint32 count,
-             cyg_bool send_stop)
+             cyg_uint8* rx_data, cyg_uint32 count,
+             cyg_bool send_nack, cyg_bool send_stop)
 {
     &hellip;
 }
--- a/packages/io/i2c/current/include/i2c.h
+++ b/packages/io/i2c/current/include/i2c.h
@@ -92,7 +92,7 @@ typedef struct cyg_i2c_bus {
     void                    (*i2c_stop_fn)(const cyg_i2c_device*);
     // A spare field for use by the driver
     void*                   i2c_extra;
-} cyg_i2c_bus;
+} CYG_HAL_TABLE_TYPE cyg_i2c_bus;
 
 #define CYG_I2C_BUS(_name_, _init_fn_, _tx_fn_, _rx_fn_, _stop_fn_, _extra_)    \
     cyg_i2c_bus _name_  CYG_HAL_TABLE_ENTRY( i2c_buses ) = {                    \
--- a/packages/io/i2c/current/src/i2c.cxx
+++ b/packages/io/i2c/current/src/i2c.cxx
@@ -216,7 +216,7 @@ cyg_i2c_transaction_rx(const cyg_i2c_dev
 }
 
 extern "C" void
-cyg_i2c_stop(const cyg_i2c_device* dev)
+cyg_i2c_transaction_stop(const cyg_i2c_device* dev)
 {
     cyg_i2c_bus*    bus;
     
@@ -237,7 +237,7 @@ cyg_i2c_stop(const cyg_i2c_device* dev)
 #if 1
 # define DEBUG(_format_, ...)
 #else
-# define DEBUG(_format_, ...) diag_printf(format, ## __VA_ARGS__)
+# define DEBUG(_format_, ...) diag_printf(_format_, ## __VA_ARGS__)
 #endif