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: RobotRic VITI2_ihm_2
Revision 2:3a3404dbd3eb, committed 2011-02-19
- Comitter:
- hlipka
- Date:
- Sat Feb 19 18:29:20 2011 +0000
- Parent:
- 1:c29a67c7034d
- Commit message:
- added license
Changed in this revision
| Ser25lcxxx.cpp | Show annotated file Show diff for this revision Revisions of this file |
| Ser25lcxxx.h | Show annotated file Show diff for this revision Revisions of this file |
diff -r c29a67c7034d -r 3a3404dbd3eb Ser25lcxxx.cpp
--- a/Ser25lcxxx.cpp Thu Feb 03 20:31:08 2011 +0000
+++ b/Ser25lcxxx.cpp Sat Feb 19 18:29:20 2011 +0000
@@ -1,3 +1,26 @@
+/*
+* Ser25lcxxx library
+* Copyright (c) 2010 Hendrik Lipka
+*
+* Permission is hereby granted, free of charge, to any person obtaining a copy
+* of this software and associated documentation files (the "Software"), to deal
+* in the Software without restriction, including without limitation the rights
+* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+* copies of the Software, and to permit persons to whom the Software is
+* furnished to do so, subject to the following conditions:
+*
+* The above copyright notice and this permission notice shall be included in
+* all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+* THE SOFTWARE.
+*/
+
#include "Ser25lcxxx.h"
#include "wait_api.h"
@@ -115,7 +138,7 @@
bool b=writePage(_pageSize*pageNum,_pageSize,s);
delete s;
return b;
- } else if (_size<131072) { // everything up to 512k
+ } else {
_enable->write(0);
wait_us(1);
_spi->write(0x42);
@@ -125,20 +148,7 @@
_enable->write(1);
waitForWrite();
- } else { // 25xx1024, needs 3 byte address
- _enable->write(0);
- wait_us(1);
- _spi->write(0x42);
- _spi->write((_pageSize*pageNum)>>16);
- _spi->write(HIGH(_pageSize*pageNum));
- _spi->write(LOW(_pageSize*pageNum));
- wait_us(1);
- _enable->write(1);
-
- waitForWrite();
}
-
-
return true;
}
diff -r c29a67c7034d -r 3a3404dbd3eb Ser25lcxxx.h --- a/Ser25lcxxx.h Thu Feb 03 20:31:08 2011 +0000 +++ b/Ser25lcxxx.h Sat Feb 19 18:29:20 2011 +0000 @@ -1,3 +1,26 @@ +/* +* Ser25lcxxx library +* Copyright (c) 2010 Hendrik Lipka +* +* Permission is hereby granted, free of charge, to any person obtaining a copy +* of this software and associated documentation files (the "Software"), to deal +* in the Software without restriction, including without limitation the rights +* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +* copies of the Software, and to permit persons to whom the Software is +* furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +* THE SOFTWARE. +*/ + #ifndef __SER25LCXXX_H__ #define __SER25LCXXX_H__
25LCxxx SPI EEPROM