-
Notifications
You must be signed in to change notification settings - Fork 138
Chipsize
-
This is a variable that can be declared by using one of the pre-defined macros available for use in the library.
-
_chipSize is an optional argument used in begin()
-
If using a flash chip that is officially supported by the library this argument can be ignored and the library will calculate the capacity of the chip.
For example, if we were using an supported flash chip (the W25Q80BV for instance), our begin() function would look like this:
flash.begin();
-
If using a flash chip that is not officially supported by the library, a user can attempt to get the library working with the chip by declaring its size
(x)
in BytesB(x)
, KilobytesKB(x)
or MegabytesMB(x)
as an argument in the begin() function.For example, if we were using an unsupported flash chip with a capacity of 6 Megabytes, our begin() function would look like this:
flash.begin(MB(6));
The Library defines the macros as follows in defines.h:
-
#define B(x) uint32_t(x*BYTE)
- whereBYTE
is1L
-
#define KB(x) uint32_t(x*KiB)
- whereKiB
is1024L
-
#define MB(x) uint32_t(x*MiB)
- whereMiB
isKiB * KiB
SPIFlash Library for Arduino
© Prajwal Bhattaram under the GNU GPLv3 License
Wiki status: Up to date: 08.03.2018