Motorola MPC564EVB Manuel d'utilisateur Page 90

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 98
  • Table des matières
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 89
3-40 MPC564EVB Users Manual
System Call Functions
{ /* assume r3 contains the character */
asm( addi r10, r0, 0x0000); Selects the function
asm( sc); The character is returned in r3
}
3.5.3 IN_STAT
This function (function code 0x0001) checks if an input character is present to receive. A value of
zero is returned in r3 when no character is present. A value of 1 in r3 means a character is present.
Assembly example:
addi r10, r0, 0x0001 Select the function
sc Make the call, r3 contains the response (yes/no).
C example:
int board_char_present (void)
{
asm( "addi r10,r0,0x0001");Select the function
asm( "sc"); Make the call, r3 contains the response (yes/no).
}
3.5.4 ISR_REGISTER
This functions code is 0x0040. For ISR_REGISTER, the vector, handler, device ptr, and arg ptr
are in r3, r4, r5, and r6 respectively.
C example:
int
board_isr_register (int vector, void *handler, void *device, void *arg)
{
/*
* Vector will normally be 0x0500 for IRQ. Handler should be address
* of your routine. Device and Arg are both used as arguments to
* Handler when it is invoked. Ie. handler(device,arg); It is
* intended that Device point to the device. If the handler is
* registered OK, 1 is returned, otherwise 0.
*/
asm( "addi r10,r0,0x0040");
asm( "sc");
}
3.5.5 ISR_REMOVE
This functions code is 0x0041. For ISR_REMOVE, the vector is in r3. Nothing is returned.
Assembly example:
addi r10, r0, 0x0041 Selects the function
sc The character is returned in r3
Frees
cale Semiconductor,
I
Freescale Semiconductor, Inc.
For More Information On This Product,
Go to: www.freescale.com
nc...
Vue de la page 89
1 2 ... 85 86 87 88 89 90 91 92 93 94 95 96 97 98

Commentaires sur ces manuels

Pas de commentaire