Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
moononournation committed Feb 4, 2024
1 parent 999e1f9 commit dd5ae79
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 17 deletions.
9 changes: 6 additions & 3 deletions src/databus/Arduino_ESP32LCD16.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -176,12 +176,15 @@ void Arduino_ESP32LCD16::writeCommand16(uint16_t c)

void Arduino_ESP32LCD16::writeCommandBytes(uint8_t *data, uint32_t len)
{
DC_LOW();
LCD_CAM.lcd_misc.val = LCD_CAM_LCD_CD_IDLE_EDGE | LCD_CAM_LCD_CD_CMD_SET;

while (len--)
{
WRITECOMMAND16(*data++);
LCD_CAM.lcd_cmd_val.val = *data++;
WAIT_LCD_NOT_BUSY;
LCD_CAM.lcd_user.val = LCD_CAM_LCD_2BYTE_EN | LCD_CAM_LCD_CMD | LCD_CAM_LCD_UPDATE_REG | LCD_CAM_LCD_START;
}
DC_HIGH();
LCD_CAM.lcd_misc.val = LCD_CAM_LCD_CD_IDLE_EDGE;
}

void Arduino_ESP32LCD16::write(uint8_t d)
Expand Down
5 changes: 1 addition & 4 deletions src/databus/Arduino_ESP32LCD8.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -233,13 +233,10 @@ void Arduino_ESP32LCD8::writeCommandBytes(uint8_t *data, uint32_t len)

while (len--)
{
_data16.value = p;
_data16.value = *data++;
LCD_CAM.lcd_cmd_val.lcd_cmd_value = _data16.msb;
WAIT_LCD_NOT_BUSY;
LCD_CAM.lcd_user.val = LCD_CAM_LCD_CMD | LCD_CAM_LCD_UPDATE_REG | LCD_CAM_LCD_START;
LCD_CAM.lcd_cmd_val.lcd_cmd_value = _data16.lsb;
WAIT_LCD_NOT_BUSY;
LCD_CAM.lcd_user.val = LCD_CAM_LCD_CMD | LCD_CAM_LCD_UPDATE_REG | LCD_CAM_LCD_START;
}

LCD_CAM.lcd_misc.val = LCD_CAM_LCD_CD_IDLE_EDGE;
Expand Down
22 changes: 16 additions & 6 deletions src/databus/Arduino_ESP32QSPI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -165,14 +165,24 @@ void Arduino_ESP32QSPI::writeCommand16(uint16_t c)

void Arduino_ESP32QSPI::writeCommandBytes(uint8_t *data, uint32_t len)
{
DC_LOW();

while (len--)
CS_LOW();
uint32_t l;
bool first_send = true;
while (len)
{
WRITE(*data++);
}
l = (len >= (ESP32QSPI_MAX_PIXELS_AT_ONCE << 1)) ? (ESP32QSPI_MAX_PIXELS_AT_ONCE << 1) : len;

DC_HIGH();
_spi_tran_ext.base.flags = SPI_TRANS_MULTILINE_CMD | SPI_TRANS_MULTILINE_ADDR;
_spi_tran_ext.base.tx_buffer = data;
_spi_tran_ext.base.length = l << 3;

POLL_START();
POLL_END();

len -= l;
data += l;
}
CS_HIGH();
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/databus/Arduino_ESP32SPI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,7 @@ void Arduino_ESP32SPI::writeCommandBytes(uint8_t *data, uint32_t len)

while (len--)
{
WRITE(*data++);
WRITE8BIT(*data++);
}

DC_HIGH();
Expand Down
2 changes: 1 addition & 1 deletion src/databus/Arduino_ESP32SPIDMA.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ void Arduino_ESP32SPIDMA::writeCommandBytes(uint8_t *data, uint32_t len)
DC_LOW();
while (len--)
{
WRITE(*data++);
WRITE8BIT(*data++);
}
DC_HIGH();
}
Expand Down
2 changes: 1 addition & 1 deletion src/display/Arduino_SH1106.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ bool Arduino_SH1106::begin(int32_t speed)
// WRITE_COMMAND_16, SH110X_MEMORYMODE, 0x10, // 0x20, 0x10
// WRITE_COMMAND_8, SH110X_DISPLAYALLON_RESUME, // 0xA4

WRITE_COMMANDS, 25,
WRITE_COMMAND_BYTES, 25,
SH110X_DISPLAYOFF,
SH110X_SETDISPLAYCLOCKDIV, 0x80, // 0xD5, 0x80,
SH110X_SETMULTIPLEX, 0x3F, // 0xA8, 0x3F,
Expand Down
2 changes: 1 addition & 1 deletion src/display/Arduino_SSD1306.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ bool Arduino_SSD1306::begin(int32_t speed)

static const uint8_t init_sequence[] = {
BEGIN_WRITE,
WRITE_COMMANDS, 25,
WRITE_COMMAND_BYTES, 25,
SSD1306_DISPLAYOFF, // 0xAE
SSD1306_SETCONTRAST, _contrast, // 0x81 nn
SSD1306_NORMALDISPLAY, // 0xA6
Expand Down

0 comments on commit dd5ae79

Please sign in to comment.