1.1.8.4.20 DRV_SFDP_INIT Structure

1.1.8.4.20 C

typedef struct
{
    /* Identifies the PLIB API set to be used by the driver to access the
     * peripheral. */
    const DRV_SFDP_PLIB_INTERFACE *sfdpPlib;
} DRV_SFDP_INIT;

1.1.8.4.20 Summary

SFDP Driver Initialization Data Structure.

1.1.8.4.20 Description

This structure contains the data required for initializing the SFDP driver. It holds a pointer to the PLIB interface structure that the driver will use to communicate with the Flash device.

1.1.8.4.20 Members

MemberDescription
sfdpPlibPointer to the PLIB API interface structure (DRV_SFDP_PLIB_INTERFACE)

1.1.8.4.20 Example

const DRV_SFDP_PLIB_INTERFACE drvSFDPPlibAPI = {
    .CommandWrite  = QSPI_CommandWrite,
    .RegisterRead  = QSPI_RegisterRead,
    .RegisterWrite = QSPI_RegisterWrite,
    .MemoryRead    = QSPI_MemoryRead,
    .MemoryWrite   = QSPI_MemoryWrite
};

const DRV_SFDP_INIT drvSFDPInitData =
{
    .sfdpPlib = &drvSFDPPlibAPI,
};

SYS_MODULE_OBJ objectHandle = DRV_SFDP_Initialize((SYS_MODULE_INDEX)DRV_SFDP_INDEX, 
                                                  (SYS_MODULE_INIT *)&drvSFDPInitData);

1.1.8.4.20 Remarks

This structure must be populated and passed to the DRV_SFDP_Initialize() function during driver initialization. The sfdpPlib member should point to a properly initialized DRV_SFDP_PLIB_INTERFACE structure with valid function pointers to the peripheral library functions.