DRV_SST38_Initialize Function

C

SYS_MODULE_OBJ DRV_SST38_Initialize
(
    const SYS_MODULE_INDEX drvIndex,
    const SYS_MODULE_INIT *const init
)

Summary

Initializes the SST38 Driver

Description

This routine initializes the SST38 driver making it ready for client to use.

Precondition

None.

Parameters

ParamDescription
drvIndexIdentifier for the instance to be initialized
initPointer to a data structure containing any data necessary to initialize the driver.

Returns

If successful, returns a valid handle to a driver instance object. Otherwise it returns SYS_MODULE_OBJ_INVALID.

Example

// This code snippet shows an example of initializing the SST38 Driver
// with SST38 Parallel flash device attached.

SYS_MODULE_OBJ  objectHandle;

const DRV_SST38_PLIB_INTERFACE drvSST38PlibAPI = {
    .write              = (DRV_SST38_PLIB_WRITE)HEMC_Write16,
    .read               = (DRV_SST38_PLIB_READ)HEMC_Read16,
    .eccDisable         = (DRV_SST38_PLIB_ECC_DISABLE)HEMC_DisableECC,
    .eccEnable          = (DRV_SST38_PLIB_ECC_ENABLE)HEMC_EnableECC,
};

const DRV_SST38_INIT drvSST38InitData =
{
    .sst38Plib         = &drvSST38PlibAPI,
};

objectHandle = DRV_SST38_Initialize((SYS_MODULE_INDEX)DRV_SST38_INDEX, (SYS_MODULE_INIT *)&drvSST38InitData);

if (SYS_MODULE_OBJ_INVALID == objectHandle)
{
    printf("Initialization Error");
}

Remarks

This routine must be called before any other SST38 driver routine is called.

This routine should only be called once during system initialization.