A SERVICE OF

logo

Getting Started with ADSP-BF548 EZ-KIT Lite 3-13
Using ADSP-BF548 EZ-KIT Lite Peripherals
Other device manager commands include
ADI_DEV_CMD_REGISTER_TABLE_WRITE whose operand is the address of an
application-defined table of register name/value pairs, and
ADI_DEV_CMD_REGISTER_FIELD_TABLE_WRITE which takes a table of register
name/field name/value triples. The application can supply tables of
whole-register or part-register values to modify an entire set of device reg-
isters with one call to adi_dev_Control(). The InitAudio() function
contains a call (not shown) setting up the AD1980 audio codec’s registers
appropriately for the two channel stereo audio samples supplied at a later
time.
The device driver-specific control commands are individual to each driver.
Many of them, however, are concerned with passing extra configuration
information. Listing 3-3 shows an example. First, a structure is populated
with the information that the driver requires. The structure layout is
defined in the AD1980 audio codec device driver header file (<driv-
ers/codec/adi_ad1980.h>
) included in Audio.c. The information held in
the structure includes the memory address and size of some work areas
that the driver instance needs for operation. Also often required is infor-
mation regarding the target hardware configuration. In Listing 3-3, we
inform the driver that the AD1980 audio codec connects to SPORT0 for
data transfers, and that programmable flag PB3 connects to the codec’s
reset pin. (Identifiers SPORT_DEVICE_NUMBER and AD1980_RESET_FLAG are
defined and initialized elsewhere in the application.)
Listing 3-3. Initializing Specific Diver
InitAD1980.pDataFrame = (void *)AudioFrameBuffer;
InitAD1980.DataFrameSize = AUDIO_FRAME_BUFFER_SIZE;
InitAD1980.pAC97 = &AC97_Instance;
InitAD1980.ResetFlagId = AD1980_RESET_FLAG;
InitAD1980.SportDevNumber = SPORT_DEVICE_NUMBER;
if((Result = adi_dev_Control( AD1980DriverHandle,
ADI_AD1980_CMD_INIT_DRIVER,
(void*)&InitAD1980 ))
!= ADI_DEV_RESULT_SUCCESS)