Anonymous avatar Anonymous committed f11d75b

Updated i2c eeprom documentation.

Comments (0)

Files changed (1)

  **/
 BOOL i2c_write ( BYTE addr, WORD len1, BYTE* addr_buf, WORD len2, BYTE* data_buf );
 
+/**
+ * \brief read data on the i2c bus.
+ *
+ * \param addr i2c address
+ * \param len number of bytes to read
+ * \param buf buffer to store data
+ **/
 BOOL i2c_read ( BYTE addr, WORD len, BYTE* buf);
 
+/**
+ * \brief read data from an attached eeprom.
+ *
+ * Writes the address of the data to read then reads len bytes into buf.
+ * This function checks the I2CS register to determine if a one or two
+ * byte address eepom was detected on the i2c bus.  Reading from proms
+ * at non-standard addresses my require using the i2c_read/write commands
+ * explicitly.
+ *
+ * \param prom_addr eeprom i2c address
+ * \param addr address of bytes to start reading
+ * \param len number of bytes to read
+ * \param buf data buffer
+ **/
 BOOL eeprom_read( BYTE prom_addr, WORD addr, WORD len, BYTE* buf);
 
+/**
+ * \brief write data to the eeprom
+ *
+ * This function checks the I2CS register to determin if a one or two
+ * two byte eeprom is detected.  If the prom is not detected at boot time
+ * or is connected to alternate addresses, the i2c_read/write commands should
+ * be used explicitly insread of using this function.
+ *
+ * For each byte in buf, the address is written and then the data byte. Many 
+ * proms support writing multiple bytes at the same time.  For these, it is
+ * also better to use i2c_read/write explicitly.  This function is rather slow
+ * but is effective.
+ *
+ * \param prom_addr eeprom i2c address
+ * \param addr address of bytes to start writing
+ * \param len number of bytes to write
+ * \param buf data buffer
+ **/
 BOOL eeprom_write( BYTE prom_addr, WORD addr, WORD len, BYTE* buf);
 
 #endif
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.