Skip to content

Continuous Write functions

Prajwal Bhattaram edited this page May 30, 2016 · 2 revisions

Continuous write functions


All write functions can take a 32-bit address variable in the place of the 16-bit page number & 8-bit offset variables.
###### writeByteArray(page_number, offset, *data_buffer, bufferSize) Writes an array of bytes starting from a specific location in a page. Takes the page number (0-maxPage), offset of data byte within page (0-255), a data_buffer - i.e. an array of bytes to be written to the flash memory - and size of the array as arguments. ```uint8_t data_buffer[n];``` The data buffer **must** be an array of 'n' **bytes**. The number of bytes - 'n' - is determined by the amount of RAM available on the Arduino board. ###### writeCharArray(page_number, offset, *data_buffer, bufferSize) Writes an array of chars starting from a specific location in a page. Takes the page number (0-maxPage), offset of data byte within page (0-255), a data_buffer - i.e. an array of chars to be written to the flash memory - and size of the array as arguments. ```char data_buffer[n];``` The data buffer **must** be an array of 'n' **chars**. The number of chars - 'n' - is determined by the amount of RAM available on the Arduino board. ##### Advanced usage ###### Error checking All write functions have Error checking turned on by default - i.e. every byte written to the flash memory will be checked against the data stored on the Arduino. Users who require greater write speeds (More than 2X of normal speed) can disable this function by setting an optional last 'errorCheck' (boolean) argument in any write function to `FALSE` - For eg. call the function ```writePage(page_number, *data_buffer, false)``` instead of ```writePage(page_number, *data_buffer)```. > ___Disabling Errorcheck comes at the cost of checking for writing errors. Use with care.___