lcd: Minor fixes to ssd1306 i2c driver

The sendblk function was missing NOSTOP on the first msg of the
i2c transaction. This could cause an extra STOP to be inserted
in the transaction.

The driver uses up_mdelay for some timing where it should be
using a sleep.

Signed-off-by: Brennan Ashton <bashton@brennanashton.com>
This commit is contained in:
Brennan Ashton 2020-11-01 22:46:04 -08:00 committed by Xiang Xiao
parent c0b4bd2f85
commit b459645105
2 changed files with 3 additions and 3 deletions

View file

@ -927,7 +927,7 @@ static int ssd1306_configuredisplay(struct ssd1306_dev_s *priv)
/* Configure OLED SPI or I/O, must be delayed 1-10ms */
up_mdelay(5);
nxsig_usleep(5000);
/* Configure the device */
@ -1323,7 +1323,7 @@ static int ssd1306_configuredisplay(struct ssd1306_dev_s *priv)
ssd1306_select(priv, false);
up_mdelay(100);
nxsig_usleep(100000);
priv->is_conf = true;
return OK;

View file

@ -131,7 +131,7 @@ int ssd1306_sendblk(FAR struct ssd1306_dev_s *priv, uint8_t *data, uint8_t len)
msg[0].frequency = CONFIG_SSD1306_I2CFREQ; /* I2C frequency */
msg[0].addr = priv->addr; /* 7-bit address */
msg[0].flags = 0; /* Write transaction, beginning with START */
msg[0].flags = I2C_M_NOSTOP; /* Write transaction, beginning with START */
msg[0].buffer = &transfer_mode; /* Transfer mode send */
msg[0].length = 1; /* Send the one byte register address */