42 #ifndef STANDARDFLASH_H_ 43 #define STANDARDFLASH_H_ 51 #if (PARTNO == AT25SF641) || \ 52 (PARTNO == AT25SF321) || \ 53 (PARTNO == AT25SF161) || \ 54 (PARTNO == AT25SF081) || \ 55 (PARTNO == AT25SF041) || \ 56 (PARTNO == AT25SL128A) || \ 57 (PARTNO == AT25SL641) || \ 58 (PARTNO == AT25SL321) || \ 59 (PARTNO == AT25DL081) || \ 60 (PARTNO == AT25DL161) || \ 61 (PARTNO == AT25DF081A) || \ 62 (PARTNO == AT25DF321A) || \ 63 (PARTNO == AT25DF641A) || \ 64 (PARTNO == AT25QL128A) || \ 65 (PARTNO == AT25QL641) || \ 66 (PARTNO == AT25QL321) || \ 67 (PARTNO == AT25QF641) || \ 264 #if (PARTNO == AT25SF641) || \ 265 (PARTNO == AT25SF321) || \ 266 (PARTNO == AT25SF161) || \ 267 (PARTNO == AT25SF081) || \ 268 (PARTNO == AT25SF041) || \ 269 (PARTNO == AT25SL128A) || \ 270 (PARTNO == AT25SL641) || \ 271 (PARTNO == AT25SL321) || \ 272 (PARTNO == AT25QL128A) || \ 273 (PARTNO == AT25QL641) || \ 274 (PARTNO == AT25QL321) || \ 275 (PARTNO == AT25QF641) || \ 290 #if (PARTNO == AT25SF641) || \ 291 (PARTNO == AT25SL128A) || \ 292 (PARTNO == AT25SL641) || \ 293 (PARTNO == AT25SL321) || \ 294 (PARTNO == AT25QL128A) || \ 295 (PARTNO == AT25QL641) || \ 296 (PARTNO == AT25QL321) || \ 297 (PARTNO == AT25QF641) || \ 298 (PARTNO == AT25DL081) || \ 299 (PARTNO == AT25DL161) || \ 300 (PARTNO == AT25DF081A) || \ 301 (PARTNO == AT25DF321A) || \ 302 (PARTNO == AT25DF641A) || \ 308 #if (PARTNO == AT25SF641) || \ 309 (PARTNO == AT25SF321) || \ 310 (PARTNO == AT25SF161) || \ 311 (PARTNO == AT25SF081) || \ 312 (PARTNO == AT25SF041) || \ 313 (PARTNO == AT25SL128A) || \ 314 (PARTNO == AT25SL641) || \ 315 (PARTNO == AT25SL321) || \ 316 (PARTNO == AT25QL128A) || \ 317 (PARTNO == AT25QL641) || \ 318 (PARTNO == AT25QL321) || \ 319 (PARTNO == AT25QF641) || \ 387 void standardflashDualIORead(uint32_t address, uint8_t *rxBuffer, uint32_t rxNumBytes, uint8_t readMode, uint8_t modeByteValue);
430 void standardflashQuadIORead(uint32_t address, uint8_t *rxBuffer, uint32_t rxNumBytes, uint8_t readMode, uint8_t modeByteValue);
514 #if (PARTNO == AT25SF641) || \ 515 (PARTNO == AT25SF321) || \ 516 (PARTNO == AT25SF161) || \ 517 (PARTNO == AT25SL128A) || \ 518 (PARTNO == AT25SL641) || \ 519 (PARTNO == AT25SL321) || \ 520 (PARTNO == AT25QL128A) || \ 521 (PARTNO == AT25QL641) || \ 522 (PARTNO == AT25QL321) || \ 523 (PARTNO == AT25QF641) || \ 542 #if (PARTNO == AT25SF641) || \ 543 (PARTNO == AT25SL128A) || \ 544 (PARTNO == AT25SL641) || \ 545 (PARTNO == AT25SL321) || \ 546 (PARTNO == AT25QL128A) || \ 547 (PARTNO == AT25QL641) || \ 548 (PARTNO == AT25QL321) || \ 549 (PARTNO == AT25QF641) || \ 609 #if (PARTNO == AT25DL081) || \ 610 (PARTNO == AT25DL161) || \ 611 (PARTNO == AT25DF081A) || \ 612 (PARTNO == AT25DF321A) || \ 613 (PARTNO == AT25DF641A) || \ void standardflashReadArrayLowFreq(uint32_t address, uint8_t *rxBuffer, uint32_t rxNumBytes)
OPCODE: 0x03 Reads rxNumBytes starting from location 'address' and stores the data in the byte arra...
void standardflashQuadOutputRead(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...
void standardflashChipErase1()
OPCODE: 0x60 Erases the entire chip by setting all bits. standardflashChipErase2() is functionally ...
void standardflashReadArrayHighFreq(uint32_t address, uint8_t *rxBuffer, uint32_t rxNumBytes)
OPCODE: 0x0B Reads rxNumBytes starting from location 'address' and stores the data in the byte arra...
void standardflashDualOutputRead(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 ...
void standardflashWriteSR(uint8_t *txBuffer, uint8_t txNumBytes)
OPCODE: 0x01 Writes the value in data to the status register byte 1, or bytes 1 and 2...
void standardflashSetQEBit()
: Sets the QE bit in status register byte 2. Does not modify any other bits. This is accomplished by ...
void standardflashWriteSRB2(uint8_t regVal)
uint8_t standardflashReadSRB2()
OPCODE: 0x35 Reads the value in the device status register (byte 2).
void standardflashBytePageProgram(uint32_t address, uint8_t *txBuffer, uint32_t txNumBytes)
OPCODE: 0x02 Programs 'txNumBytes' bytes of data starting at the address indicated by address...
void standardflashDisableQPI()
OPCODE: 0xFF Switches the device from QPI mode to SPI mode, and sets a variable to spi mode...
void standardflashClearQEBit()
: Clears the QE bit in status register byte 2. Does not modify any other bits. This is accomplished b...
void standardflashQuadPageProgram(uint32_t address, uint8_t *txBuffer, uint32_t txNumBytes, uint8_t mode)
OPCODE: 0x33 Programs 'txNumBytes' bytes of data starting at the address indicated by address using...
void standardflashProtectSector(uint32_t address)
OPCODE: 0x36 Protects a sector containing the address address.
void standardflashFreezeLockdownState()
OPCODE: 0x34 Freezes the current state of the sector lockdown registers.
void standardflashWriteSRB1(uint8_t regVal)
void standardflashProgramEraseSuspend()
OPCODE: 0xB0 Suspends an erase or program mid operation.
void standardflashReadMID(uint8_t *rxBuffer)
OPCODE: 0x9F Reads the manufacturer ID and stores the data in rxBuffer.
void standardflashReadID(uint8_t *rxBuffer)
OPCODE: 0x90 Legace Command: Reads the manufacturer ID and stores the data in rxBuffer.
void standardflashBlockErase4K(uint32_t address)
OPCODE: 0x20 Erases a block of data (4 KBytes) starting from page address 'address.'.
void standardflashEnableQPI()
OPCODE: 0x38 Switches the device from SPI mode to QPI mode, and sets a variable to quad mode...
uint8_t standardflashReadLockdownReg(uint32_t address)
OPCODE: 0x35 Reads the sector lockdown register for address address.
void standardflashProgramSecurityRegisters(uint32_t address, uint8_t *txBuffer, uint32_t txNumBytes)
OPCODE: 0x42 Programs the security registers with the contents of txBuffer.
void standardflashEraseProgramSuspend()
OPCODE: 0x75 Suspends an erase or program mid operation.
void standardflashEnableReset()
OPCODE: 0x66 Enable software reset of the flash device.
void standardflashProgramOTPReg(uint32_t address, uint8_t *txBuffer, uint32_t txNumBytes)
OPCODE: 0x9B Programs 'txNumBytes' bytes of data to the OTP register starting at the address indica...
void standardflashReset()
OPCODE: 0x99 Software reset the flash device.
void standardflashQuadIORead(uint32_t address, uint8_t *rxBuffer, uint32_t rxNumBytes, uint8_t readMode, uint8_t modeByteValue)
OPCODE: 0xEB Reads 'txNumBytes' bytes of data in Quad IO Mode starting at 'address' using SI...
void standardflashWaitOnReady()
: Wait while Read/Busy Status bit in SRB is 1 (device is busy). This is accomplished by reading the f...
void standardflashEraseProgramResume()
OPCODE: 0x7A Resumes a previously suspended erase or program.
void standardflashResumeFromDPD()
OPCODE: 0xAB Wake the device from deep power down mode. See dataflashDPD().
uint8_t standardflashReadSRB1()
OPCODE: 0x05 Reads the value in the device status register (byte 1).
void standardflashResumeFromDPDReadID(uint8_t *rxBuffer)
OPCODE: 0xAB Wake the device from deep power down mode and read the 1 byte ID. See standardflashDPD...
Declarations of spi_driver functions.
void standardflashChipErase2()
OPCODE: 0xC7 Erases the entire chip by setting all bits. standardflashChipErase1() is functionally ...
void standardflashDualInputBytePageProgram(uint32_t address, uint8_t *txBuffer, uint32_t txNumBytes)
OPCODE: 0xA2 Programs 'txNumBytes' bytes of data starting at the address indicated by address using...
void standardflashDPD()
OPCODE: 0xB9 Put the device into deep power down mode. Call dataflashResumeFromDPD() to wake up...
uint8_t standardflashReadSectorProtectionReg(uint32_t address)
OPCODE: 0x3C Reads the sector protection register for address address.
void standardflashBlockErase64K(uint32_t address)
OPCODE: 0xD8 Erases a block of data (4 KBytes) starting from page address 'address.'.
void standardflashReadSR(uint8_t *rxBuffer)
OPCODE: 0x05 Reads the value in the device status register (byte 1 and 2).
void standardflashUnprotectSector(uint32_t address)
OPCODE: 0x39 Un-protects a sector containing the address address.
void standardflashWriteEnableVolatileSR()
OPCODE: 0x50 Sends opcode to enable writing for the volatile status register.
void standardflashReadSecurityRegisters(uint32_t address, uint8_t *rxBuffer, uint32_t rxNumBytes)
OPCODE: 0x48 Reads the contents of the security registers and stores it in the rxBuffer.
void standardflashExitSecuredOTP()
OPCODE: 0xC1 Exit secured OTP region.
void standardflashContinuousReadModeDualReset()
OPCODE: 0xFFFF Resets the dual continuous read mode that was entered with standardflashDualIORead()...
Declarations of helper functions.
void standardflashEnterSecureOTP()
OPCODE: 0xB1 Enter secured OTP region.
void standardflashBlockErase32K(uint32_t address)
OPCODE: 0x52 Erases a block of data (4 KBytes) starting from page address 'address.'.
void standardflashWriteDisable()
OPCODE: 0x04 Sends opcode to disable writing.
void standardflashDualIORead(uint32_t address, uint8_t *rxBuffer, uint32_t rxNumBytes, uint8_t readMode, uint8_t modeByteValue)
OPCODE: 0xBB Reads 'txNumBytes' bytes of data in Dual IO Mode starting at 'address' using both SI a...
void standardflashContinuousReadModeQuadReset()
OPCODE: 0xFF Resets the quad continuous read mode that was entered with standardflashQuadIORead() w...
void standardflashWriteEnable()
OPCODE: 0x06 Sends opcode to enable writing.
void standardflashProgramEraseResume()
OPCODE: 0xD0 Resumes a previously suspended erase or program.
uint8_t txStandardflashInternalBuffer[MAXIMUM_TX_BYTES]
void standardflashEraseSecurityRegister(uint32_t address)
OPCODE: 0x44 Sends opcode to erase the security registers.