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


 
PM5358 S/UNI-4x622 Driver Manual
Software Architecture
Proprietary and Confidential to PMC-Sierra, Inc. 23
Document ID: PMC-2010419, Issue 1
The driver provides system-independent functions, suni4x622ISR and suni4x622DPR. You
must fill in the corresponding system-specific functions,
sysSuni4x622ISRHandler and
sysSuni4x622DPRTask. The system-specific functions isolate the system-specific
communication mechanism (between the ISR and DPR) from the system-independent functions,
suni4x622ISR and suni4x622DPR.
Figure 6 illustrates the interrupt service model used in the S/UNI-4x622 driver design.
Figure 6: Interrupt Service Mode
suni4x622ISR
sysSuni4x622ISRHandler
suni4x622DPR
Interrupt
Context
Information
sysSuni4x622DPRTask
Indication
Callbacks
Application
Note: Instead of using an interrupt service model, you can use a polling service model in the
S/UNI-4x622 driver to process the device’s event-indication registers (see page 26).
Calling suni4x622ISR
An interrupt handler function, which is system dependent, must call suni4x622ISR. But first,
the low-level interrupt-handler function must trap the device interrupts. You must implement this
function to fit your own system. As a reference, an example implementation of the interrupt
handler (sysSuni4x622ISRHandler) appears on page 110. You can customize this example
implementation to suit your needs.
The interrupt handler that you implement (
sysSuni4x622ISRHandler) is installed in the
interrupt vector table of the system processor. It is called when one or more S/UNI-4x622 devices
interrupt the processor. The interrupt handler then calls
suni4x622ISR for each device in the
active state that has interrupt processing enabled.
The
suni4x622ISR function reads from the master interrupt-status registers and the
miscellaneous interrupt-status registers of the S/UNI-4x622. If at least one valid interrupt
condition is found then
suni4x622ISR fills an Interrupt-Service Vector (ISV) with this status
information as well as the current device handle. The
suni4x622ISR function also clears and
disables all the device’s interrupts detected. The
sysSuni4x622ISRHandler function is then
responsible to send this ISV buffer to the DPR task.
Note: Normally you should save the status information for deferred processing by implementing a
message queue. The interrupt handler sends the status information to the queue by the
sysSuni4x622ISRHandler.