/* Enables critical writes operation on a serial flash device, such as sector protection, status register, etc.  */
void s25fl1xx_enable_wrap(struct qspid_t *qspid, uint8_t byte_align)
/* Enables critical writes operation on a serial flash device, such as sector protection, status register, etc.  */
void s25fl1xx_enable_wrap(struct qspid_t *qspid, uint8_t byte_align)
{
	uint8_t status[3];
	status[0] = s25fl1xx_read_status1(qspid);
	status[1] = s25fl1xx_read_status2(qspid);
	status[2] = s25fl1xx_read_status3(qspid);
	status[2] |= (byte_align << 5);
	dev->inst_frame.bm.b_dummy_cycles = 24;
	s25fl1xx_exec_command(qspid, S25FL1XX_WRAP_ENABLE,(uint32_t *)&status[2], 0,  QSPI_WRITE_ACCESS, 1);
	s25fl1xx_write_volatile_status(qspid, status);
	status[2] = s25fl1xx_read_status3(qspid);
	while(!(status[2] & 0x10));
}