
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 */
}
Comentários a estes Manuais