Renesas Asynchronous SH7145F Manual de usuario Pagina 16

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 17
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 15
SH7145F
Multiprocessor Communications
REJ06B0358-0100O/Rev.1.00 March 2004 Page 16 of 17
void trans_id(char num){
while(!(P_SCI0.SSR_0.BYTE & 0x80)){ /* Wait until data can be written to TDR */
; /* (until TDRE is set to 1) */
}
if(num == 0){
P_SCI0.TDR_0 = ID_1; /* Write ID data to TDR */
}
else if(num == 1){
P_SCI0.TDR_0 = ID_2; /* Write ID data to TDR */
}
P_SCI0.SSR_0.BIT.MPBT = 1; /* Set MPBT bit to 1 */
P_SCI0.SSR_0.BYTE &= 0x7F; /* Clear flag, transmit */
}
/************************************************************************/
/* Function : trans_data */
/* Operation : Write 1 character to serial output */
/* Argument : d_num */
/* Value returned : None */
/************************************************************************/
void trans_data(char data){
while(!(P_SCI0.SSR_0.BYTE & 0x80)){ /* Wait until data can be written to TDR */
; /* (until TDRE is set to 1) */
}
P_SCI0.TDR_0 = data; /* Write data to TDR */
P_SCI0.SSR_0.BIT.MPBT = 0; /* Clear MPBT bit to 0 */
P_SCI0.SSR_0.BYTE &= 0x7F; /* Clear flag, transmit */
}
/**************************************
Interrupt handling
**************************************/
#pragma interrupt(dummy_f)
void dummy_f(void)
{
/* Other Interrupt */
}
Vista de pagina 15
1 2 ... 11 12 13 14 15 16 17

Comentarios a estos manuales

Sin comentarios