Skip to content

Commit

Permalink
arch: cxd56xx: Improve i2c initialize function
Browse files Browse the repository at this point in the history
During I2C communication between non-Spresense devices is performed,
the I2C bus may freeze after initialization of the Spresense I2C.
As a workaround, switch the pin mode to I2C at the end of the i2c
initialization function.

Signed-off-by: SPRESENSE <[email protected]>
  • Loading branch information
SPRESENSE authored and jerpelea committed Feb 25, 2025
1 parent d521b92 commit 96de2e2
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions arch/arm/src/cxd56xx/cxd56_i2c.c
Original file line number Diff line number Diff line change
Expand Up @@ -1140,10 +1140,6 @@ struct i2c_master_s *cxd56_i2cbus_initialize(int port)

cxd56_i2c_setfrequency(priv, I2C_DEFAULT_FREQUENCY);

/* Configure pin */

cxd56_i2c_pincontrol(port, true);

/* Attach Interrupt Handler */

irq_attach(priv->irqid, cxd56_i2c_interrupt, priv);
Expand All @@ -1164,6 +1160,10 @@ struct i2c_master_s *cxd56_i2cbus_initialize(int port)

cxd56_i2c_clock_gate_enable(port);

/* Configure pin */

cxd56_i2c_pincontrol(port, true);

nxmutex_unlock(&priv->lock);
return &priv->dev;
}
Expand Down

0 comments on commit 96de2e2

Please sign in to comment.