
3-18 FLEX Alphanumeric Chip MC68175 Interface
Software Development
Porting FLEX One-Way Stack to the MC68328 MPU
FStkNotifyNewMsg()
The FStkNotifyNewMsg() function is called each time FLEX One-Way Stack software
receives a new and completed FLEX message from the FLEX Alphanumeric Chip IC.
The message ID is passed to this function. Product engineers should implement this
function according to the product specifications. For example, FStkNotifyNewMsg() can
alert the user (with sounds or vibration) and/or retrieve the message from FLEX
One-Way Stack and display it on the screen or LCD. In Example 3-7, the new message
ID is simply stored in an array, and function GetPage() is called to display the message on
the LCD.
Send_4_bytes()
The Send_4_Bytes() function sends 4-byte packets to the FLEX Alphanumeric Chip using
the SPI. FLEX One-Way Stack uses this function to initiate the configuration process by
sending the FLEX Alphanumeric Chip a series of packets from the initialization buffer
(described earlier). This is the communication initiated by the host, so that the host
processor must first drive the FLEX Alphanumeric Chip chip-select signal low to start
the communication process. The actual SPI communication happens through the
interrupt service routine.
Example 3-7 Function FStkNotifyNewMsg() Sample
void FStkNotifyNewMsg(MSG msg)
{
UVAR8 i;
/*
* If the new message overflows the array (storage of messages),
* pop the oldest message off the array for storage.
*/
if (pageCount >= MSGTABLESZ)
MMMakeRoom();
/* Store message in the message table */
msgtable[pageCount] = msg->msgId;
GetPage(msg->msgId); /* Retrieve message for display */
pageCount++; /* Increase the number of pages */
}
Frees
cale Semiconductor,
I
Freescale Semiconductor, Inc.
For More Information On This Product,
Go to: www.freescale.com
nc...
Comentarios a estos manuales