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.
Dependents: IZU2020_AVIONICS IZU2020_POST_PROCESS IZU2020_AVIONICS
EEPROM Class Reference
#include <PQEEPROM.h>
Public Member Functions | |
| EEPROM (I2C &i2c) | |
| void | write (int addr, char *data, int size) |
| 連続書き込み | |
| void | read (int addr, char *data, int size) |
| 連続読み込み | |
Detailed Description
EEPROM 24FC1025のライブラリ
- Note:
- 1つにつき0x000000~0x01FFFFまでのアドレスが指定できます
- 2つ使用する場合は0x000000~0x03FFFFまでのアドレスが指定でき、最大4つ同時に使用できます
- 1ページは128バイトです
- ページをまたぐような書き込みは危険なのでしないこと
-
受信バッファは128バイトです
#include "mbed.h" #include "PQEEPROM.h" Serial pc(USBTX, USBRX, 115200); I2C i2c(p9, p10); EEPROM eeprom(i2c); int addr; char data[128]; char buff[128]; int main() { addr = 0x000000; for(int i = 0; i < 128; i++) { data[i] = 0xFF; } eeprom.write(addr, data, 128); eeprom.read(addr, buff, 128); for(int i = 0; i < 128; i++) { pc.printf("%x ", buff[i]); } }
Definition at line 39 of file PQEEPROM.h.
Constructor & Destructor Documentation
| EEPROM | ( | I2C & | i2c ) |
- Parameters:
-
i2c I2Cのインスタンスへの参照
Definition at line 4 of file PQEEPROM.cpp.
Member Function Documentation
| void read | ( | int | addr, |
| char * | data, | ||
| int | size | ||
| ) |
連続読み込み
- Parameters:
-
addr 読み込みアドレス data 読み込むデータの配列(最大128バイト) size 読み込むデータのサイズ
Definition at line 30 of file PQEEPROM.cpp.
| void write | ( | int | addr, |
| char * | data, | ||
| int | size | ||
| ) |
連続書き込み
- Parameters:
-
addr 書き込みアドレス data 書き込むデータの配列(最大128バイト) size 書き込むデータのサイズ
Definition at line 10 of file PQEEPROM.cpp.
Generated on Fri Jul 29 2022 19:49:12 by
1.7.2