Skip to content
Prajwal Bhattaram edited this page Mar 7, 2018 · 2 revisions

_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()

Usage
  • 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 Bytes B(x), Kilobytes KB(x) or Megabytes MB(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) - where BYTE is 1L
  • #define KB(x) uint32_t(x*KiB) - where KiB is 1024L
  • #define MB(x) uint32_t(x*MiB) - where MiB is KiB * KiB