mcu/drv/fsl_flash_driver_c90tfs.c
/*FUNCTION**********************************************************************
 *
 * Function Name : FlashReadOnce
 * Description   : Read out a reserved 64 byte field located in the P-Flash IFR via given number
 * of record. See the corresponding reference manual to get the correct value of this number.
 *
 * Implements    : FlashReadOnce_Activity
 *END**************************************************************************/
FUNCTION

Function Name : FlashReadOnce
Description   : Read out a reserved 64 byte field located in the P-Flash IFR via given number
of record. See the corresponding reference manual to get the correct value of this number.

Implements    : FlashReadOnce_Activity
END
FUNCTION Function Name : FlashReadOnce Description : Read out a reserved 64 byte field located in the P - Flash IFR via given number of record . See the corresponding reference manual to get the correct value of this number . Implements : FlashReadOnce_Activity END
flash_drv_status_t FlashReadOnce(const flash_ssd_config_t * pSSDConfig, \
                                 uint8_t recordIndex, \
                                 uint8_t* pDataArray, \
                                 flash_command_sequence_t pFlashCommandSequence)
{
#ifdef DEV_ERROR_DETECT
    DEV_ASSERT(pSSDConfig != NULL);
    DEV_ASSERT(pDataArray != NULL);
    DEV_ASSERT(pFlashCommandSequence != NULL);
#endif
    flash_drv_status_t ret;    
    uint32_t temp;             
    uint8_t i;
    CLEAR_FTFx_FSTAT_ERROR_BITS;
    FTFx_FCCOB0 = FTFx_READ_ONCE;
    FTFx_FCCOB1 = recordIndex;
    ret = pFlashCommandSequence(pSSDConfig);
    if (FTFx_OK == ret)
    {
        for (i = 0U; i < FEATURE_FLS_PF_BLOCK_WRITE_UNIT_SIZE; i++)
        {
            temp = FTFx_BASE + i + 0x08U;
            pDataArray[i] = *(uint8_t *)temp;
        }
    }
    return (ret);
}
flash_drv_status_t FlashReadOnce ( const flash_ssd_config_t * pSSDConfig , uint8_t recordIndex , uint8_t * pDataArray , flash_command_sequence_t pFlashCommandSequence ) { #ifdef DEV_ERROR_DETECT DEV_ASSERT ( pSSDConfig != NULL ) ; DEV_ASSERT ( pDataArray != NULL ) ; DEV_ASSERT ( pFlashCommandSequence != NULL ) ; #endif flash_drv_status_t ret ; uint32_t temp ; uint8_t i ; CLEAR_FTFx_FSTAT_ERROR_BITS ; FTFx_FCCOB0 = FTFx_READ_ONCE ; FTFx_FCCOB1 = recordIndex ; ret = pFlashCommandSequence ( pSSDConfig ) ; if ( FTFx_OK == ret ) { for ( i = 0U ; i < FEATURE_FLS_PF_BLOCK_WRITE_UNIT_SIZE ; i ++ ) { temp = FTFx_BASE + i + 0x08U ; pDataArray [ i ] = * ( uint8_t * ) temp ; } } return ( ret ) ; }
FUNCTION
FUNCTION
/* Return code variable */ /* Temporary variable */ /* Clear RDCOLERR & ACCERR & FPVIOL flag in flash status register. Write 1 to clear */ /* Passing parameter to the command */ /* Calling flash command sequence function to execute the command */ /* Checking for the success of command execution */ /* Read the data from the FCCOB registers into the pDataArray */