Definitions of Dataflash functions.
Definition in file dataflash.c.
#include "dataflash.h"
Go to the source code of this file.
Functions | |
void | dataflashWaitOnReady () |
: Wait while Read/Busy Status bit in SRB is 1 (device is busy). More... | |
void | dataflashReadMID (uint8_t *rxBuffer) |
OPCODE: 0x9F Reads the manufacturer ID and stores the data in rxBuffer. More... | |
void | dataflashReadSR (uint8_t *rxBuffer) |
OPCODE: 0xD7 Reads the value in the device status register (bytes 1 and 2). More... | |
void | dataflashMemoryPageRead (uint32_t address, uint8_t *rxBuffer, uint32_t rxNumBytes) |
OPCODE: 0xD2 Reads rxNumBytes starting from location 'address' and stores the data in the byte array rxBuffer. This command reads from a page in main memory and bypasses the buffer leaving their contents untouched as specified in the datasheet. More... | |
void | dataflashArrayReadLowPower (uint32_t address, uint8_t *rxBuffer, uint32_t rxNumBytes) |
OPCODE: 0x01 Reads rxNumBytes starting from location 'address' and stores the data in the byte array rxBuffer. This command reads from a page in main memory at a lower frequency than other commands in order to minimize power consumption as specified in the datasheet. More... | |
void | dataflashArrayReadLowFreq (uint32_t address, uint8_t *rxBuffer, uint32_t rxNumBytes) |
OPCODE: 0x03 Reads rxNumBytes starting from location 'address' and stores the data in the byte array rxBuffer. This command reads from a page in main memory at a lower frequency than other commands as specified in the datasheet. More... | |
void | dataflashArrayReadHighFreq0 (uint32_t address, uint8_t *rxBuffer, uint32_t rxNumBytes) |
OPCODE: 0x0B Reads rxNumBytes starting from location 'address' and stores the data in the byte array rxBuffer. This command reads from a page in main memory at a higher frequency than other commands as specified in the datasheet. More... | |
void | dataflashArrayReadHighFreq1 (uint32_t address, uint8_t *rxBuffer, uint32_t rxNumBytes) |
OPCODE: 0x1B Reads rxNumBytes starting from location 'address' and stores the data in the byte array rxBuffer. This command reads from a page in main memory at a higher frequency than other commands as specified in the datasheet. More... | |
void | dataflashArrayReadLegacy (uint32_t address, uint8_t *rxBuffer, uint32_t rxNumBytes) |
OPCODE: 0xE8 Reads rxNumBytes starting from location 'address' and stores the data in the byte array rxBuffer. This command reads from a page in main memory as specified in the datasheet. More... | |
void | dataflashBuffer1ReadLowFreq (uint32_t address, uint8_t *rxBuffer, uint32_t rxNumBytes) |
OPCODE: 0xD1 Reads rxNumBytes starting from location 'address' in buffer 1 and stores the data in the byte array rxBuffer. This command reads from buffer 1 at a lower frequency than other commands as specified in the datasheet. More... | |
void | dataflashBuffer1ReadHighFreq (uint32_t address, uint8_t *rxBuffer, uint32_t rxNumBytes) |
OPCODE: 0xD4 More... | |
void | dataflashBuffer1Write (uint32_t address, uint8_t *txBuffer, uint32_t txNumBytes) |
OPCODE: 0x84 Programs 'txNumBytes' bytes of data to buffer 1 starting at the address indicated by address. More... | |
void | dataflashBuffer1ToMainMemoryWithErase (uint32_t address) |
OPCODE: 0x83 Programs the entire buffer 1 page to main memory starting at the address indicated by 'address' with the build in erase feature. More... | |
void | dataflashBuffer1ToMainMemoryWithoutErase (uint32_t address) |
OPCODE: 0x88 Programs the entire buffer 1 page to main memory starting at the address indicated by 'address'. The data in the page indicated at address will be not erased before the data in buffer 1 is programmed to main memory. It is therefore recommended that the user erase the page beforehand. More... | |
void | dataflashMemoryProgramThruBuffer1WithErase (uint32_t address, uint8_t *txBuffer, uint32_t txNumBytes) |
OPCODE: 0x82 Programs main memory through buffer 1 starting at the address indicated by 'address' with the built in erase feature. More... | |
void | dataflashMemoryProgramThruBuffer1WithoutErase (uint32_t address, uint8_t *txBuffer, uint32_t txNumBytes) |
OPCODE: 0x02 More... | |
void | dataflashPageErase (uint32_t address) |
OPCODE: 0x81 Erases a page of data (256/264 Bytes) starting from page address 'address.'. More... | |
void | dataflashBlockErase (uint32_t address) |
OPCODE: 0x50 Erases a block of data (8 pages) starting from page address 'address.'. More... | |
void | dataflashSectorErase (uint32_t address) |
OPCODE: 0x7C More... | |
void | dataflashChipErase () |
OPCODE: 0xC794_809A Erases the entire chip by setting all bits. More... | |
void | dataflashRMWThruBuffer1 (uint32_t address, uint8_t *txBuffer, uint32_t txNumBytes) |
OPCODE: 0x58 Reads main memory to buffer 1, modifies it, then writes the data back to main memory with built in erase. More... | |
void | dataflashEnableSectorProtection () |
OPCODE: 0x3D_2A_7F_A9 Enables sector protection. More... | |
void | dataflashDisableSectorProtection () |
OPCODE: 0x3D_2A_7F_9A Disables sector protection. More... | |
void | dataflashEraseSectorProtectionReg () |
OPCODE: 0x3D_2A_7F_CF Erases the sector protection register. Erasing is required for modification/setting bits in the register. More... | |
void | dataflashProgSectorProtectionReg (uint8_t *txBuffer, uint32_t txNumBytes) |
OPCODE: 0x3D_2A_7F_FC Program the sector protection register with the data in txBuffer. More... | |
void | dataflashReadSectorProtectionReg (uint8_t *rxBuffer, uint32_t rxNumBytes) |
OPCODE: 0x32 Reads 'txNumBytes' bytes of data in from the SPR register. More... | |
void | dataflashReadSecurityReg (uint8_t *rxBuffer, uint32_t rxNumBytes) |
OPCODE: 0x77 Reads 'rxNumBytes' bytes of data in from the security register. More... | |
void | dataflashMemtoBuffer1Transfer (uint32_t address) |
OPCODE: 0x53 Transfer the contents of a page in main memory at the address indicated by 'address' to buffer 1. More... | |
void | dataflashMemtoBuffer1Compare (uint32_t address) |
OPCODE: 0x60 Compare the contents of a page in main memory to the contents of buffer 1. The status register should be read, and the 6th bit of byte 1 examined to determine the result. 0 -> Main memory page data matches buffer data. 1 -> Main memory page data does not match buffer data. More... | |
void | dataflashAutoPageRewrite1 (uint32_t address) |
OPCODE: 0x58 Rewrite the page in main memory at address 'address.' This performs a refresh of stored data. Data is stored in buffer 1 from main memory, then written back in. More... | |
void | dataflashDPD () |
OPCODE: 0xB9 Put the device into deep power down mode. Call dataflashResumeFromDPD() to wake up, or perform a hardware reset dataflashHardwareReset(). More... | |
void | dataflashUDPDMode () |
OPCODE: 0x79 Put the device into ultra deep power down mode. Wake the device with dataflashHardwareReset(). More... | |
void | dataflashHardwareReset () |
Perform a JEDEC reset on the flash device. More... | |
void | dataflashResumeFromDPD () |
OPCODE: 0xAB Wake the device from deep power down mode. See dataflashDPD(). More... | |
void | dataflashConfigurePower2PageSize () |
OPCODE: 0x3D_2A_80_A6 Configure the device to read and write with pages configured to 256 bytes. More... | |
void | dataflashConfigureStandardPageSize () |
OPCODE: 0x3D_2A_80_A7 Configure the device to read and write with pages configured to 264 bytes. More... | |
void | dataflashSoftwareReset () |
OPCODE: 0xF0_00_00_00 Perform a software reset on the device. This will terminate any read or write operation in progress. More... | |
void | dataflashBuffer1ReadLegacy (uint8_t address, uint8_t *rxBuffer, uint32_t rxNumBytes) |
OPCODE: 0x54 LEGACY: Reads rxNumBytes starting from location 'address' in buffer 2 and stores the data in the byte array rxBuffer. More... | |
void | dataflashMemPageReadLegacy (uint8_t address, uint8_t *rxBuffer, uint32_t rxNumBytes) |
OPCODE: 0x52 LEGACY: Reads rxNumBytes starting from location 'address' and stores the data in the byte array rxBuffer. More... | |
void | dataflashContinuousArrayReadLegacy (uint8_t address, uint8_t *rxBuffer, uint32_t rxNumBytes) |
OPCODE: 0x68 LEGACY: Reads rxNumBytes starting from location 'address' and stores the data in the byte array rxBuffer. More... | |
void | dataflashReadSRLegacy (uint8_t *rxBuffer) |
OPCODE: 0x57 LEGACY: Reads the value in the device status register (bytes 1 and 2). More... | |
void | dataflashDualOutputRead (uint32_t address, uint8_t *rxBuffer, uint32_t rxNumBytes) |
OPCODE: 0x3B Reads 'txNumBytes' bytes of data in Dual Output Mode starting at 'address' using both SI and SO as inputs to master. More... | |
void | dataflashQuadOutputRead (uint32_t address, uint8_t *rxBuffer, uint32_t rxNumBytes) |
OPCODE: 0x6B Reads 'txNumBytes' bytes of data in Quad Output Mode starting at 'address' using SI, SO, WPb, and HOLDb as inputs to master. More... | |
void | dataflashDualInputBuffer1Write (uint32_t address, uint8_t *txBuffer, uint32_t txNumBytes) |
OPCODE: 0x24 Programs 'txNumBytes' bytes of data to buffer 1 starting at the address indicated by address using SI and SO as inputs for dual input. More... | |
void | dataflashDualInputBuffer2Write (uint32_t address, uint8_t *txBuffer, uint32_t txNumBytes) |
OPCODE: 0x24 Programs 'txNumBytes' bytes of data to buffer 2 starting at the address indicated by address using SI and SO as inputs for dual input. More... | |
void | dataflashQuadInputBuffer1Write (uint32_t address, uint8_t *txBuffer, uint32_t txNumBytes) |
OPCODE: 0x44 Programs 'txNumBytes' bytes of data to buffer 2 starting at the address indicated by address using SI, SO, WPb, and RESETb as inputs for quad input. More... | |
void | dataflashQuadInputBuffer2Write (uint32_t address, uint8_t *txBuffer, uint32_t txNumBytes) |
OPCODE: 0x47 Programs 'txNumBytes' bytes of data to buffer 2 starting at the address indicated by address using SI, SO, WPb, and RESETb as inputs for quad input. More... | |
void | dataflashReadConfigRegister (uint8_t *rxBuffer) |
OPCODE: 0x3F Reads the configuration register and returns the 1-byte value in rxBuffer. More... | |
void | dataflashQuadEnable () |
OPCODE: 0x3D2A8166 Programs the NV-QE bit to a logical 1 to enable the Quad I/O commands. More... | |
void | dataflashQuadDisable () |
OPCODE: 0x3D2A8167 Programs the NV-QE bit to a logical 0 to disable the Quad I/O commands. More... | |
void | dataflashProgramEraseSuspend () |
OPCODE: 0xB0 Suspends a program or erase operation in progress to a particular 64KB sector of the main memory array so that other device operations can be performed. More... | |
void | dataflashProgramEraseResume () |
OPCODE: 0xD0 Resumes a suspended program or erase operation. See dataflashProgramEraseSuspend(). More... | |
void | dataflashSectorLockdown (uint32_t address) |
OPCODE: 0x3D_2A_7F_30 Permanently a sector to prevent erasing or programming the stored data. More... | |
void | dataflashReadSectorLockdownReg (uint8_t *rxBuffer, uint32_t rxNumBytes) |
OPCODE: 0x35 Reads 'rxNumBytes' bytes of data in from the SL register. More... | |
void | dataflashFreezeSectorLockdown () |
OPCODE: 0x34_55_AA_40 Permanently freeze the sector lockdown register to prevent any future changes and disable the sector lockdown command. The current state will be preserved. More... | |
void | dataflashProgSecurityReg (uint8_t *txBuffer, uint32_t txNumBytes) |
OPCODE: 0x9B_00_00_00 Program the security register with the data in txBuffer. More... | |
void | dataflashBuffer2ReadLowFreq (uint32_t address, uint8_t *rxBuffer, uint32_t rxNumBytes) |
OPCODE: 0xD3 Reads rxNumBytes starting from location 'address' in buffer 2 and stores the data in the byte array rxBuffer. This command reads from buffer 2 at a lower frequency than other commands as specified in the datasheet. More... | |
void | dataflashBuffer2ReadHighFreq (uint32_t address, uint8_t *rxBuffer, uint32_t rxNumBytes) |
OPCODE: 0xD6 Reads rxNumBytes starting from location 'address' in buffer 2 and stores the data in the byte array rxBuffer. This command reads from buffer 2 at a higher frequency than other commands as specified in the datasheet. More... | |
void | dataflashBuffer2Write (uint32_t address, uint8_t *txBuffer, uint32_t txNumBytes) |
OPCODE: 0x87 Programs 'txNumBytes' bytes of data to buffer 2 starting at the address indicated by address. More... | |
void | dataflashBuffer2ToMainMemoryWithErase (uint32_t address) |
OPCODE: 0x86 Programs the entire buffer 2 page to main memory starting at the address indicated by 'address'. with the build in erase feature. More... | |
void | dataflashBuffer2ToMainMemoryWithoutErase (uint32_t address) |
OPCODE: 0x89 Programs the entire buffer 2 page to main memory starting at the address indicated by 'address'. The data in the page indicated at address will be not erased before the data in buffer 2 is programmed to main memory. It is therefore recommended that the user erase the page beforehand. More... | |
void | dataflashMemoryProgramThruBuffer2WithErase (uint32_t address, uint8_t *txBuffer, uint32_t txNumBytes) |
OPCODE: 0x85 Programs main memory through buffer 2 starting at the address indicated by 'address' with the built in erase feature. More... | |
void | dataflashRMWThruBuffer2 (uint32_t address, uint8_t *txBuffer, uint32_t txNumBytes) |
OPCODE: 0x59 Reads main memory to buffer 1, modifies it, then writes the data back to main memory with built in erase. More... | |
void | dataflashMemtoBuffer2Transfer (uint32_t address) |
OPCODE: 0x55 More... | |
void | dataflashMemtoBuffer2Compare (uint32_t address) |
OPCODE: 0x61 Compare the contents of a page in main memory to the contents of buffer 2. The status register should be read, and the 6th bit of byte 1 examined to determine the result. 0 -> Main memory page data matches buffer data. 1 -> Main memory page data does not match buffer data. More... | |
void | dataflashAutoPageRewrite2 (uint32_t address) |
OPCODE: 0x59 Rewrite the page in main memory at address 'address.' This performs a refresh of stored data. Data is stored in buffer 2 from main memory, then written back in. More... | |
void | dataflashBuffer2ReadLegacy (uint8_t address, uint8_t *rxBuffer, uint32_t rxNumBytes) |
OPCODE: 0x56 LEGACY: Reads rxNumBytes starting from location 'address' in buffer 2 and stores the data in the byte array rxBuffer. More... | |
Variables | |
uint8_t | txDataflashInternalBuffer [MAXIMUM_TX_BYTES] |
void dataflashArrayReadHighFreq0 | ( | uint32_t | address, |
uint8_t * | rxBuffer, | ||
uint32_t | rxNumBytes | ||
) |
OPCODE: 0x0B
Reads rxNumBytes starting from location 'address' and stores the data in the byte array rxBuffer. This command reads from a page in main memory at a higher frequency than other commands as specified in the datasheet.
address | 3 byte address starting from which the data in memory will be read. |
rxBuffer | Pointer to the byte array in which the read data will be stored. Must have at least rxNumBytes elements. |
rxNumBytes | Number of bytes to be read from the memory. rxBuffer must have a minimum of this many elements. |
void |
Definition at line 126 of file dataflash.c.
void dataflashArrayReadHighFreq1 | ( | uint32_t | address, |
uint8_t * | rxBuffer, | ||
uint32_t | rxNumBytes | ||
) |
OPCODE: 0x1B
Reads rxNumBytes starting from location 'address' and stores the data in the byte array rxBuffer. This command reads from a page in main memory at a higher frequency than other commands as specified in the datasheet.
address | 3 byte address starting from which the data in memory will be read. |
rxBuffer | Pointer to the byte array in which the read data will be stored. Must have at least rxNumBytes elements. |
rxNumBytes | Number of bytes to be read from the memory. rxBuffer must have a minimum of this many elements. |
void |
Definition at line 136 of file dataflash.c.
void dataflashArrayReadLegacy | ( | uint32_t | address, |
uint8_t * | rxBuffer, | ||
uint32_t | rxNumBytes | ||
) |
OPCODE: 0xE8
Reads rxNumBytes starting from location 'address' and stores the data in the byte array rxBuffer. This command reads from a page in main memory as specified in the datasheet.
address | 3 byte address starting from which the data in memory will be read. |
rxBuffer | Pointer to the byte array in which the read data will be stored. Must have at least rxNumBytes elements. |
rxNumBytes | Number of bytes to be read from the memory. rxBuffer must have a minimum of this many elements. |
void |
Definition at line 146 of file dataflash.c.
void dataflashArrayReadLowFreq | ( | uint32_t | address, |
uint8_t * | rxBuffer, | ||
uint32_t | rxNumBytes | ||
) |
OPCODE: 0x03
Reads rxNumBytes starting from location 'address' and stores the data in the byte array rxBuffer. This command reads from a page in main memory at a lower frequency than other commands as specified in the datasheet.
address | 3 byte address starting from which the data in memory will be read. |
rxBuffer | Pointer to the byte array in which the read data will be stored. Must have at least rxNumBytes elements. |
rxNumBytes | Number of bytes to be read from the memory. rxBuffer must have a minimum of this many elements. |
void |
Definition at line 116 of file dataflash.c.
void dataflashArrayReadLowPower | ( | uint32_t | address, |
uint8_t * | rxBuffer, | ||
uint32_t | rxNumBytes | ||
) |
OPCODE: 0x01
Reads rxNumBytes starting from location 'address' and stores the data in the byte array rxBuffer. This command reads from a page in main memory at a lower frequency than other commands in order to minimize power consumption as specified in the datasheet.
address | 3 byte address starting from which the data in memory will be read. |
rxBuffer | Pointer to the byte array in which the read data will be stored. Must have at least rxNumBytes elements. |
rxNumBytes | Number of bytes to be read from the memory. rxBuffer must have a minimum of this many elements. |
void |
Definition at line 106 of file dataflash.c.
void dataflashAutoPageRewrite1 | ( | uint32_t | address | ) |
OPCODE: 0x58 Rewrite the page in main memory at address 'address.' This performs a refresh of stored data. Data is stored in buffer 1 from main memory, then written back in.
address | The page address in main memory from which data will be transferred to buffer 1. |
void |
Definition at line 405 of file dataflash.c.
void dataflashAutoPageRewrite2 | ( | uint32_t | address | ) |
OPCODE: 0x59 Rewrite the page in main memory at address 'address.' This performs a refresh of stored data. Data is stored in buffer 2 from main memory, then written back in.
address | The page address in main memory from which data will be transferred to buffer 2. |
void |
Definition at line 858 of file dataflash.c.
void dataflashBlockErase | ( | uint32_t | address | ) |
OPCODE: 0x50
Erases a block of data (8 pages) starting from page address 'address.'.
address | The 3 byte page address at which the block erase will start. |
void |
Definition at line 257 of file dataflash.c.
void dataflashBuffer1ReadHighFreq | ( | uint32_t | address, |
uint8_t * | rxBuffer, | ||
uint32_t | rxNumBytes | ||
) |
OPCODE: 0xD4
OPCODE: 0xD4
Reads rxNumBytes starting from location 'address' in buffer 1 and stores the data in the byte array rxBuffer. This command reads from buffer 1 at a higher frequency than other commands as specified in the datasheet.
address | 3 byte address starting from which the data in buffer 1 will be read. |
rxBuffer | Pointer to the byte array in which the read data will be stored. Must have at least rxNumBytes elements. |
rxNumBytes | Number of bytes to be read from the memory. rxBuffer must have a minimum of this many elements. |
void |
Definition at line 166 of file dataflash.c.
void dataflashBuffer1ReadLegacy | ( | uint8_t | address, |
uint8_t * | rxBuffer, | ||
uint32_t | rxNumBytes | ||
) |
OPCODE: 0x54 LEGACY: Reads rxNumBytes starting from location 'address' in buffer 2 and stores the data in the byte array rxBuffer.
address | 3 byte address starting from which the data in buffer 2 will be read. |
rxBuffer | Pointer to the byte array in which the read data will be stored. Must have at least rxNumBytes elements. |
rxNumBytes | Number of bytes to be read from the memory. rxBuffer must have a minimum of this many elements. |
void |
Definition at line 489 of file dataflash.c.
void dataflashBuffer1ReadLowFreq | ( | uint32_t | address, |
uint8_t * | rxBuffer, | ||
uint32_t | rxNumBytes | ||
) |
OPCODE: 0xD1
Reads rxNumBytes starting from location 'address' in buffer 1 and stores the data in the byte array rxBuffer. This command reads from buffer 1 at a lower frequency than other commands as specified in the datasheet.
address | 3 byte address starting from which the data in buffer 1 will be read. |
rxBuffer | Pointer to the byte array in which the read data will be stored. Must have at least rxNumBytes elements. |
rxNumBytes | Number of bytes to be read from the memory. rxBuffer must have a minimum of this many elements. |
void |
Definition at line 156 of file dataflash.c.
void dataflashBuffer1ToMainMemoryWithErase | ( | uint32_t | address | ) |
OPCODE: 0x83
Programs the entire buffer 1 page to main memory starting at the address indicated by 'address' with the build in erase feature.
address | The 3 bytes address indicating the first location to be written to. Note page restrictions in manual. |
void |
Definition at line 193 of file dataflash.c.
void dataflashBuffer1ToMainMemoryWithoutErase | ( | uint32_t | address | ) |
OPCODE: 0x88
Programs the entire buffer 1 page to main memory starting at the address indicated by 'address'. The data in the page indicated at address will be not erased before the data in buffer 1 is programmed to main memory. It is therefore recommended that the user erase the page beforehand.
address | The 3 bytes address indicating the first location to be written to. Note page restrictions in manual. |
void |
Definition at line 203 of file dataflash.c.
void dataflashBuffer1Write | ( | uint32_t | address, |
uint8_t * | txBuffer, | ||
uint32_t | txNumBytes | ||
) |
OPCODE: 0x84
Programs 'txNumBytes' bytes of data to buffer 1 starting at the address indicated by address.
address | The 3 bytes address indicating the first location to be written to. Note page restrictions in manual. |
txBuffer | Pointer to the tx bytes that will be stored in buffer 1. Must have a minimum of txNumBytes elements. |
txNumBytes | Number of bytes to be written to buffer 1. txBuffer must have a minimum of this many elements. |
void |
Definition at line 176 of file dataflash.c.
void dataflashBuffer2ReadHighFreq | ( | uint32_t | address, |
uint8_t * | rxBuffer, | ||
uint32_t | rxNumBytes | ||
) |
OPCODE: 0xD6
Reads rxNumBytes starting from location 'address' in buffer 2 and stores the data in the byte array rxBuffer. This command reads from buffer 2 at a higher frequency than other commands as specified in the datasheet.
address | 3 byte address starting from which the data in buffer 2 will be read. |
rxBuffer | Pointer to the byte array in which the read data will be stored. Must have at least rxNumBytes elements. |
rxNumBytes | Number of bytes to be read from the memory. rxBuffer must have a minimum of this many elements. |
void |
Definition at line 757 of file dataflash.c.
void dataflashBuffer2ReadLegacy | ( | uint8_t | address, |
uint8_t * | rxBuffer, | ||
uint32_t | rxNumBytes | ||
) |
OPCODE: 0x56
LEGACY: Reads rxNumBytes starting from location 'address' in buffer 2 and stores the data in the byte array rxBuffer.
address | 3 byte address starting from which the data in buffer 2 will be read. |
rxBuffer | Pointer to the byte array in which the read data will be stored. Must have at least rxNumBytes elements. |
rxNumBytes | Number of bytes to be read from the memory. rxBuffer must have a minimum of this many elements. |
void |
Definition at line 868 of file dataflash.c.
void dataflashBuffer2ReadLowFreq | ( | uint32_t | address, |
uint8_t * | rxBuffer, | ||
uint32_t | rxNumBytes | ||
) |
OPCODE: 0xD3
Reads rxNumBytes starting from location 'address' in buffer 2 and stores the data in the byte array rxBuffer. This command reads from buffer 2 at a lower frequency than other commands as specified in the datasheet.
address | 3 byte address starting from which the data in buffer 2 will be read. |
rxBuffer | Pointer to the byte array in which the read data will be stored. Must have at least rxNumBytes elements. |
rxNumBytes | Number of bytes to be read from the memory. rxBuffer must have a minimum of this many elements. |
void |
Definition at line 747 of file dataflash.c.
void dataflashBuffer2ToMainMemoryWithErase | ( | uint32_t | address | ) |
OPCODE: 0x86
Programs the entire buffer 2 page to main memory starting at the address indicated by 'address'. with the build in erase feature.
address | The 3 bytes address indicating the first location to be written to. Note page restrictions in manual. |
void |
Definition at line 784 of file dataflash.c.
void dataflashBuffer2ToMainMemoryWithoutErase | ( | uint32_t | address | ) |
OPCODE: 0x89
Programs the entire buffer 2 page to main memory starting at the address indicated by 'address'. The data in the page indicated at address will be not erased before the data in buffer 2 is programmed to main memory. It is therefore recommended that the user erase the page beforehand.
address | The 3 bytes address indicating the first location to be written to. Note page restrictions in manual. |
void |
Definition at line 794 of file dataflash.c.
void dataflashBuffer2Write | ( | uint32_t | address, |
uint8_t * | txBuffer, | ||
uint32_t | txNumBytes | ||
) |
OPCODE: 0x87
Programs 'txNumBytes' bytes of data to buffer 2 starting at the address indicated by address.
address | The 3 bytes address indicating the first location to be written to. Note page restrictions in manual. |
txBuffer | Pointer to the tx bytes that will be stored in buffer 2. Must have a minimum of txNumBytes elements. |
txNumBytes | Number of bytes to be written to buffer 2. txBuffer must have a minimum of this many elements. |
void |
Definition at line 767 of file dataflash.c.
void dataflashChipErase | ( | ) |
OPCODE: 0xC794_809A
Erases the entire chip by setting all bits.
void |
Definition at line 277 of file dataflash.c.
void dataflashConfigurePower2PageSize | ( | ) |
OPCODE: 0x3D_2A_80_A6
Configure the device to read and write with pages configured to 256 bytes.
void |
Definition at line 450 of file dataflash.c.
void dataflashConfigureStandardPageSize | ( | ) |
OPCODE: 0x3D_2A_80_A7
Configure the device to read and write with pages configured to 264 bytes.
void |
Definition at line 463 of file dataflash.c.
void dataflashContinuousArrayReadLegacy | ( | uint8_t | address, |
uint8_t * | rxBuffer, | ||
uint32_t | rxNumBytes | ||
) |
OPCODE: 0x68
LEGACY: Reads rxNumBytes starting from location 'address' and stores the data in the byte array rxBuffer.
address | 3 byte address starting from which the data in memory will be read. |
rxBuffer | Pointer to the byte array in which the read data will be stored. Must have at least rxNumBytes elements. |
rxNumBytes | Number of bytes to be read from the memory. rxBuffer must have a minimum of this many elements. |
void |
Definition at line 509 of file dataflash.c.
void dataflashDisableSectorProtection | ( | ) |
OPCODE: 0x3D_2A_7F_9A
Disables sector protection.
void |
Definition at line 320 of file dataflash.c.
void dataflashDPD | ( | ) |
OPCODE: 0xB9 Put the device into deep power down mode. Call dataflashResumeFromDPD() to wake up, or perform a hardware reset dataflashHardwareReset().
void |
Definition at line 415 of file dataflash.c.
void dataflashDualInputBuffer1Write | ( | uint32_t | address, |
uint8_t * | txBuffer, | ||
uint32_t | txNumBytes | ||
) |
OPCODE: 0x24
Programs 'txNumBytes' bytes of data to buffer 1 starting at the address indicated by address using SI and SO as inputs for dual input.
address | The 3 bytes address indicating the first location to be written to. Note page restrictions in manual. |
txBuffer | Pointer to the tx bytes that will be stored in buffer 2. Must have a minimum of txNumBytes elements. |
txNumBytes | Number of bytes to be written to buffer 2. txBuffer must have a minimum of this many elements. |
void |
Definition at line 551 of file dataflash.c.
void dataflashDualInputBuffer2Write | ( | uint32_t | address, |
uint8_t * | txBuffer, | ||
uint32_t | txNumBytes | ||
) |
OPCODE: 0x24
Programs 'txNumBytes' bytes of data to buffer 2 starting at the address indicated by address using SI and SO as inputs for dual input.
address | The 3 bytes address indicating the first location to be written to. Note page restrictions in manual. |
txBuffer | Pointer to the tx bytes that will be stored in buffer 2. Must have a minimum of txNumBytes elements. |
txNumBytes | Number of bytes to be written to buffer 2. txBuffer must have a minimum of this many elements. |
void |
Definition at line 566 of file dataflash.c.
void dataflashDualOutputRead | ( | uint32_t | address, |
uint8_t * | rxBuffer, | ||
uint32_t | rxNumBytes | ||
) |
OPCODE: 0x3B
Reads 'txNumBytes' bytes of data in Dual Output Mode starting at 'address' using both SI and SO as inputs to master.
address | Address starting from which the data in memory will be read. |
rxBuffer | Pointer to the byte array in which the read data will be stored. Must have at least rxNumBytes elements. |
rxNumBytes | Number of bytes to be read from the memory. rxBuffer must have a minimum of this many elements. |
void |
Definition at line 531 of file dataflash.c.
void dataflashEnableSectorProtection | ( | ) |
OPCODE: 0x3D_2A_7F_A9
Enables sector protection.
void |
Definition at line 307 of file dataflash.c.
void dataflashEraseSectorProtectionReg | ( | ) |
OPCODE: 0x3D_2A_7F_CF
Erases the sector protection register. Erasing is required for modification/setting bits in the register.
void |
Definition at line 333 of file dataflash.c.
void dataflashFreezeSectorLockdown | ( | ) |
OPCODE: 0x34_55_AA_40
Permanently freeze the sector lockdown register to prevent any future changes and disable the sector lockdown command. The current state will be preserved.
Definition at line 703 of file dataflash.c.
void dataflashHardwareReset | ( | ) |
Perform a JEDEC reset on the flash device.
void |
Definition at line 435 of file dataflash.c.
void dataflashMemoryPageRead | ( | uint32_t | address, |
uint8_t * | rxBuffer, | ||
uint32_t | rxNumBytes | ||
) |
OPCODE: 0xD2
Reads rxNumBytes starting from location 'address' and stores the data in the byte array rxBuffer. This command reads from a page in main memory and bypasses the buffer leaving their contents untouched as specified in the datasheet.
address | 3 byte address starting from which the data in memory will be read. |
rxBuffer | Pointer to the byte array in which the read data will be stored. Must have at least rxNumBytes elements. |
rxNumBytes | Number of bytes to be read from the memory. rxBuffer must have a minimum of this many elements. |
void |
Definition at line 96 of file dataflash.c.
void dataflashMemoryProgramThruBuffer1WithErase | ( | uint32_t | address, |
uint8_t * | txBuffer, | ||
uint32_t | txNumBytes | ||
) |
OPCODE: 0x82
Programs main memory through buffer 1 starting at the address indicated by 'address' with the built in erase feature.
address | The 3 bytes address indicating the first location to be written to. Note page restrictions in manual. |
txBuffer | Pointer to the tx bytes that will be stored in buffer 2. Must have a minimum of txNumBytes elements. |
txNumBytes | Number of bytes to be written to buffer 2. txBuffer must have a minimum of this many elements. |
void |
Definition at line 213 of file dataflash.c.
void dataflashMemoryProgramThruBuffer1WithoutErase | ( | uint32_t | address, |
uint8_t * | txBuffer, | ||
uint32_t | txNumBytes | ||
) |
OPCODE: 0x02
OPCODE: 0x02
Programs main memory through buffer 1 starting at the address indicated by 'address'. The data in the page indicated at address will be not erased before the data in buffer 2 is programmed to main memory. It is therefore recommended that the user erase the page beforehand.
address | The 3 bytes address indicating the first location to be written to. Note page restrictions in manual. |
txBuffer | Pointer to the tx bytes that will be stored in buffer 2. Must have a minimum of txNumBytes elements. |
txNumBytes | Number of bytes to be written to buffer 2. txBuffer must have a minimum of this many elements. |
void |
Definition at line 230 of file dataflash.c.
void dataflashMemoryProgramThruBuffer2WithErase | ( | uint32_t | address, |
uint8_t * | txBuffer, | ||
uint32_t | txNumBytes | ||
) |
OPCODE: 0x85
Programs main memory through buffer 2 starting at the address indicated by 'address' with the built in erase feature.
address | The 3 bytes address indicating the first location to be written to. Note page restrictions in manual. |
txBuffer | Pointer to the tx bytes that will be stored in buffer 2. Must have a minimum of txNumBytes elements. |
txNumBytes | Number of bytes to be written to buffer 2. txBuffer must have a minimum of this many elements. |
void |
Definition at line 804 of file dataflash.c.
void dataflashMemPageReadLegacy | ( | uint8_t | address, |
uint8_t * | rxBuffer, | ||
uint32_t | rxNumBytes | ||
) |
OPCODE: 0x52
LEGACY: Reads rxNumBytes starting from location 'address' and stores the data in the byte array rxBuffer.
address | 3 byte address starting from which the data in memory will be read. |
rxBuffer | Pointer to the byte array in which the read data will be stored. Must have at least rxNumBytes elements. |
rxNumBytes | Number of bytes to be read from the memory. rxBuffer must have a minimum of this many elements. |
void |
Definition at line 499 of file dataflash.c.
void dataflashMemtoBuffer1Compare | ( | uint32_t | address | ) |
OPCODE: 0x60
Compare the contents of a page in main memory to the contents of buffer 1. The status register should be read, and the 6th bit of byte 1 examined to determine the result.
0 -> Main memory page data matches buffer data.
1 -> Main memory page data does not match buffer data.
address | The page address in main memory from which data will be transferred to buffer 1. |
void |
Definition at line 395 of file dataflash.c.
void dataflashMemtoBuffer1Transfer | ( | uint32_t | address | ) |
OPCODE: 0x53
Transfer the contents of a page in main memory at the address indicated by 'address' to buffer 1.
address | The page address in main memory from which data will be transferred to buffer 1. |
void |
Definition at line 385 of file dataflash.c.
void dataflashMemtoBuffer2Compare | ( | uint32_t | address | ) |
OPCODE: 0x61
Compare the contents of a page in main memory to the contents of buffer 2. The status register should be read, and the 6th bit of byte 1 examined to determine the result.
0 -> Main memory page data matches buffer data.
1 -> Main memory page data does not match buffer data.
address | The page address in main memory from which data will be transferred to buffer 2. |
void |
Definition at line 848 of file dataflash.c.
void dataflashMemtoBuffer2Transfer | ( | uint32_t | address | ) |
OPCODE: 0x55
Definition at line 838 of file dataflash.c.
void dataflashPageErase | ( | uint32_t | address | ) |
OPCODE: 0x81
Erases a page of data (256/264 Bytes) starting from page address 'address.'.
address | The 3 byte page address at which the page erase will start. |
void |
Definition at line 247 of file dataflash.c.
void dataflashProgramEraseResume | ( | ) |
OPCODE: 0xD0
Resumes a suspended program or erase operation. See dataflashProgramEraseSuspend().
void |
Definition at line 667 of file dataflash.c.
void dataflashProgramEraseSuspend | ( | ) |
OPCODE: 0xB0
Suspends a program or erase operation in progress to a particular 64KB sector of the main memory array so that other device operations can be performed.
void |
Definition at line 657 of file dataflash.c.
void dataflashProgSectorProtectionReg | ( | uint8_t * | txBuffer, |
uint32_t | txNumBytes | ||
) |
OPCODE: 0x3D_2A_7F_FC
Program the sector protection register with the data in txBuffer.
txBuffer | Pointer to the tx bytes that will be stored in memory. Must have a minimum of txNumBytes elements. |
txNumBytes | Number of bytes to be written to the device. txBuffer must have a minimum of this many elements.. |
void |
Definition at line 346 of file dataflash.c.
void dataflashProgSecurityReg | ( | uint8_t * | txBuffer, |
uint32_t | txNumBytes | ||
) |
OPCODE: 0x9B_00_00_00
Program the security register with the data in txBuffer.
txBuffer | Pointer to the tx bytes that will be stored in memory. Must have a minimum of txNumBytes elements. |
txNumBytes | Number of bytes to be written to the device. txBuffer must have a minimum of this many elements. |
void |
Definition at line 716 of file dataflash.c.
void dataflashQuadDisable | ( | ) |
OPCODE: 0x3D2A8167
Programs the NV-QE bit to a logical 0 to disable the Quad I/O commands.
0 |
Definition at line 634 of file dataflash.c.
void dataflashQuadEnable | ( | ) |
OPCODE: 0x3D2A8166
Programs the NV-QE bit to a logical 1 to enable the Quad I/O commands.
0 |
Definition at line 621 of file dataflash.c.
void dataflashQuadInputBuffer1Write | ( | uint32_t | address, |
uint8_t * | txBuffer, | ||
uint32_t | txNumBytes | ||
) |
OPCODE: 0x44
Programs 'txNumBytes' bytes of data to buffer 2 starting at the address indicated by address using SI, SO, WPb, and RESETb as inputs for quad input.
address | The 3 bytes address indicating the first location to be written to. Note page restrictions in manual. |
txBuffer | Pointer to the tx bytes that will be stored in buffer 2. Must have a minimum of txNumBytes elements. |
txNumBytes | Number of bytes to be written to buffer 2. txBuffer must have a minimum of this many elements. |
void |
Definition at line 581 of file dataflash.c.
void dataflashQuadInputBuffer2Write | ( | uint32_t | address, |
uint8_t * | txBuffer, | ||
uint32_t | txNumBytes | ||
) |
OPCODE: 0x47
Programs 'txNumBytes' bytes of data to buffer 2 starting at the address indicated by address using SI, SO, WPb, and RESETb as inputs for quad input.
address | The 3 bytes address indicating the first location to be written to. Note page restrictions in manual. |
txBuffer | Pointer to the tx bytes that will be stored in buffer 2. Must have a minimum of txNumBytes elements. |
txNumBytes | Number of bytes to be written to buffer 2. txBuffer must have a minimum of this many elements. |
void |
Definition at line 596 of file dataflash.c.
void dataflashQuadOutputRead | ( | uint32_t | address, |
uint8_t * | rxBuffer, | ||
uint32_t | rxNumBytes | ||
) |
OPCODE: 0x6B
Reads 'txNumBytes' bytes of data in Quad Output Mode starting at 'address' using SI, SO, WPb, and HOLDb as inputs to master.
address | Address starting from which the data in memory will be read. |
rxBuffer | Pointer to the byte array in which the read data will be stored. Must have at least rxNumBytes elements. |
rxNumBytes | Number of bytes to be read from the memory. rxBuffer must have a minimum of this many elements. |
void |
Definition at line 541 of file dataflash.c.
void dataflashReadConfigRegister | ( | uint8_t * | rxBuffer | ) |
OPCODE: 0x3F
Reads the configuration register and returns the 1-byte value in rxBuffer.
rxBuffer | the buffer in which the 1-byte value will be stored. |
void |
Definition at line 611 of file dataflash.c.
void dataflashReadMID | ( | uint8_t * | rxBuffer | ) |
OPCODE: 0x9F
Reads the manufacturer ID and stores the data in rxBuffer.
rxBuffer | Pointer to a byte array in which the data will be stored. Minimum of 8 bytes required. |
void |
Definition at line 76 of file dataflash.c.
void dataflashReadSectorLockdownReg | ( | uint8_t * | rxBuffer, |
uint32_t | rxNumBytes | ||
) |
OPCODE: 0x35 Reads 'rxNumBytes' bytes of data in from the SL register.
rxBuffer | Pointer to the byte array in which the read data will be stored. Must have at least rxNumBytes elements. |
rxNumBytes | Number of bytes to be read from the register. rxBuffer must have a minimum of this many elements. |
void |
Definition at line 693 of file dataflash.c.
void dataflashReadSectorProtectionReg | ( | uint8_t * | rxBuffer, |
uint32_t | rxNumBytes | ||
) |
OPCODE: 0x32
Reads 'txNumBytes' bytes of data in from the SPR register.
rxBuffer | Pointer to the byte array in which the read data will be stored. Must have at least rxNumBytes elements. |
rxNumBytes | Number of bytes to be read from the register. rxBuffer must have a minimum of this many elements. |
void |
Definition at line 365 of file dataflash.c.
void dataflashReadSecurityReg | ( | uint8_t * | rxBuffer, |
uint32_t | rxNumBytes | ||
) |
OPCODE: 0x77 Reads 'rxNumBytes' bytes of data in from the security register.
rxBuffer | Pointer to the byte array in which the read data will be stored. Must have at least rxNumBytes elements. |
rxNumBytes | Number of bytes to be read from the register. rxBuffer must have a minimum of this many elements. |
void |
Definition at line 375 of file dataflash.c.
void dataflashReadSR | ( | uint8_t * | rxBuffer | ) |
OPCODE: 0xD7
Reads the value in the device status register (bytes 1 and 2).
rxBuffer | Pointer to the byte array in which the read data will be stored. Must have at least 2 elements. |
void |
Definition at line 86 of file dataflash.c.
void dataflashReadSRLegacy | ( | uint8_t * | rxBuffer | ) |
OPCODE: 0x57
LEGACY: Reads the value in the device status register (bytes 1 and 2).
rxBuffer | Pointer to the byte array in which the read data will be stored. Must have at least 2 elements. |
void |
Definition at line 519 of file dataflash.c.
void dataflashResumeFromDPD | ( | ) |
OPCODE: 0xAB
Wake the device from deep power down mode. See dataflashDPD().
void |
Definition at line 440 of file dataflash.c.
void dataflashRMWThruBuffer1 | ( | uint32_t | address, |
uint8_t * | txBuffer, | ||
uint32_t | txNumBytes | ||
) |
OPCODE: 0x58
Reads main memory to buffer 1, modifies it, then writes the data back to main memory with built in erase.
address | The 3 bytes address indicating the first location to be written to. |
txBuffer | Pointer to the tx bytes that will be stored in memory. Must have a minimum of txNumBytes elements. |
txNumBytes | Number of bytes to be written to the device. txBuffer must have a minimum of this many elements. |
void |
Definition at line 290 of file dataflash.c.
void dataflashRMWThruBuffer2 | ( | uint32_t | address, |
uint8_t * | txBuffer, | ||
uint32_t | txNumBytes | ||
) |
OPCODE: 0x59
Reads main memory to buffer 1, modifies it, then writes the data back to main memory with built in erase.
address | The 3 bytes address indicating the first location to be written to. |
txBuffer | Pointer to the tx bytes that will be stored in memory. Must have a minimum of txNumBytes elements. |
txNumBytes | Number of bytes to be written to the device. txBuffer must have a minimum of this many elements. |
void |
Definition at line 821 of file dataflash.c.
void dataflashSectorErase | ( | uint32_t | address | ) |
OPCODE: 0x7C
OPCODE: 0x7C
Erases a sector of data starting from page address 'address.'
address | The 3 byte page address at which the block erase will start. |
void |
Definition at line 267 of file dataflash.c.
void dataflashSectorLockdown | ( | uint32_t | address | ) |
OPCODE: 0x3D_2A_7F_30
Permanently a sector to prevent erasing or programming the stored data.
address | The address of the sector to be locked. |
Definition at line 677 of file dataflash.c.
void dataflashSoftwareReset | ( | ) |
OPCODE: 0xF0_00_00_00
Perform a software reset on the device. This will terminate any read or write operation in progress.
Definition at line 476 of file dataflash.c.
void dataflashUDPDMode | ( | ) |
OPCODE: 0x79
Put the device into ultra deep power down mode. Wake the device with dataflashHardwareReset().
void |
Definition at line 425 of file dataflash.c.
void dataflashWaitOnReady | ( | ) |
: Wait while Read/Busy Status bit in SRB is 1 (device is busy).
void |
Definition at line 65 of file dataflash.c.
uint8_t txDataflashInternalBuffer[MAXIMUM_TX_BYTES] |
Definition at line 61 of file dataflash.c.