| Crates.io | w25qxxxjv |
| lib.rs | w25qxxxjv |
| version | 0.1.1 |
| created_at | 2025-07-05 18:43:39.30645+00 |
| updated_at | 2025-07-07 14:10:55.939495+00 |
| description | A minimal yet powerful Rust driver for Winbond W25QxxJV SPI flash chips, supporting standard, fast, dual, and quad SPI modes, dynamic erase sizing, sector protection, and page-aligned programming. Designed with embedded-hal and 24-bit addressing in mind—great for Q32, Q64, Q128 devices. |
| homepage | |
| repository | https://github.com/CosmoBunny/w25qxxxjv |
| max_upload_size | |
| id | 1739378 |
| size | 29,733 |
Rust driver for Winbond W25QxxJV SPI flash devices (W25Q32JV / W25Q64JV / W25Q128JV), built for no-std targets with embedded-hal.
use w25qxxxjv::{
W25QXXXJV, SpiSpeed, Model, Portion, Part
};
# // `spi`, `cs_pin`, and `timer` must implement embedded-hal traits
let mut w25q = W25QXXXJV::new(
spi,
pins.gpio13.into_push_pull_output(),
SpiSpeed::Single,
Model::Q128,
&mut timer,
).unwrap();
// 1. Disable all protection (BP2:0 = 000, SEC = 0, TB = 0, CMP = 0)
w25q.protect_portion(Portion::Upper, Part::Zero, false).unwrap();
// 2. Write “Hello World” at address 0x0000
w25q.write_program(0x0000, b"Hello World").unwrap();
// 3. Read it back
let mut buf = [0u8; 11];
w25q.read_data(0x0000, &mut buf).unwrap();
assert_eq!(&buf, b"Hello World");