Motorola MC68328 Technical Information Seite 29

  • Herunterladen
  • Zu meinen Handbüchern hinzufügen
  • Drucken
  • Seite
    / 44
  • Inhaltsverzeichnis
  • LESEZEICHEN
  • Bewertet. / 5. Basierend auf Kundenbewertungen
Seitenansicht 28
Software Development
Porting FLEX One-Way Stack to the MC68328 MPU
FLEX Alphanumeric Chip MC68175 Interface 3-11
3.2.1 Creating the SPI Driver
The SPI interrupt service routines are hardware dependent and require the most porting
effort. The recommended implementation code can be obtained from Motorola
Semiconductor Products Sector. Product engineers should attempt to understand this
code and reconfigure it according to their unique product specifications.
The recommended implementation code includes four functions, as shown in Examples
3-2 through 3-6. These functions are called FLEX IC Handler, storeData, FlexSPITransfer,
and waitForTransfer().
Example 3-2 Function FLEX IC Handler
/************************************************************************
* FUNCTION NAME: FlexICHandler() *
* Date created: 07/26/96 *
* *
* DESCRIPTIONS: *
* This function is the interrupt service routine for FLEXchip *
* IC. Every time the FLEXchip IC would like to communicate *
* with the host microprocessor, it will assert an interrupt to *
* the host. This interrupt service routine is responsible for *
* handling all communications between the host and the FLEXchip. *
* *
* INPUT: None *
* OUTPUT: None *
***********************************************************************/
void FlexICHandler()
{
volatile UVAR16 data1, data2;
volatile UVAR8 *ptr;
DISABLE_INT; /* Disable further interrupts */
/*
* First, we assert the FLEXchip chip-select to indicate that the
* host processor is ready to communicate with FLEXchip IC.
*/
portj_dat = (UVAR8 *) PJDATA;
*portj_dat &= ASSERT_SS;
/*
* Next, we prepare the 2 16-bit variables data1 and data2 to
* contain the 32-bit package that the host will send to the
* FLEXchip IC.
*/
Frees
cale Semiconductor,
I
Freescale Semiconductor, Inc.
For More Information On This Product,
Go to: www.freescale.com
nc...
Seitenansicht 28
1 2 ... 24 25 26 27 28 29 30 31 32 33 34 ... 43 44

Kommentare zu diesen Handbüchern

Keine Kommentare