/* Erase Command Function: MX25_SE Arguments: flash_address, 32 bit flash memory address Description: The SE instruction is for erasing the data of the chosen sector (4KB) to be "1". Return Message: FlashAddressInvalid, FlashIsBusy, FlashOperationSuccess, FlashTimeOut  */
ReturnMsg MX25_SE(uint32_t flash_address)
/* Erase Command Function: MX25_SE Arguments: flash_address, 32 bit flash memory address Description: The SE instruction is for erasing the data of the chosen sector (4KB) to be "1". Return Message: FlashAddressInvalid, FlashIsBusy, FlashOperationSuccess, FlashTimeOut  */
ReturnMsg MX25_SE(uint32_t flash_address)
{
    uint8_t  addr_4byte_mode;
    if( flash_address > FlashSize ) return FlashAddressInvalid;
    if( IsFlashBusy() )    return FlashIsBusy;
    if( IsFlash4Byte() )
        addr_4byte_mode = TRUE;
    else
        addr_4byte_mode = FALSE;
    MX25_WREN();
    CS_Low();
    SendByte( FLASH_CMD_SE, SIO );
    SendFlashAddr( flash_address, SIO, addr_4byte_mode );
    CS_High();
    if( WaitFlashReady( SectorEraseCycleTime ) )
        return FlashOperationSuccess;
    else
        return FlashTimeOut;
}