Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const esp_partition_t* part;
- spi_flash_mmap_handle_t handle;
- void* data;
- esp_err_t err;
- void setup() {
- part = esp_partition_find_first(ESP_PARTITION_TYPE_DATA, ESP_PARTITION_SUBTYPE_ANY, "storage");
- esp_partition_find(ESP_PARTITION_TYPE_DATA,ESP_PARTITION_SUBTYPE_ANY, "storage");
- err = esp_partition_mmap(part, 0, part->size, SPI_FLASH_MMAP_DATA, (const void**)&data, &handle);
- if (err != ESP_OK)
- {
- printf("esp_partition_mmap failed. (%d)\n", err);
- //delay(10000);
- abort();
- }
- //Example for Display data without overhead:
- vspi->beginTransaction(SPISettings(spiClk, MSBFIRST, SPI_MODE0));
- digitalWrite(5, LOW); //pull SS slow to prep other end for transfer
- unsigned long offset=0;
- //Access Partition on StartByte 0, sending Bytes directly to SPI Display
- vspi->writeBytes((uint8_t*)data + offset, width*height * 3);
- digitalWrite(5, HIGH); //pull ss high
- }
- }
- void loop(){
- }
Advertisement
Add Comment
Please, Sign In to add comment