Renesas Single-Chip Microcomputer M38C89T-ADF Manuale Utente Pagina 131

  • Scaricare
  • Aggiungi ai miei manuali
  • Stampa
  • Pagina
    / 138
  • Indice
  • SEGNALIBRI
  • Valutato. / 5. Basato su recensioni clienti
Vedere la pagina 130
4BUsage Examples
5.7 Serial Communication Interface
5
5-15
Rev.1.00 May 22 2012
REJ09B0566
/* The following 'r_pdl' header files define the API functions used in this
file */
#include "r_pdl_definitions.h"
/* The following 'r_pdl' header files define the SCI RPDL API functions
prototypes*/
#include "r_pdl_sci_library_SH7267.h"
/* The following 'r_pdl' header files define the CPG RPDL API functions
prototypes*/
#include "r_pdl_cpg_library_SH7267.h"
/* The following 'r_pdl' header files define the PFC RPDL API functions
prototypes*/
#include "r_pdl_pfc_library_SH7267.h"
/* The following 'r_pdl' header files define the IOPORT RPDL API functions
prototypes*/
#include "r_pdl_io_port_library_SH7267.h"
/* Following header file provides a structure to access on-chip I/O registers. */
#include "iodefine.h"
/* Following header file provides macro defines and prototype for the functions
contained in this file. */
#include "lcd.h"
/*******************************************************************************
Constants
*******************************************************************************/
/* Constant data to be transmitted */
const unsigned char c_data[8] = "Renesas.";
/*******************************************************************************
Global Variables
*******************************************************************************/
/* Buffer to store the received data */
volatile unsigned char c_RecBuff[8];
/*******************************************************************************
Function Prototype
*******************************************************************************/
/* Function use as a Reception End Callback function */
void RecieveEnd(void);
/* Function use as a Reception Break error Callback function */
void RecieveBreak(void);
/* Function use as a Reception Error Callback function */
void RecieveError(uint8_t error);
void sio3_init(void);
void sio0_init(void);
/*******************************************************************************
User Program Code
*******************************************************************************/
/*""FUNC COMMENT""*************************************************************
* Outline : main
* Description: : Main function for the Serial IO Application
* Argument: : none
* Return value: : none
*""FUNC COMMENT END""*********************************************************/
void SCI_Test(void)
{
/* Modify the MCU clocks */
R_CPG_Set(18E6, 144E6, 36E6, PDL_CPG_CK_2, PDL_CPG_OUT_CK_01);
/* Configure LCD Pins */
/*Configure PJ6 to PJ11 as IO port pins */
R_PFC_Modify(PDL_PJCR1, PDL_PFC_AND, 0x00FF);
R_PFC_Modify(PDL_PJCR2, PDL_PFC_AND, 0x0000);
/*Configure PJ6 to PJ11 as output */
Vedere la pagina 130

Commenti su questo manuale

Nessun commento