mcu/drv/fsl_flash_driver_c90tfs.c
/*FUNCTION**********************************************************************
 *
 * Function Name : DFlashSetProtection
 * Description   : Sets the D-Flash protection to the intended protection status.
 * Setting D-Flash protection status is subject to a protection transition restriction.
 * If there is a setting violation, it returns failed information
 * and the current protection status will not be changed.
 *
 * Implements    : DFlashSetProtection_Activity
 *END**************************************************************************/
FUNCTION

Function Name : DFlashSetProtection
Description   : Sets the D-Flash protection to the intended protection status.
Setting D-Flash protection status is subject to a protection transition restriction.
If there is a setting violation, it returns failed information
and the current protection status will not be changed.

Implements    : DFlashSetProtection_Activity
END
FUNCTION Function Name : DFlashSetProtection Description : Sets the D - Flash protection to the intended protection status . Setting D - Flash protection status is subject to a protection transition restriction . If there is a setting violation it returns failed information and the current protection status will not be changed . Implements : DFlashSetProtection_Activity END
flash_drv_status_t DFlashSetProtection(const flash_ssd_config_t * pSSDConfig, \
                                       uint8_t protectStatus)
{
#ifdef DEV_ERROR_DETECT
    DEV_ASSERT(pSSDConfig != NULL);
#endif
    flash_drv_status_t ret = FTFx_OK;    
    if (pSSDConfig->DFlashSize == 0U)
    {
        ret = FTFx_ERR_EFLASHONLY;
    }
    else
    {
        FTFx_FDPROT = protectStatus;
        if ( protectStatus != FTFx_FDPROT)
        {
            ret = FTFx_ERR_CHANGEPROT;
        }
        else
        {
        }
    }
    return (ret);
}
flash_drv_status_t DFlashSetProtection ( const flash_ssd_config_t * pSSDConfig , uint8_t protectStatus ) { #ifdef DEV_ERROR_DETECT DEV_ASSERT ( pSSDConfig != NULL ) ; #endif flash_drv_status_t ret = FTFx_OK ; if ( pSSDConfig -> DFlashSize == 0U ) { ret = FTFx_ERR_EFLASHONLY ; } else { FTFx_FDPROT = protectStatus ; if ( protectStatus != FTFx_FDPROT ) { ret = FTFx_ERR_CHANGEPROT ; } else { } } return ( ret ) ; }
FUNCTION
FUNCTION
/* Return code variable */ /* Check if size of DFlash = 0 */ /* Do nothing */