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. 55
Document ID: PMC-2010419, Issue 1
Valid States
SUNI4x622_MOD_IDLE, SUNI4x622_MOD_READY
Side Effects
None
Deleting an Initialization Profile: suni4x622DeleteInitProfile
This function deletes an initialization profile given its profile number.
Prototype
INT4 suni4x622DeleteInitProfile(UINT2 profileNum)
Inputs
profileNum : initialization profile number
Outputs
None
Returns
Success =
SUNI4x622_SUCCESS
Failure = SUNI4x622_ERR_INVALID_MODULE_STATE
SUNI4x622_ERR_INVALID_PROFILE_NUM
Valid States
SUNI4x622_MOD_IDLE, SUNI4x622_MOD_READY
Side Effects
None
4.3 Device Management
The device management is a set of API functions that are used by the application to control the
device. These functions take care of initializing a device in a specific configuration, enabling the
device general activity as well as enabling interrupt processing for that device. They are also used
to change the software state for that device. For more information on the device states see the
state diagram on page 19. For a typical device management flow diagram see page 22.
Adding a Device: suni4x622Add
This function verifies the presence of a new device in the hardware then returns a handle back to
the user. The device handle is passed as a parameter of most of the device API Functions. It’s
used by the driver to identify the device on which the operation is to be performed.
Prototype
sSUNI4x622_HNDL suni4x622Add(sSUNI4x622_USR_CTXT
usrCtxt, void *pBaseAddr, INT4 **perrDevice)
Inputs
usrCtxt : user context for this device
pBaseAddr : (pointer to) base address of the device
perrDevice : (pointer to) an area of memory
Outputs
ERROR code written to the MDB on failure
SUNI4x622_ERR_INVALID_MODULE_STATE
SUNI4x622_ERR_INVALID_ARG
SUNI4x622_ERR_DEVS_FULL
SUNI4x622_ERR_DEV_ALREADY_ADDED
SUNI4x622_ERR_INVALID_DEV