68HC11 SOURCE CODE DESCIPTION
EVENT-HANDLER FUNCTION
MOTOROLA
DSPD56362EVM Upgrade Manual
3-5
3.5
EVENT-HANDLER FUNCTION
The
ProcessEvent( )
function processes the events according to the current display mode and
keypad action. For example, if the current mode is
MUTE_MODE
, the
ProcessEvent
function
sends the mute command to the DSP if switch S2 is pressed, or it sends the unmute command to the
DSP if switch S3 is pressed, or sets the mode to the decoder status mode
DEC_MODE
if S5 pressed.
ProcessEvent ( )
{
case(MUTE_MODE):
{
send MUTE opcode if S2 is pressed
send UNMUTE opcode if S3 is pressed
return to start screen if S5 is pressed
break;
}
}
3.6
SPI COMMUNICATION
Communication between the 68HC11 host microcontroller and the DSP is via SPI. The host is
configured as the master and the DSP is configured as the slave. The
ExchangeSPI_DSP
(rx_addr, tx_addr)
function performs the SPI communication by exchanging 3 bytes. Data
at address
tx_addr
is transmitted to the DSP and data received from the DSP is stored at address
rx_addr
.
3.6.1
Receiving Data from the DSP
The 68HC11 can receive a data word from the DSP by using the
GetDSP (opcode)
function.
This function is used for receiving status information from the DSP. The
opcode
parameter
specifies the status command. For example, the command
DSP_REPLY = GetDSP (MODE_SOURCE)
prompts the DSP to reply with the decoder type. In this case, the parameter
MODE_SOURCE
is the
command
0x0A02100
. The reply may be Dolby Digital, DTS, MPEG, or PCM. The status
opcodes are listed in the DSP56362 Applications User Manual.
F
re
e
sc
a
le
S
e
m
ic
o
n
d
u
c
to
r,
I
Freescale Semiconductor, Inc.
For More Information On This Product,
Go to: www.freescale.com
n
c
.
..