Microchip 23x SRAM/NVSRAM embedded-hal SPI driver
This is a platform agnostic Rust driver for the 23x series serial SRAM/NVSRAM SPI memory chips,
based on the embedded-hal
traits.
See the Intro post.
This driver allows you to:
- Read a single byte from a memory address. See:
read_byte()
. - Read a 32-byte page starting on a memory address. See:
read_page()
. - Read an N-byte array starting on a memory address. See:
read_sequential()
. - Write a single byte to a memory address. See:
write_byte()
. - Write a 32-byte page starting on a memory address. See:
write_page()
. - Write an N-byte array starting on a memory address. See:
write_sequential()
. - Enable and disable transmission by managing the HOLD pin.
- Get/Set the operating mode/status register.
Read the API Documentation for more information.
Supported devices
Device | Memory bytes | Memory bits | HOLD pin | Datasheet |
---|---|---|---|---|
M23x640 | 8 KB | 64 Kbit | yes | 23A640/23K640 |
M23x256 | 32 KB | 256 Kbit | yes | 23A256/23K256 |
M23x512 | 64 KB | 512 Kbit | yes | 23A512/23LC512 |
M23xv512 | 64 KB | 512 Kbit | no | 23LCV512 |
M23x1024 | 128 KB | 1 Mbit | yes | 23A1024/23LC1024 |
M23xv1024 | 128 KB | 1 Mbit | no | 23LCV1024 |
Usage
Include library as a dependency in your Cargo.toml
[]
= "0.3.1"
Some example usage:
extern crate sram23x;
use *;
Todo
- Separate I/O into their own private functions
- Add tests
- Document other missing minor details
Contributing
If you find any bugs or issues, please create an issue.
License
Copyright (c) 2021 Alexander Williams, On-Prem license@on-premises.com