Improvements and fixes
This commit is contained in:
parent
b6ac19a54d
commit
d27a2378b0
3 changed files with 126 additions and 11 deletions
|
|
@ -109,6 +109,46 @@ esp_err_t epd7in5_v3_init(epd7in5_v3_t *epd)
|
|||
return ESP_OK;
|
||||
}
|
||||
|
||||
esp_err_t epd7in5_v3_init_fast(epd7in5_v3_t *epd)
|
||||
{
|
||||
spi_device_interface_config_t devcfg = {
|
||||
.clock_speed_hz = 20 * 1000 * 1000, // 2 MHz
|
||||
.mode = 0, // SPI mode 0
|
||||
.spics_io_num = epd->pin_cs,
|
||||
.queue_size = 1,
|
||||
.flags = SPI_DEVICE_HALFDUPLEX // use .flags |= SPI_DEVICE_3WIRE if necessary
|
||||
};
|
||||
ESP_RETURN_ON_ERROR(spi_bus_add_device(epd->spi_host, &devcfg, &epd->spi), "add device", ret);
|
||||
|
||||
gpio_set_level(epd->pin_rst, 1);
|
||||
vTaskDelay(pdMS_TO_TICKS(20));
|
||||
gpio_set_level(epd->pin_rst, 0);
|
||||
vTaskDelay(pdMS_TO_TICKS(4));
|
||||
gpio_set_level(epd->pin_rst, 1);
|
||||
vTaskDelay(pdMS_TO_TICKS(20));
|
||||
|
||||
epd7in5_v3_send_command(epd, 0x50);
|
||||
epd7in5_v3_send_data(epd, 0x10);
|
||||
epd7in5_v3_send_data(epd, 0x07);
|
||||
|
||||
epd7in5_v3_send_command(epd, 0x04);
|
||||
vTaskDelay(pdMS_TO_TICKS(100));
|
||||
epd7in5_v3_busy_wait(epd);
|
||||
|
||||
epd7in5_v3_send_command(epd, 0x06);
|
||||
epd7in5_v3_send_data(epd, 0x27);
|
||||
epd7in5_v3_send_data(epd, 0x27);
|
||||
epd7in5_v3_send_data(epd, 0x18);
|
||||
epd7in5_v3_send_data(epd, 0x17);
|
||||
|
||||
epd7in5_v3_send_command(epd, 0xE0);
|
||||
epd7in5_v3_send_data(epd, 0x02);
|
||||
epd7in5_v3_send_command(epd, 0xE5);
|
||||
epd7in5_v3_send_data(epd, 0x5A);
|
||||
|
||||
return ESP_OK;
|
||||
}
|
||||
|
||||
esp_err_t epd7in5_v3_send_command(epd7in5_v3_t *epd, uint8_t cmd)
|
||||
{
|
||||
esp_err_t ret;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue