PMC-Sierra PM5358 S/UNI 4x622 Power Screwdriver User Manual


 
PM5358 S/UNI-4x622 Driver Manual
Application Programming Interface
Proprietary and Confidential to PMC-Sierra, Inc. 52
Document ID: PMC-2010419, Issue 1
4 APPLICATION PROGRAMMING INTERFACE
This section provides a detailed description of each function that is a member of the S/UNI-4x622
driver Application Programming Interface (API).
The API functions typically execute in the context of an application task.
Note: These functions are not re-entrant. This means that two application tasks can not invoke the
same API at the same time. However the driver protects its data structures from concurrent
accesses by the application and the DPR task.
4.1 Module Management
The module management is a set of API functions that are used by the application to open, start,
stop and close the driver module. These functions will take care of initializing the driver,
allocating memory and all RTOS resources needed by the driver. They are also used to change the
module state. For more information on the module states see the state diagram on page 19. For a
typical module management flow diagram see page 21.
Opening the Driver Module: suni4x622ModuleOpen
This function performs module level initialization of the device driver. This involves allocating
all of the memory needed by the driver and initializing the internal structures.
Prototype
INT4 suni4x622ModuleOpen(sSUNI4x622_MIV *pmiv)
Inputs
pmiv : (pointer to) Module Initialization Vector
Outputs
Places the address of the MDB into the MIV passed by the application
Returns
Success =
SUNI4x622_SUCCESS
Failure = SUNI4x622_ERR_INVALID_MODULE_STATE
SUNI4x622_ERR_INVALID_MIV
SUNI4x622_ERR_MEM_ALLOC
Valid States
SUNI4x622_MOD_START
Side Effects
Changes the MODULE state to
SUNI4x622_MOD_IDLE
Closing the Driver Module: suni4x622ModuleClose
This function performs module level shutdown of the driver. This involves deleting all devices
being controlled by the driver (by calling
suni4x622Delete for each device) and de-allocating
all the memory allocated by the driver.
Prototype
INT4 suni4x622ModuleClose(void)