*/
static struct I2C_MASTER_CONTROL_TYPE i2c_control[I2CNUM];
+static char * i2c_strerror( ER ercd )
+{
+ ercd &= 0xFFFF0000;
+ switch (ercd)
+ {
+ case I2C_ERR_WRONGPARAM :
+ return("I2C_ERR_WRONGPARAM");
+ case I2C_ERR_TOOLONGBUFFER :
+ return("I2C_ERR_TOOLONGBUFFER");
+ case I2C_ERR_TIMEOUT :
+ return ("I2C_ERR_TIMEOUT");
+ }
+ return ("I2C_ERR_UNKNOWN");
+}
+
+
+void
+i2c_perror(UINT prio, const char *file, int line, const char *expr, ER ercd)
+{
+ syslog_5(prio, "%s reported by `%s' in line %d of `%s'. Interrupt Status = %04x",
+ i2c_strerror(ercd), expr, line, file, ercd & 0xFFFF);
+}
+
int i2c_master_write( int peripheral, int slave, unsigned char write_data[], int write_count )
{