mcu/drv/fsl_flash_driver_c90tfs.c
/*FUNCTION**********************************************************************
 *
 * Function Name : DEFlashPartition
 * Description   : Prepares the FlexNVM block for use as D-Flash, EEPROM backup, or a combination
 * of both and initializes the FlexRAM.
 * The single partition choice should be used through entire life time of a given
 * application to guarantee the Flash endurance and data retention of Flash module.
 *
 * Implements    : DEFlashPartition_Activity
 *END**************************************************************************/
FUNCTION

Function Name : DEFlashPartition
Description   : Prepares the FlexNVM block for use as D-Flash, EEPROM backup, or a combination
of both and initializes the FlexRAM.
The single partition choice should be used through entire life time of a given
application to guarantee the Flash endurance and data retention of Flash module.

Implements    : DEFlashPartition_Activity
END
FUNCTION Function Name : DEFlashPartition Description : Prepares the FlexNVM block for use as D - Flash EEPROM backup or a combination of both and initializes the FlexRAM . The single partition choice should be used through entire life time of a given application to guarantee the Flash endurance and data retention of Flash module . Implements : DEFlashPartition_Activity END
flash_drv_status_t DEFlashPartition(const flash_ssd_config_t * pSSDConfig, \
                                    uint8_t uEEEDataSizeCode, \
                                    uint8_t uDEPartitionCode, \
                                    uint8_t uCSEcKeySize,     \
                                    bool uSFE,             \
                                    flash_command_sequence_t pFlashCommandSequence)
{
#ifdef DEV_ERROR_DETECT
    DEV_ASSERT(pSSDConfig != NULL);
    DEV_ASSERT(pFlashCommandSequence != NULL);
    DEV_ASSERT(uCSEcKeySize <= CSE_KEY_SIZE_CODE_MAX);
#endif
    flash_drv_status_t ret;    
    CLEAR_FTFx_FSTAT_ERROR_BITS;
    FTFx_FCCOB0 = FTFx_PROGRAM_PARTITION;
    FTFx_FCCOB1 = uCSEcKeySize;
    FTFx_FCCOB2 = (uSFE ? 1U : 0U);
    FTFx_FCCOB4 = uEEEDataSizeCode;
    FTFx_FCCOB5 = uDEPartitionCode;
    ret = pFlashCommandSequence(pSSDConfig);
    return (ret);
}
flash_drv_status_t DEFlashPartition ( const flash_ssd_config_t * pSSDConfig , uint8_t uEEEDataSizeCode , uint8_t uDEPartitionCode , uint8_t uCSEcKeySize , bool uSFE , flash_command_sequence_t pFlashCommandSequence ) { #ifdef DEV_ERROR_DETECT DEV_ASSERT ( pSSDConfig != NULL ) ; DEV_ASSERT ( pFlashCommandSequence != NULL ) ; DEV_ASSERT ( uCSEcKeySize <= CSE_KEY_SIZE_CODE_MAX ) ; #endif flash_drv_status_t ret ; CLEAR_FTFx_FSTAT_ERROR_BITS ; FTFx_FCCOB0 = FTFx_PROGRAM_PARTITION ; FTFx_FCCOB1 = uCSEcKeySize ; FTFx_FCCOB2 = ( uSFE ? 1U : 0U ) ; FTFx_FCCOB4 = uEEEDataSizeCode ; FTFx_FCCOB5 = uDEPartitionCode ; ret = pFlashCommandSequence ( pSSDConfig ) ; return ( ret ) ; }
FUNCTION
FUNCTION
/* Return code variable */ /* Clear RDCOLERR & ACCERR & FPVIOL & MGSTAT0 flag in flash status register. Write 1 to clear */ /* Passing parameter to the command */ /* Calling flash command sequence function to execute the command */