Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
23LCV1024.h
00001 #include "mbed.h" 00002 00003 00004 #define CMD_READ 0x03 00005 #define CMD_WRITE 0x02 00006 #define CMD_RDMR 0x05 00007 #define CMD_WRMR 0x01 00008 00009 00010 // The 23LCV1024 is a 1 Mbit Serial SRAM, with 128K * 8 bits organized into 32 byte pages 00011 // A 24 bit address, 00000h - 1FFFFh, is used to address the memory location 00012 00013 // In this library, we will address the memory in blocks of 256 bytes, of which there are 512 in total 00014 // (2^1) (2^8 = 256 blocks) (2^8 = 256 bytes) 00015 // 512 blocks a 256 bytes 00016 00017 00018 class SRAM23LCV1024 { 00019 public: 00020 SRAM23LCV1024(SPI& spi, PinName cs); 00021 00022 int getReadMode(); 00023 00024 int readBytes(int address, char* buffer, int length); 00025 int writeBytes(int address, char* buffer, int length); 00026 00027 private: 00028 SPI& _spi; 00029 DigitalOut _cs; 00030 };
Generated on Thu Jul 21 2022 03:21:59 by
1.7.2