Store.O.128
Store.O.128 tile driver — Renesas/Adesto AT25QL128A 128 Mbit QSPI NOR flash.
16 MB serial NOR flash on SPI / Quad-SPI. Standard SPI-NOR command set: JEDEC ID, status, write-enable, page program (256 B pages), 4 KB sector / 64 KB block / chip erase, read, deep power-down.
Platform-agnostic: uses the framework's raw SPI transaction primitive (`tiles_pal_t.spi_transfer`) so command + 24-bit address + data fit one CS assertion. A platform that doesn't implement spi_transfer yet leaves it NULL; every call here guards against that and reports an error rather than faulting.
Examples
Quick start
#include "core_tiles.h"
tile_t flash;
uint8_t buf[256];
tile_store_o_128_init(core_tiles_pal(&core_spi1), 0, &flash, NULL);
if (tile_is_ready(&flash)) {
tile_store_o_128_read(&flash, 0x000000, buf, sizeof buf);
}API reference
Initialization
tile_store_o_128_find
uint8_t tile_store_o_128_find(tiles_pal_t* hal, uint8_t instance)Probe instance `instance`: reads the JEDEC ID, returns 1 if it matches.
tile_store_o_128_init
void tile_store_o_128_init(tiles_pal_t* hal, uint8_t instance, tile_t* tile, const store_o_128_cfg_t* cfg)Initialize: verify JEDEC identity, wake from deep power-down.
Lifecycle
tile_store_o_128_deep_power_down
Studiovoid tile_store_o_128_deep_power_down(tile_t* tile)Enter Deep Power-Down (lowest standby current; commands ignored).
tile_store_o_128_release
Studiovoid tile_store_o_128_release(tile_t* tile)Release from Deep Power-Down.
Runtime
tile_store_o_128_read_jedec_id
Studiouint32_t tile_store_o_128_read_jedec_id(tile_t* tile)Read the 24-bit JEDEC ID (manufacturer << 16 | type << 8 | capacity).
Returns Packed JEDEC ID (e.g. 0x1F4218 for the AT25QL128A).
tile_store_o_128_read_status
Studiouint8_t tile_store_o_128_read_status(tile_t* tile)Read Status Register 1.
Returns SR1 byte (AT25QL128A_SR1_* bits).
tile_store_o_128_is_busy
Studiouint8_t tile_store_o_128_is_busy(tile_t* tile)Whether a program/erase is in progress (WIP bit).
Returns 1 if busy, 0 if idle.
tile_store_o_128_get_capacity
Studiouint32_t tile_store_o_128_get_capacity(tile_t* tile)Total flash capacity in bytes.
Returns 16777216 (16 MB).
tile_store_o_128_read
Studiovoid tile_store_o_128_read(tile_t* tile, uint32_t addr, uint8_t* buf, uint16_t len)Read `len` bytes starting at `addr` (READ 0x03).
- addr
- Byte address (0 .. capacity-1).
- buf
- Output buffer.
- len
- Number of bytes.
tile_store_o_128_fast_read
Studiovoid tile_store_o_128_fast_read(tile_t* tile, uint32_t addr, uint8_t* buf, uint16_t len)Fast-read `len` bytes from `addr` (FAST_READ 0x0B, 1 dummy byte).
tile_store_o_128_page_program
Studiovoid tile_store_o_128_page_program(tile_t* tile, uint32_t addr, const uint8_t* buf, uint16_t len)Issues Write-Enable, programs, and waits for completion. The caller must keep the write inside one 256-byte page (addr & 0xFF) + len ≤ 256.
- addr
- Start address.
- buf
- Data to program.
- len
- Byte count (1..256).
tile_store_o_128_write
Studiovoid tile_store_o_128_write(tile_t* tile, uint32_t addr, const uint8_t* buf, uint32_t len)Program an arbitrary-length span, splitting across page boundaries.
tile_store_o_128_erase_sector
Studiovoid tile_store_o_128_erase_sector(tile_t* tile, uint32_t addr)Erase the 4 KB sector containing `addr` (and wait).
tile_store_o_128_erase_block
Studiovoid tile_store_o_128_erase_block(tile_t* tile, uint32_t addr)Erase the 64 KB block containing `addr` (and wait).
tile_store_o_128_erase_chip
Studiovoid tile_store_o_128_erase_chip(tile_t* tile)Erase the entire chip (and wait).
tile_store_o_128_wait_ready
Studiouint8_t tile_store_o_128_wait_ready(tile_t* tile, uint32_t timeout_ms)Block until any in-progress program/erase finishes, or timeout.
- timeout_ms
- Max wait.
Returns 1 if ready, 0 if timed out.
Config
tile_store_o_128_write_enable
Studiovoid tile_store_o_128_write_enable(tile_t* tile)Issue Write-Enable (sets WEL). Required before any program/erase.
Driver gaps · 1
Chip capabilities this driver doesn’t expose yet.
Constants
| TILE_STORE_O_128_VERSION_MAJOR | 1 | |
| TILE_STORE_O_128_VERSION_MINOR | 0 | |
| TILE_STORE_O_128_VERSION_PATCH | 0 | |
| AT25QL128A_CAPACITY | 0x1000000 | |
| AT25QL128A_PAGE_SIZE | 256 | |
| AT25QL128A_SECTOR_SIZE | 4096 | |
| AT25QL128A_BLOCK_SIZE | 65536 | |
| AT25QL128A_MFR_ID | 0x1F | Adesto / Renesas manufacturer |
| AT25QL128A_CAPACITY_ID | 0x18 | 2^24 bytes density code |
| AT25QL128A_CMD_WREN | 0x06 | Write Enable |
| AT25QL128A_CMD_WRDI | 0x04 | Write Disable |
| AT25QL128A_CMD_RDID | 0x9F | Read JEDEC ID (3 bytes) |
| AT25QL128A_CMD_RDSR1 | 0x05 | Read Status Register 1 |
| AT25QL128A_CMD_RDSR2 | 0x35 | Read Status Register 2 |
| AT25QL128A_CMD_WRSR | 0x01 | Write Status Register |
| AT25QL128A_CMD_READ | 0x03 | Read Data (cmd + 24-bit addr) |
| AT25QL128A_CMD_FAST_READ | 0x0B | Fast Read (+1 dummy byte) |
| AT25QL128A_CMD_PP | 0x02 | Page Program |
| AT25QL128A_CMD_SE | 0x20 | Sector Erase (4 KB) |
| AT25QL128A_CMD_BE | 0xD8 | Block Erase (64 KB) |
| AT25QL128A_CMD_CE | 0xC7 | Chip Erase |
| AT25QL128A_CMD_DP | 0xB9 | Deep Power-Down |
| AT25QL128A_CMD_RDP | 0xAB | Release from Deep Power-Down |
| AT25QL128A_SR1_WIP | 0x01 | Write In Progress (busy) |
| AT25QL128A_SR1_WEL | 0x02 | Write Enable Latch |

