A ferroelectric random access memory or F-RAM is nonvolatile and performs reads and writes similar to a RAM.
Revision 1:b9f6d029c760, committed 2016-03-08
- Comitter:
- yangcq88517
- Date:
- Tue Mar 08 22:59:15 2016 +0000
- Parent:
- 0:e4b7a2f63736
- Commit message:
- 16 bit value only
Changed in this revision
FM24V10.cpp | Show annotated file Show diff for this revision Revisions of this file |
FM24V10.h | Show annotated file Show diff for this revision Revisions of this file |
diff -r e4b7a2f63736 -r b9f6d029c760 FM24V10.cpp --- a/FM24V10.cpp Tue Feb 03 19:56:43 2015 +0000 +++ b/FM24V10.cpp Tue Mar 08 22:59:15 2016 +0000 @@ -2,11 +2,6 @@ // A1 pin ground == false // A2 pin ground == false -FM24V10::FM24V10(PinName sda, PinName scl, bool A1, bool A2): _i2c_bus(sda,scl) -{ - _speed = FREQUENCY_FULL; - Init(A1, A2); -} FM24V10::FM24V10(PinName sda, PinName scl, bool A1, bool A2, SPEED_MODE speed): _i2c_bus(sda,scl) {
diff -r e4b7a2f63736 -r b9f6d029c760 FM24V10.h --- a/FM24V10.h Tue Feb 03 19:56:43 2015 +0000 +++ b/FM24V10.h Tue Mar 08 22:59:15 2016 +0000 @@ -6,22 +6,23 @@ class FM24V10 { public : + /* + *The speed grades (standard mode: 100 kbit/s, full speed: 400 kbit/s, fast mode: 1 mbit/s, high speed: 3,2 Mbit/s) are maximum ratings. Compliant hardware guaranties that it can handle transmission speed up to the maximum clock rate specified by the mode. + */ enum SPEED_MODE { STANDARD,FULL,FAST,HIGH }; - FM24V10(PinName sda, PinName scl, bool A1, bool A2); + FM24V10(PinName sda, PinName scl, bool A1, bool A2, SPEED_MODE speed = FULL); - FM24V10(PinName sda, PinName scl, bool A1, bool A2, SPEED_MODE speed); + void WriteShort(int position, int value, bool Hs_mode = false); - void WriteShort(int position, int value, bool Hs_mode); - - void WriteShort(int position, int * value, int size, bool Hs_mode); + void WriteShort(int position, int * value, int size, bool Hs_mode = false); - void ReadShort(int position, int * value, int size, bool Hs_mode); - - int ReadShort(int position, bool Hs_mode); - + void ReadShort(int position, int * value, int size, bool Hs_mode = false); + + int ReadShort(int position, bool Hs_mode = false); + private : static const int HS_COMMAND = 0x09; @@ -33,7 +34,7 @@ I2C _i2c_bus; int _speed; int _addr; - + int result; void Init(bool A1, bool A2);