Motorola MC68328 Información técnica Pagina 33

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 44
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 32
Software Development
Porting FLEX One-Way Stack to the MC68328 MPU
FLEX Alphanumeric Chip MC68175 Interface 3-15
Example 3-4 Function FlexSPITransfer
/************************************************************************
* FUNCTION NAME: FlexSPITransfer() *
* Date created: 07/26/96 *
* *
* DESCRIPTIONS: *
* This function performs data communication via the *
* Serial Peripheral Interface (SPI). Given the Dragonball as *
* the 16-bit data bus microprocessor, two transmissions are *
* needed, with 16 bits of data for each transmission. *
* *
* INPUT: 32-bit of data to be sent to the FLEXchip IC *
* data1: Pointer to the first 16-bit data *
* data2: Pointer to the second 16-bit data *
* OUTPUT: data1 and data2 contain data received from the *
* FLEXchip IC. *
***********************************************************************/
void FlexSPITransfer(UVAR16 *data1, UVAR16 *data2)
{
*spmode &= XCH_MASK; /* Make sure no other transmission */
*spmode |= SPMEN_BIT; /* Enable SPI */
/* First 16-bit data transmission */
*spbd = *data1;
*spmode |= XCH_BIT;
waitForTransfer();
*data1 = *spbd; /* End of the first 16-bit transfer - data1
contains data from the FLEXchip IC */
/* Second 16-bit data transmission */
*spbd = *data2;
*spmode |= XCH_BIT;
waitForTransfer();
*data2 = *spbd; /* End of the second 16-bit transfer - data2
contains data from the FLEXchip IC */
return;
}
Frees
cale Semiconductor,
I
Freescale Semiconductor, Inc.
For More Information On This Product,
Go to: www.freescale.com
nc...
Vista de pagina 32
1 2 ... 28 29 30 31 32 33 34 35 36 37 38 ... 43 44

Comentarios a estos manuales

Sin comentarios