/* Function: MX25_WRSCUR Arguments: None. Description: The WRSCUR instruction is for changing the values of Security Register Bits. Return Message: FlashIsBusy, FlashOperationSuccess, FlashWriteRegFailed, FlashTimeOut  */
ReturnMsg MX25_WRSCUR(void)
/* Function: MX25_WRSCUR Arguments: None. Description: The WRSCUR instruction is for changing the values of Security Register Bits. Return Message: FlashIsBusy, FlashOperationSuccess, FlashWriteRegFailed, FlashTimeOut  */
ReturnMsg MX25_WRSCUR(void)
{
    uint8_t  gDataBuffer;
    if( IsFlashBusy() )    return FlashIsBusy;
    MX25_WREN();
    CS_Low();
    SendByte( FLASH_CMD_WRSCUR, SIO );
    CS_High();
    if( WaitFlashReady( WriteSecuRegCycleTime ) ){
        MX25_RDSCUR( &gDataBuffer );
        if( (gDataBuffer & FLASH_LDSO_MASK) == FLASH_LDSO_MASK )
                return FlashOperationSuccess;
        else
                return FlashWriteRegFailed;
    }
    else
        return FlashTimeOut;
}