Example #1
0
/***********************************************************************************************************************
* Function Name: R_Systeminit
* Description  : This function initializes all peripherals used in this demo.
* Arguments    : None
* Return Value : None
***********************************************************************************************************************/
void R_Systeminit(void)
{
        /* Configure port pin assignments */
        PIOR = 0x00U;

        /* Configure the LCD */
        R_LCD_Create();

        /* Configure system clocks */
        R_CGC_Create();

        /* Configure ADC */
        R_ADC_Create();

        /* Configure timer unit 0 */
        R_TAU0_Create();

        /* Configure the interval timer */
        R_IT_Create();

        /* Configure RTC */
        //R_RTC_Create();

        /* Configure external interrupts */
        R_INTC_Create();

        /* Disable CRC operations */
        CRC0CTL = 0x00U;

        /* Disable RAM and SFR protections */
        IAWCTL = 0x00U;

        /* Disable RAM parity */
        RPECTL = 0x80;
}
/***********************************************************************************************************************
* Function Name: R_Systeminit
* Description  : This function initializes every macro.
* Arguments    : None
* Return Value : None
***********************************************************************************************************************/
void R_Systeminit(void)
{
    /* Enable writing to registers related to operating modes, LPC, CGC and software reset */
    SYSTEM.PRCR.WORD = 0xA50FU; 

    /* Enable writing to MPC pin function control registers */
    MPC.PWPR.BIT.B0WI = 0U;    
    MPC.PWPR.BIT.PFSWE = 1U;

    /* Initialize non-existent pins */
    PORT0.PDR.BYTE = 0x6BU;
    PORT3.PDR.BYTE = 0xD8U;
    PORT4.PDR.BYTE = 0xA0U;
    PORT5.PDR.BYTE = 0x80U;
    PORT9.PDR.BYTE = 0xF8U;
    PORTD.PDR.BYTE = 0xE0U;
    PORTF.PDR.BYTE = 0x3FU;
    PORTJ.PDR.BYTE = 0x32U;

    /* Set peripheral settings */
    R_CGC_Create();
    R_PORT_Create();
    R_SCI1_Create();

    /* Disable writing to MPC pin function control registers */
    MPC.PWPR.BIT.PFSWE = 0U;    
    MPC.PWPR.BIT.B0WI = 1U;     

    /* Enable protection */
    SYSTEM.PRCR.WORD = 0xA500U;  
}
/***********************************************************************************************************************
* Function Name: R_Systeminit
* Description  : This function initializes every macro.
* Arguments    : None
* Return Value : None
***********************************************************************************************************************/
void R_Systeminit(void)
{
    volatile uint32_t w_count;
    
    PIOR0 = 0x00U;
    PIOR1 = 0x00U;
    R_CGC_Create();
    R_PORT_Create();
    R_SAU0_Create();
    R_ADC_Create();
    R_TAU0_Create();
    R_RTC_Create();
    R_PCLBUZ0_Create();
    R_INTC_Create();
    R_TMR_RJ0_Create();
    R_TMR_RD0_Create();
    IAWCTL = 0x00U;
    /* Start data flash control */
    DFLEN = 1U;
    for (w_count = 0U; w_count < 6U; w_count++)
    {
        NOP();
    }
    /* End data flash control */
}
/***********************************************************************************************************************
* Function Name: R_Systeminit
* Description  : This function initializes every macro.
* Arguments    : None
* Return Value : None
***********************************************************************************************************************/
void R_Systeminit(void)
{
    DI();

    /* Enable writing to registers related to operating modes, LPC, CGC and ATCM */
    SYSTEM.PRCR.LONG = 0x0000A50BU;

    /* Enable writing to MPC pin function control registers */
    MPC.PWPR.BIT.B0WI = 0U;
    MPC.PWPR.BIT.PFSWE = 1U;

    r_set_exception_handler();

    /* Set peripheral settings */
    R_CGC_Create();
    R_ICU_Create();
    R_PORT_Create();
    R_TPU_Create();
    R_RSPI1_Create();
    R_MPC_Create();
	R_SCIFA2_Create();

    /* Disable writing to MPC pin function control registers */
    MPC.PWPR.BIT.PFSWE = 0U;
    MPC.PWPR.BIT.B0WI = 1U;

    /* Enable protection */
    SYSTEM.PRCR.LONG = 0x0000A500U;
    EI();
}
/***********************************************************************************************************************
* Function Name: R_Systeminit
* Description  : This function initializes every macro.
* Arguments    : None
* Return Value : None
***********************************************************************************************************************/
void R_Systeminit(void)
{
    PIOR = 0x00U;
    R_CGC_Get_ResetSource();
    R_PORT_Create();
    R_CGC_Create();
    CRC0CTL = 0x00U;
    IAWCTL = 0x00U;
}
/***********************************************************************************************************************
* Function Name: R_Systeminit
* Description  : This function initializes every macro.
* Arguments    : None
* Return Value : None
***********************************************************************************************************************/
void R_Systeminit(void)
{
    PIOR0 = 0x00U;
    PIOR1 = 0x00U;
    R_CGC_Create();
    R_PORT_Create();
    R_SAU0_Create();
    R_TAU0_Create();
    IAWCTL = 0x00U;
}
Example #7
0
/***********************************************************************************************************************
* Function Name: R_Systeminit
* Description  : This function initializes every macro.
* Arguments    : None
* Return Value : None
***********************************************************************************************************************/
void R_Systeminit(void)
{
    PIOR0 = 0x00U;
    PIOR1 = 0x00U;
    R_CGC_Get_ResetSource();
    R_PORT_Create();
    R_CGC_Create();
    R_IT_Create();
    R_INTC_Create();
    CRC0CTL = 0x00U;
    IAWCTL = 0x00U;
    PMS = 0x00U;
}
/***********************************************************************************************************************
* Function Name: R_Systeminit
* Description  : This function initializes every macro.
* Arguments    : None
* Return Value : None
***********************************************************************************************************************/
void R_Systeminit(void)
{
    PIOR0 = 0x1FU;
    PIOR1 = 0x07U;
    R_CGC_Get_ResetSource();
    R_PORT_Create();
    R_CGC_Create();
    R_SAU0_Create();
    R_IICA0_Create();
    R_WDT_Create();
    CRC0CTL = 0x00U;
    IAWCTL = 0x00U;
    PMS = 0x00U;
}
Example #9
0
/***********************************************************************************************************************
* Function Name: R_Systeminit
* Description  : This function initializes every macro.
* Arguments    : None
* Return Value : None
***********************************************************************************************************************/
void R_Systeminit(void)
{
    PIOR0 = 0x00U;
    PIOR1 = 0x00U;
    R_PORT_Create();
    R_CGC_Create();
    R_SAU1_Create();
    R_ADC_Create();
    R_TAU0_Create();
    R_IT_Create();
    CRC0CTL = 0x00U;
    IAWCTL = 0x00U;
    PMS = 0x00U;
}
Example #10
0
/***********************************************************************************************************************
* Function Name: R_Systeminit
* Description  : This function initializes every macro.
* Arguments    : None
* Return Value : None
***********************************************************************************************************************/
void R_Systeminit(void)
{
    PIOR = 0x00U;
    R_CGC_Get_ResetSource();
    R_PORT_Create();
    R_CGC_Create();
    R_TAU0_Create();
    R_TAU1_Create();
    DMAC0_Create();
    DMAC1_Create();
    DMAC2_Create();
    DMAC3_Create();
    R_INTC_Create();
    
    R_SAU0_Create();
    R_UART1_Create();
    
    CRC0CTL = 0x00U;
    IAWCTL = 0x00U;
}
/***********************************************************************************************************************
* Function Name: R_Systeminit
* Description  : This function initializes every macro.
* Arguments    : None
* Return Value : None
***********************************************************************************************************************/
void R_Systeminit(void)
{
    /* Enable writing to registers related to operating modes, LPC, LPT, LVD, CGC and software reset */
    SYSTEM.PRCR.WORD = 0xA50FU; 

    /* Enable writing to MPC pin function control registers */
    MPC.PWPR.BIT.B0WI = 0U;
    MPC.PWPR.BIT.PFSWE = 1U;

    /* Set peripheral settings */
    R_CGC_Create();
    R_ICU_Create();
    R_PORT_Create();

    /* Disable writing to MPC pin function control registers */
    MPC.PWPR.BIT.PFSWE = 0U;    
    MPC.PWPR.BIT.B0WI = 1U;     

    /* Enable protection */
    SYSTEM.PRCR.WORD = 0xA500U;  
}