PM5358 S/UNI-4x622 Driver Manual

Application Programming Interface

4.4Device Read and Write

Reading from Device Registers: suni4x622Read

This function reads a register of a specific S/UNI-4x622 device by providing the register number. This function derives the actual address location based on the device handle and register number inputs. It then reads the contents of this address location using the system specific macro, sysSuni4x622Read. Note that a failure to read returns a zero and any error indication is written to the associated DDB.

Prototype

Inputs

Outputs

Returns

Valid States

Side Effects

UINT1 suni4x622Read(sSUNI4x622_HNDL deviceHandle, UINT2 regNum)

deviceHandle

: device handle (from suni4x622Add)

regNum

: register number

ERROR code written to the MDB

SUNI4x622_ERR_INVALID_DEV

ERROR code written to the DDB

SUNI4x622_ERR_INVALID_REG

Success = value read

Failure = 0

SUNI4x622_PRESENT, SUNI4x622_ACTIVE,

SUNI4x622_INACTIVE

May affect registers that change after a read operation

Writing to Device Registers: suni4x622Write

This function writes to a register of a specific S/UNI-4x622 device by providing the register number. This function derives the actual address location based on the device handle and register number inputs. It then writes the contents of this address location using the system specific macro, sysSuni4x622Write. Note that a failure to write returns a zero and any error indication is written to the DDB.

Prototype

Inputs

Outputs

Returns

UINT1 suni4x622Write(sSUNI4x622_HNDL deviceHandle, UINT2 regNum, UINT1 value)

deviceHandle

: device handle (from suni4x622Add)

regNum

: register number

value

: value to be written

ERROR code written to the MDB

SUNI4x622_ERR_INVALID_DEV

ERROR code written to the DDB

SUNI4x622_ERR_INVALID_REG

Success = value written

Proprietary and Confidential to PMC-Sierra, Inc.

59

Document ID: PMC-2010419, Issue 1

 

Page 59
Image 59
PMC-Sierra PM5358 S/UNI 4x622 manual Device Read and Write, Reading from Device Registers suni4x622Read