Merged in v01d/nuttx/ssd1306-128 (pull request #115)

This commit is contained in:
Gregory Nutt 2016-08-14 13:42:24 -06:00
commit ade02a513b
2 changed files with 7 additions and 7 deletions

View file

@ -159,7 +159,7 @@
# define SSD1306_DEV_PAGES 4 /* 4 pages */
# define SSD1306_DEV_CMNPAD 0x02 /* COM configuration */
#elif defined(CONFIG_LCD_SH1106_OLED_132)
# define SSD1306_DEV_NATIVE_XRES 132 /* Full 132 columns used */
# define SSD1306_DEV_NATIVE_XRES 128 /* Only 128 columns used, supporting 132 is a bit difficult */
# define SSD1306_DEV_NATIVE_YRES 64 /* 8 pages each 8 rows */
# define SSD1306_DEV_XOFFSET 0 /* Offset to logical column 0 */
# define SSD1306_DEV_PAGES 8 /* 8 pages */
@ -179,7 +179,7 @@
/* Bytes per logical row and actual device row */
#if defined(CONFIG_LCD_SH1106_OLED_132)
# define SSD1306_DEV_XSTRIDE ((SSD1306_DEV_XRES >> 3) + 4)
#define SSD1306_DEV_XSTRIDE (SSD1306_DEV_XRES >> 3)
#else
# define SSD1306_DEV_XSTRIDE (SSD1306_DEV_XRES >> 3)
#endif

View file

@ -115,22 +115,22 @@ void ssd1306_sendbyte(FAR struct ssd1306_dev_s *priv, uint8_t regval)
void ssd1306_sendblk(FAR struct ssd1306_dev_s *priv, uint8_t *data, uint8_t len)
{
struct i2c_msg_s msg[2];
uint8_t regaddr;
uint8_t transfer_mode;
int ret;
/* 8-bit data read sequence:
*
* Start - I2C_Write_Address - SSD1306_Reg_Address - SSD1306_Write_Data - STOP
* Start - I2C_Write_Address - Data transfer select - SSD1306_Write_Data - STOP
*/
/* Send the SSD1306 register address (with no STOP) */
regaddr = 0x40;
transfer_mode = 0x40; /* Select data transfer */
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].buffer = &regaddr; /* Transfer from this address */
msg[0].buffer = &transfer_mode; /* Transfer mode send */
msg[0].length = 1; /* Send the one byte register address */
/* Followed by the SSD1306 write data (with no RESTART, then STOP) */