HP (Hewlett-Packard) EZ-KIT Switch User Manual


 
Event-Driven Device Drivers
6-2 Getting Started with ADSP-BF548 EZ-KIT Lite
Event-Driven Device Drivers
There are two classes of peripheral device within the ADSP-BF548 proces-
sor: those whose primary purpose is to control a flow of data in or out of
the processor, and those that generate or react to individual events. In
“Example 6: Displaying a Bitmap File on the EZ-KIT Lite” on page 5-4,
we have learned how the SSL’s device manager and DMA manager work
seamlessly with the EPPI device driver to control the flow of data to an
external peripheral (the LCD). With the help of the SSL device and DMA
managers, the application was responsible only for providing the required
data.
For event-driven peripherals that are common across the Blackfin family
of processors, the SSL provides generic API sets, such as the programma-
ble flag service, timer service, and port control service. Each service API
set includes useful functions for managing and controlling the relevant
peripheral(s). This chapter’s example project (Example_7.dpj) uses the
programmable flag service to control the state of LED indicators on the
ADSP-BF548 EZ-KIT Lite.
Event-driven peripherals specific to one or several Blackfin processors are
supported by device drivers. For ADSP-BF548 processors these peripher-
als include the keypad and rotary counter interfaces. The drivers for the
event-driven peripherals are used in the same manner as the drivers for
data-driven peripherals. In some respects, it is easier to use event-driven
drivers because an application uses the same device manager APIs to open,
configure, enable, disable, and close the device, and there is no need to set
up chains of DMA requests and to configure a dataflow model. This is
because all interactions with the device are event-based and handled in the
application’s callback function.
The callback function is where the difference between the data-driven and
event-driven device drivers is most evident. For data-driven events, the
emphasis is on processing the successful termination of data transfer oper-
ations and initiating new transfers. In this case, errors or exception