Renesas Single-Chip Microcomputer M38C89T-ADF Instrukcja Użytkownika Strona 132

  • Pobierz
  • Dodaj do moich podręczników
  • Drukuj
  • Strona
    / 138
  • Spis treści
  • BOOKMARKI
  • Oceniono. / 5. Na podstawie oceny klientów
Przeglądanie stron 131
4BUsage Examples
5.7 Serial Communication Interface
5
5-16
Rev.1.00 May 22 2012
REJ09B0566
R_IO_PORT_Set(PDL_IO_PORT_J_6, PDL_IO_PORT_OUTPUT, 0);
R_IO_PORT_Set(PDL_IO_PORT_J_7, PDL_IO_PORT_OUTPUT, 0);
R_IO_PORT_Set(PDL_IO_PORT_J_8, PDL_IO_PORT_OUTPUT, 0);
R_IO_PORT_Set(PDL_IO_PORT_J_9, PDL_IO_PORT_OUTPUT, 0);
R_IO_PORT_Set(PDL_IO_PORT_J_10, PDL_IO_PORT_OUTPUT, 0);
R_IO_PORT_Set(PDL_IO_PORT_J_11, PDL_IO_PORT_OUTPUT, 0);
/* Reset the LCD module */
InitialiseDisplay();
/* Display the received string on the debug LCD */
DisplayString(LCD_LINE2,"Test_SCI");
/* Configure SIO3 port for transmission */
sio3_init();
/* Configure SIO0 port for reception */
sio0_init();
/* Send the Data from the SCIF_3 with polling base transmission */
R_SCI_Send(3,0,c_data,PDL_SCI_IDLE,PDL_NA);
/* This loop should never exit. */
while (1)
{
/* Wait forever */
}
}
/******************************************************************************
End of function main
******************************************************************************/
/*""FUNC COMMENT""*************************************************************
* Outline : sio3_init
* Description: : Configures SIO3 in transmit mode
* Argument : none
* Return value: : none
*""FUNC COMMENT END""*********************************************************/
void sio3_init(void)
{
/* configure SCIF_3 in synchronous serial Mode. Configured it as a transmitter with
BAUD rate of 10,000 */
R_SCI_Create(3, PDL_SCI_SYNC | PDL_SCI_CLK_INT_OUT |PDL_SCI_TX_CONNECTED ,
10000,2,0);
}
/******************************************************************************
End of function sio3_init
******************************************************************************/
/*""FUNC COMMENT""*************************************************************
* Outline : sio0_init
* Description: : Configures SIO0 in receive mode
* Argument: : none
* Return value: : none
*""FUNC COMMENT END""*********************************************************/
void sio0_init(void)
{
/* configure SCIF_0 in synchronous serial Mode. Configured it as a receiver with
BAUD rate of 10,000 */
R_SCI_Create(0, PDL_SCI_SYNC | PDL_SCI_CLK_INT_I |PDL_SCI_RX_CONNECTED ,
10000, 2, 0);
/* Set SCIF_0 for interrupt base reception. Function is set to give callback
after 8 data bytes is received*/
R_SCI_Receive(0, 0, &c_RecBuff, 8,
Przeglądanie stron 131

Komentarze do niniejszej Instrukcji

Brak uwag