Update the Renesas provided BSP files in the RDK RX63N project.

pull/1/head
Richard Barry 13 years ago
parent 3bc093f562
commit aa85a68636

@ -0,0 +1,83 @@
/***********************************************************************************************************************
* DISCLAIMER
* This software is supplied by Renesas Electronics Corporation and is only intended for use with Renesas products. No
* other uses are authorized. This software is owned by Renesas Electronics Corporation and is protected under all
* applicable laws, including copyright laws.
* THIS SOFTWARE IS PROVIDED "AS IS" AND RENESAS MAKES NO WARRANTIES REGARDING
* THIS SOFTWARE, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. ALL SUCH WARRANTIES ARE EXPRESSLY DISCLAIMED. TO THE MAXIMUM
* EXTENT PERMITTED NOT PROHIBITED BY LAW, NEITHER RENESAS ELECTRONICS CORPORATION NOR ANY OF ITS AFFILIATED COMPANIES
* SHALL BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES FOR ANY REASON RELATED TO THIS
* SOFTWARE, EVEN IF RENESAS OR ITS AFFILIATES HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
* Renesas reserves the right, without notice, to make changes to this software and to discontinue the availability of
* this software. By using this software, you agree to the additional terms and conditions found by accessing the
* following link:
* http://www.renesas.com/disclaimer
*
* Copyright (C) 2012 Renesas Electronics Corporation. All rights reserved.
***********************************************************************************************************************/
/***********************************************************************************************************************
* File Name : dbsct.c
* Device(s) : RX
* Description : Defines the structure of the ROM and RAM areas.
***********************************************************************************************************************/
/***********************************************************************************************************************
* History : DD.MM.YYYY Version Description
* : 26.10.2011 1.00 First Release
***********************************************************************************************************************/
/***********************************************************************************************************************
Includes <System Includes> , "Project Includes"
***********************************************************************************************************************/
/* Defines type structures used in this file */
#include <stdint.h>
/* Preprocessor directive */
#pragma unpack
/* Section start */
#pragma section C C$DSEC
/* MCU ROM and RAM structure definition */
extern const struct {
uint8_t *rom_s; /* Start address of the initialized data section in ROM */
uint8_t *rom_e; /* End address of the initialized data section in ROM */
uint8_t *ram_s; /* Start address of the initialized data section in RAM */
} _DTBL[] = {
{ __sectop("D"), __secend("D"), __sectop("R") },
{ __sectop("D_2"), __secend("D_2"), __sectop("R_2") },
{ __sectop("D_1"), __secend("D_1"), __sectop("R_1") }
};
/* Section start */
#pragma section C C$BSEC
/* MCU ROM and RAM structure definition */
extern const struct {
uint8_t *b_s; /* Start address of non-initialized data section */
uint8_t *b_e; /* End address of non-initialized data section */
} _BTBL[] = {
{ __sectop("B"), __secend("B") },
{ __sectop("B_2"), __secend("B_2") },
{ __sectop("B_1"), __secend("B_1") }
};
/* Section start */
#pragma section
/* CTBL prevents excessive output of L1100 messages when linking.
Even if CTBL is deleted, the operation of the program does not change. */
uint8_t * const _CTBL[] = {
__sectop("C_1"), __sectop("C_2"), __sectop("C"),
__sectop("W_1"), __sectop("W_2"), __sectop("W")
};
/* Preprocessor directive */
#pragma packoption
/* This is to ensure compatibility with new L section in version 1.1 and up of the RXC compiler. Do not remove! */
#pragma section C L
const unsigned long deadSpace = 0xDEADDEAD;
#pragma section

@ -0,0 +1,124 @@
/***********************************************************************************************************************
* DISCLAIMER
* This software is supplied by Renesas Electronics Corporation and is only intended for use with Renesas products. No
* other uses are authorized. This software is owned by Renesas Electronics Corporation and is protected under all
* applicable laws, including copyright laws.
* THIS SOFTWARE IS PROVIDED "AS IS" AND RENESAS MAKES NO WARRANTIES REGARDING
* THIS SOFTWARE, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. ALL SUCH WARRANTIES ARE EXPRESSLY DISCLAIMED. TO THE MAXIMUM
* EXTENT PERMITTED NOT PROHIBITED BY LAW, NEITHER RENESAS ELECTRONICS CORPORATION NOR ANY OF ITS AFFILIATED COMPANIES
* SHALL BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES FOR ANY REASON RELATED TO THIS
* SOFTWARE, EVEN IF RENESAS OR ITS AFFILIATES HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
* Renesas reserves the right, without notice, to make changes to this software and to discontinue the availability of
* this software. By using this software, you agree to the additional terms and conditions found by accessing the
* following link:
* http://www.renesas.com/disclaimer
*
* Copyright (C) 2012 Renesas Electronics Corporation. All rights reserved.
***********************************************************************************************************************/
/***********************************************************************************************************************
* File Name : flash_options.c
* Device(s) : RX63x
* Description : Some options of the RX63x are set through registers that are found in ROM. These registers and options
* are defined in the 'Option-Setting Memory' section of the HW Manual. These memory locations are defined
* below with descriptions of what is being set.
***********************************************************************************************************************/
/***********************************************************************************************************************
* History : DD.MM.YYYY Version Description
* : 31.10.2011 1.00 First Release
* : 13.03.2012 1.10 USER_BOOT_ENABLE macro from r_bsp_config.h is now used to set Option-Setting Memory
* area to boot into User Boot Mode.
***********************************************************************************************************************/
/***********************************************************************************************************************
Includes <System Includes> , "Project Includes"
***********************************************************************************************************************/
/* Used for fixed-width typedefs. */
#include <stdint.h>
/* Determines whether user boot is used or not. */
#include "platform.h"
/* The UB Code A, UB Code B, and Endian select register B (MDEB) are located in the User Boot space. Immediately
following the MDEB register is the User Boot Reset Vector so it is defined below as well. These settings will only
be used when the MCU is reset in User Boot Mode. In order for the MCU to start up in User Boot Mode the following
conditions must be met:
1) UB code A is 55736572h and 426F6F74h.
2) UB code B is FFFF FF07h and 0008 C04Ch.
3) The low level is being input on the MD pin.
4) The high level is being input on the PC7 pin.
Please see the Option-Setting Memory section of your MCU's HW manual for more information. */
/* 0xFF7FFFE8 - 0xFF7FFFEF : UB Code A register
0xFF7FFFF0 - 0xFF7FFFF7 : UB Code B register
0xFF7FFFF8 - 0xFF7FFFFB : MDEB register
0xFF7FFFFC - 0xFF7FFFFF : User Boot Reset Vector */
#pragma address user_boot_settings = 0xFF7FFFE8
#if USER_BOOT_ENABLE == 1
extern void PowerON_Reset_PC(void);
/* Use this array if you are using User Boot. Make sure to fill in valid address for UB Reset Vector. */
const uint32_t user_boot_settings[6] =
{
0x55736572, //Required setting for UB Code A to get into User Boot
0x426f6f74, //Required setting for UB Code A to get into User Boot
0xffffff07, //Required setting for UB Code B to get into User Boot
0x0008c04c, //Required setting for UB Code B to get into User Boot
/* Choose endian for user application code
MDEB Register - Endian Select Register B
b31:b3 Reserved (set to 1)
b2:b0 MDE - Endian Select (0 = Big Endian, 7 = Little Endian) */
0xFFFFFFFF, //Select Little Endian for User Boot Code
(uint32_t) PowerON_Reset_PC //This is the User Boot Reset Vector. When using User Boot put in the reset address here
};
#endif
/* The Endian select register S (MDES), Option function select register 1 (OFS1), and Option function select register 0
(OFS0) are located in User ROM. */
/* 0xFFFFFF80 - 0xFFFFFF83 : MDES register
0xFFFFFF84 - 0xFFFFFF87 : Reserved space (0xFF's)
0xFFFFFF88 - 0xFFFFFF8B : OFS1 register
0xFFFFFF8C - 0xFFFFFF8F : OFS0 register */
#pragma address flash_options = 0xFFFFFF80
const uint32_t flash_options[] =
{
/* Choose endian for user application code
MDES Register - Endian Select Register S
b31:b3 Reserved (set to 1)
b2:b0 MDE - Endian Select (0 = Big Endian, 7 = Little Endian) */
0xFFFFFFFF, //Little Endian chosen for User Application
0xFFFFFFFF, //Reserved space
/* Configure whether voltage detection 0 circuit and HOCO are enabled after reset.
OFS1 - Option Function Select Register 1
b31:b9 Reserved (set to 1)
b8 HOCOEN - Enable/disable HOCO oscillation after a reset (0=enable, 1=disable)
b7:b3 Reserved (set to 1)
b2 LVDAS - Choose to enable/disable Voltage Detection 0 Circuit after a reset (0=enable, 1=disable)
b1:b0 Reserved (set to 1) */
0xFFFFFFFF, //Both are disabled.
/* Configure WDT and IWDT settings.
OFS0 - Option Function Select Register 0
b31:b29 Reserved (set to 1)
b28 WDTRSTIRQS - WDT Reset Interrupt Request - What to do on underflow (0=take interrupt, 1=reset MCU)
b27:b26 WDTRPSS - WDT Window Start Position Select - (0=25%, 1=50%, 2=75%, 3=100%,don't use)
b25:b24 WDTRPES - WDT Window End Position Select - (0=75%, 1=50%, 2=25%, 3=0%,don't use)
b23:b20 WDTCKS - WDT Clock Frequency Division Ratio - (1=/4, 4=/64, 0xF=/128, 6=/512, 7=/2048, 8=/8192)
b19:b18 WDTTOPS - WDT Timeout Period Select - (0=1024 cycles, 1=4096, 2=8192, 3=16384)
b17 WDTSTRT - WDT Start Mode Select - (0=auto-start after reset, halt after reset)
b16:b15 Reserved (set to 1)
b14 IWDTSLCSTP - IWDT Sleep Mode Count Stop Control - (0=can't stop count, 1=stop w/some low power modes)
b13 Reserved (set to 1)
b12 IWDTRSTIRQS - IWDT Reset Interrupt Request - What to do on underflow (0=take interrupt, 1=reset MCU)
b11:b10 IWDTRPSS - IWDT Window Start Position Select - (0=25%, 1=50%, 2=75%, 3=100%,don't use)
b9:b8 IWDTRPES - IWDT Window End Position Select - (0=75%, 1=50%, 2=25%, 3=0%,don't use)
b7:b4 IWDTCKS - IWDT Clock Frequency Division Ratio - (0=none, 2=/16, 3 = /32, 4=/64, 0xF=/128, 5=/256)
b3:b2 IWDTTOPS - IWDT Timeout Period Select - (0=1024 cycles, 1=4096, 2=8192, 3=16384)
b1 IWDTSTRT - IWDT Start Mode Select - (0=auto-start after reset, halt after reset)
b0 Reserved (set to 1) */
0xFFFFFFFF
};

@ -0,0 +1,157 @@
/***********************************************************************************************************************
* DISCLAIMER
* This software is supplied by Renesas Electronics Corporation and is only intended for use with Renesas products. No
* other uses are authorized. This software is owned by Renesas Electronics Corporation and is protected under all
* applicable laws, including copyright laws.
* THIS SOFTWARE IS PROVIDED "AS IS" AND RENESAS MAKES NO WARRANTIES REGARDING
* THIS SOFTWARE, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. ALL SUCH WARRANTIES ARE EXPRESSLY DISCLAIMED. TO THE MAXIMUM
* EXTENT PERMITTED NOT PROHIBITED BY LAW, NEITHER RENESAS ELECTRONICS CORPORATION NOR ANY OF ITS AFFILIATED COMPANIES
* SHALL BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES FOR ANY REASON RELATED TO THIS
* SOFTWARE, EVEN IF RENESAS OR ITS AFFILIATES HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
* Renesas reserves the right, without notice, to make changes to this software and to discontinue the availability of
* this software. By using this software, you agree to the additional terms and conditions found by accessing the
* following link:
* http://www.renesas.com/disclaimer
*
* Copyright (C) 2012 Renesas Electronics Corporation. All rights reserved.
***********************************************************************************************************************/
/***********************************************************************************************************************
* File Name : hwsetup.c
* Device(s) : RX
* H/W Platform : RSK+RX63N
* Description : Defines the initialisation routines used each time the MCU is restarted.
***********************************************************************************************************************/
/***********************************************************************************************************************
* History : DD.MM.YYYY Version Description
* : 22.11.2011 1.00 First Release
***********************************************************************************************************************/
/***********************************************************************************************************************
Includes <System Includes> , "Project Includes"
***********************************************************************************************************************/
/* I/O Register and board definitions */
#include "platform.h"
/* Contains delcarations for the functions defined in this file */
#include "hwsetup.h"
/***********************************************************************************************************************
Private global variables and functions
***********************************************************************************************************************/
/* MCU I/O port configuration function delcaration */
static void output_ports_configure(void);
/* Interrupt configuration function delcaration */
static void interrupts_configure(void);
/* MCU peripheral module configuration function declaration */
static void peripheral_modules_enable(void);
/***********************************************************************************************************************
* Function name: hardware_setup
* Description : Contains setup functions called at device restart
* Arguments : none
* Return value : none
***********************************************************************************************************************/
void hardware_setup(void)
{
output_ports_configure();
interrupts_configure();
peripheral_modules_enable();
}
/***********************************************************************************************************************
* Function name: output_ports_configure
* Description : Configures the port and pin direction settings, and sets the pin outputs to a safe level.
* Arguments : none
* Return value : none
***********************************************************************************************************************/
void output_ports_configure(void)
{
/* Enable LEDs. */
/* Start with LEDs off. */
LED0 = LED_OFF;
LED1 = LED_OFF;
LED2 = LED_OFF;
LED3 = LED_OFF;
/* Set LED pins as outputs. */
LED0_PDR = 1;
LED1_PDR = 1;
LED2_PDR = 1;
LED3_PDR = 1;
/* Enable switches. */
/* Set pins as inputs. */
SW1_PDR = 0;
SW2_PDR = 0;
SW3_PDR = 0;
/* Set port mode registers for switches. */
SW1_PMR = 0;
SW2_PMR = 0;
SW3_PMR = 0;
/* Initialize RSPI pins that are used with on-board SPI flash. */
/* Set pin outputs to low to begin with. */
PORT2.PODR.BIT.B7 = 0x00; /* RSPCKB */
PORT2.PODR.BIT.B6 = 0x00; /* MOSIB */
PORT3.PODR.BIT.B0 = 0x00; /* MISOB */
PORT3.PODR.BIT.B1 = 0x00; /* SSLB0 */
/* All GPIO for now */
PORT2.PMR.BIT.B7 = 0x00;
PORT2.PMR.BIT.B6 = 0x00;
PORT3.PMR.BIT.B0 = 0x00;
PORT3.PMR.BIT.B1 = 0x00;
/* Unlock MPC registers to enable writing to them. */
MPC.PWPR.BIT.B0WI = 0 ; /* Unlock protection register */
MPC.PWPR.BIT.PFSWE = 1 ; /* Unlock MPC registers */
/* Set MPC for RSPI pins */
MPC.P27PFS.BYTE = 0x0D;
MPC.P26PFS.BYTE = 0x0D;
MPC.P30PFS.BYTE = 0x0D;
/* RSPI pins assigned to RSPI peripheral. */
PORT2.PMR.BIT.B7 = 1;
PORT2.PMR.BIT.B6 = 1;
PORT3.PMR.BIT.B0 = 1;
PORT3.PMR.BIT.B1 = 1;
/* RSPCKB is output. */
PORT2.PDR.BIT.B7 = 1;
/* MOSIB is output. */
PORT2.PDR.BIT.B6 = 1;
/* MISOB is input. */
PORT3.PDR.BIT.B0 = 0;
/* SSLB0 is output. */
PORT3.PDR.BIT.B1 = 1;
/* Configure the pin connected to the ADC Pot as an input */
PORT4.PDR.BIT.B0 = 0;
}
/***********************************************************************************************************************
* Function name: interrupts_configure
* Description : Configures interrupts used
* Arguments : none
* Return value : none
***********************************************************************************************************************/
void interrupts_configure(void)
{
/* Add code here to setup additional interrupts */
}
/***********************************************************************************************************************
* Function name: peripheral_modules_enable
* Description : Enables and configures peripheral devices on the MCU
* Arguments : none
* Return value : none
***********************************************************************************************************************/
void peripheral_modules_enable(void)
{
/* Add code here to enable peripherals used by the application */
}

@ -0,0 +1,42 @@
/***********************************************************************************************************************
* DISCLAIMER
* This software is supplied by Renesas Electronics Corporation and is only intended for use with Renesas products. No
* other uses are authorized. This software is owned by Renesas Electronics Corporation and is protected under all
* applicable laws, including copyright laws.
* THIS SOFTWARE IS PROVIDED "AS IS" AND RENESAS MAKES NO WARRANTIES REGARDING
* THIS SOFTWARE, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. ALL SUCH WARRANTIES ARE EXPRESSLY DISCLAIMED. TO THE MAXIMUM
* EXTENT PERMITTED NOT PROHIBITED BY LAW, NEITHER RENESAS ELECTRONICS CORPORATION NOR ANY OF ITS AFFILIATED COMPANIES
* SHALL BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES FOR ANY REASON RELATED TO THIS
* SOFTWARE, EVEN IF RENESAS OR ITS AFFILIATES HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
* Renesas reserves the right, without notice, to make changes to this software and to discontinue the availability of
* this software. By using this software, you agree to the additional terms and conditions found by accessing the
* following link:
* http://www.renesas.com/disclaimer
*
* Copyright (C) 2012 Renesas Electronics Corporation. All rights reserved.
***********************************************************************************************************************/
/***********************************************************************************************************************
* File Name : hwsetup.h
* Description : Hardware setup header file.
***********************************************************************************************************************/
/***********************************************************************************************************************
* History : DD.MM.YYYY Version Description
* : 26.10.2011 1.00 First Release
***********************************************************************************************************************/
/***********************************************************************************************************************
Macro definitions
***********************************************************************************************************************/
/* Multiple inclusion prevention macro */
#ifndef HWSETUP_H
#define HWSETUP_H
/***********************************************************************************************************************
Exported global functions (to be accessed by other files)
***********************************************************************************************************************/
/* Hardware setup funtion declaration */
void hardware_setup(void);
/* End of multiple inclusion prevention macro */
#endif

@ -0,0 +1,254 @@
/***********************************************************************************************************************
* DISCLAIMER
* This software is supplied by Renesas Electronics Corporation and is only intended for use with Renesas products. No
* other uses are authorized. This software is owned by Renesas Electronics Corporation and is protected under all
* applicable laws, including copyright laws.
* THIS SOFTWARE IS PROVIDED "AS IS" AND RENESAS MAKES NO WARRANTIES REGARDING
* THIS SOFTWARE, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. ALL SUCH WARRANTIES ARE EXPRESSLY DISCLAIMED. TO THE MAXIMUM
* EXTENT PERMITTED NOT PROHIBITED BY LAW, NEITHER RENESAS ELECTRONICS CORPORATION NOR ANY OF ITS AFFILIATED COMPANIES
* SHALL BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES FOR ANY REASON RELATED TO THIS
* SOFTWARE, EVEN IF RENESAS OR ITS AFFILIATES HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
* Renesas reserves the right, without notice, to make changes to this software and to discontinue the availability of
* this software. By using this software, you agree to the additional terms and conditions found by accessing the
* following link:
* http://www.renesas.com/disclaimer
*
* Copyright (C) 2012 Renesas Electronics Corporation. All rights reserved.
***********************************************************************************************************************/
/***********************************************************************************************************************
* File Name : lcd.c
* Device(s) : RX
* H/W Platform : RSK+RX63N
* Description : Provides variable and function declarations for lcd.c file
***********************************************************************************************************************/
/***********************************************************************************************************************
* History : DD.MM.YYYY Version Description
* : 22.11.2011 1.00 First Release
***********************************************************************************************************************/
/***********************************************************************************************************************
Includes <System Includes> , "Project Includes"
***********************************************************************************************************************/
/* Processor-specific details */
#include <machine.h>
/* Standard string manipulation & formatting functions */
#include <stdio.h>
#include <string.h>
/* Defines standard variable types used in this function */
#include <stdint.h>
/* Bring in board includes. */
#include "platform.h"
/* Following header file provides function prototypes for LCD controlling functions & macro defines */
#include "lcd.h"
/***********************************************************************************************************************
Private global variables and functions
***********************************************************************************************************************/
static void lcd_delay(volatile int32_t nsecs);
static void lcd_nibble_write(uint8_t data_or_ctrl, uint8_t value);
static void lcd_write(uint8_t data_or_ctrl, uint8_t value);
/***********************************************************************************************************************
* Function name : lcd_initialize
* Description : Initializes the LCD display.
* Arguments : none
* Return Value : none
***********************************************************************************************************************/
void lcd_initialize(void)
{
/* Set LCD data pins as outputs. */
PORT8.PDR.BYTE |= 0xF0;
/* Set LCD control pins as outputs. */
RS_PIN_DDR = 1;
E_PIN_DDR = 1;
/* Power Up Delay for the LCD Module */
lcd_delay(50000000);
/* Display initialises in 8 bit mode - so send one write (seen as 8 bit) to set to 4 bit mode. */
lcd_nibble_write(CTRL_WR, 0x03);
lcd_delay(5000000);
lcd_nibble_write(CTRL_WR, 0x03);
lcd_delay(5000000);
lcd_nibble_write(CTRL_WR, 0x03);
lcd_delay(5000000);
/* Function Set */
lcd_nibble_write(CTRL_WR, 0x02);
lcd_delay(39000);
lcd_nibble_write(CTRL_WR, 0x02);
lcd_nibble_write(CTRL_WR, (LCD_DISPLAY_ON | LCD_TWO_LINE ));
lcd_delay(39000);
/* Display ON/OFF control */
lcd_write(CTRL_WR, LCD_CURSOR_OFF);
lcd_delay(39000);
/* Display Clear */
lcd_write(CTRL_WR, LCD_CLEAR);
lcd_delay(2000000);
/* Entry Mode Set */
lcd_write(CTRL_WR, 0x06);
lcd_delay(39000);
/* Home the cursor */
lcd_write(CTRL_WR, LCD_HOME_L1);
lcd_delay(5000000);
}
/***********************************************************************************************************************
* Function name : lcd_clear
* Description : Clears the LCD
* Arguments : none
* Return Value : none
***********************************************************************************************************************/
void lcd_clear(void)
{
/* Display Clear */
lcd_write(CTRL_WR, LCD_CLEAR);
lcd_delay(2000000);
}
/***********************************************************************************************************************
* Function name : lcd_display
* Description : This function controls LCD writes to line 1 or 2 of the LCD.
* You need to use the defines LCD_LINE1 and LCD_LINE2 in order to specify the starting position.
* For example, to start at the 2nd position on line 1...
* lcd_display(LCD_LINE1 + 1, "Hello")
* Arguments : position -
* Line number of display
* string -
* Pointer to null terminated string
* Return Value : none
***********************************************************************************************************************/
void lcd_display(uint8_t position, uint8_t const * string)
{
/* Declare next position variable */
static uint8_t next_pos = 0xFF;
/* Set line position if needed. We don't want to if we don't need to because LCD control operations take longer
than LCD data operations. */
if (next_pos != position)
{
if(position < LCD_LINE2)
{
/* Display on Line 1 */
lcd_write(CTRL_WR, ((uint8_t)(LCD_HOME_L1 + position)));
}
else
{
/* Display on Line 2 */
lcd_write(CTRL_WR, ((uint8_t)((LCD_HOME_L2 + position) - LCD_LINE2)));
}
lcd_delay(39000);
/* set position index to known value */
next_pos = position;
}
do
{
/* Write character to LCD. */
lcd_write(DATA_WR,*string++);
lcd_delay(43000);
/* Increment position index */
next_pos++;
}
while(*string);
}
/***********************************************************************************************************************
* Function name : lcd_delay
* Description : Implements LCD required delays.
* Arguments : nsecs -
* Number of nanoseconds to delay. RX600 has max clock of 100MHz which gives a cycle time of 10ns.
* This means that nothing under 100ns should be input. 100ns would be 10 cycles which is still
* being optimistic for getting in and out of this function.
* Return Value : none
***********************************************************************************************************************/
static void lcd_delay(volatile int32_t nsecs)
{
while (0 < nsecs)
{
/* Subtract off 10 cycles per iteration. This number was obtained when using the Renesas toolchain at
optimization level 2. The number to nanoseconds to subtract off below is calculated off of the ICLK speed. */
nsecs -= (int32_t)((100.0)*(100000000.0/(float)ICLK_HZ));
}
}
/***********************************************************************************************************************
* Function name : lcd_nibble_write
* Description : Writes data to display. Sends command to display.
* Arguments : value -
* The value to write
* data_or_ctrl -
* Whether to write data or control.
* 1 = DATA
* 0 = CONTROL
* Return Value : none
***********************************************************************************************************************/
static void lcd_nibble_write(uint8_t data_or_ctrl, uint8_t value)
{
/* Set Register Select pin high for Data */
if (data_or_ctrl == DATA_WR)
{
/* Data write. */
RS_PIN = 1;
}
else
{
/* Control write. */
RS_PIN = 0;
}
/* tsu1 delay */
lcd_delay(60);
/* EN enable chip (HIGH) */
E_PIN = 1;
/* Output the data */
PORT8.PODR.BYTE = (value << 4u);
/* tw delay */
lcd_delay(450);
/* Latch data by dropping E */
E_PIN = 0;
/* th2 delay */
lcd_delay(10);
/* tc delay */
lcd_delay(480);
}
/***********************************************************************************************************************
* Function name : lcd_write
* Description : This function controls LCD writes to line 1 or 2 of the LCD. You need to use the defines LCD_LINE1 and
* LCD_LINE2 in order to specify the starting position.
* For example, to start at the 2nd position on line 1...
* lcd_display(LCD_LINE1 + 1, "Hello")
* Arguments : value -
* The value to write
* data_or_ctrl -
* Whether to write data or control.
* 1 = DATA
* 0 = CONTROL
* Return Value : none
***********************************************************************************************************************/
static void lcd_write(uint8_t data_or_ctrl, uint8_t value)
{
/* Write upper nibble first */
lcd_nibble_write(data_or_ctrl, (uint8_t)((value & 0xF0) >> 4));
/* Write lower nibble second */
lcd_nibble_write(data_or_ctrl, (uint8_t)(value & 0x0F));
}

@ -0,0 +1,101 @@
/***********************************************************************************************************************
* DISCLAIMER
* This software is supplied by Renesas Electronics Corporation and is only intended for use with Renesas products. No
* other uses are authorized. This software is owned by Renesas Electronics Corporation and is protected under all
* applicable laws, including copyright laws.
* THIS SOFTWARE IS PROVIDED "AS IS" AND RENESAS MAKES NO WARRANTIES REGARDING
* THIS SOFTWARE, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. ALL SUCH WARRANTIES ARE EXPRESSLY DISCLAIMED. TO THE MAXIMUM
* EXTENT PERMITTED NOT PROHIBITED BY LAW, NEITHER RENESAS ELECTRONICS CORPORATION NOR ANY OF ITS AFFILIATED COMPANIES
* SHALL BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES FOR ANY REASON RELATED TO THIS
* SOFTWARE, EVEN IF RENESAS OR ITS AFFILIATES HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
* Renesas reserves the right, without notice, to make changes to this software and to discontinue the availability of
* this software. By using this software, you agree to the additional terms and conditions found by accessing the
* following link:
* http://www.renesas.com/disclaimer
*
* Copyright (C) 2012 Renesas Electronics Corporation. All rights reserved.
***********************************************************************************************************************/
/***********************************************************************************************************************
* File Name : lcd.h
* Device(s) : RX
* H/W Platform : RSKRX630
* Description : Provides variable and function declarations for lcd.c file
***********************************************************************************************************************/
/***********************************************************************************************************************
* History : DD.MM.YYYY Version Description
* : 22.11.2011 1.00 First Release
***********************************************************************************************************************/
/* Multiple inclusion prevention macro */
#ifndef LCD_H
#define LCD_H
/***********************************************************************************************************************
Includes <System Includes> , "Project Includes"
***********************************************************************************************************************/
/* Defines standard integer variable types used in this file */
#include <stdint.h>
/***********************************************************************************************************************
Macro definitions
***********************************************************************************************************************/
/* RS register select pin */
#define RS_PIN PORTJ.PODR.BIT.B5
#define RS_PIN_DDR PORTJ.PDR.BIT.B5
/* Display enable pin */
#define E_PIN PORTF.PODR.BIT.B5
#define E_PIN_DDR PORTF.PDR.BIT.B5
/* Data write/read definition */
#define DATA_WR 1
/* Control write/read definition */
#define CTRL_WR 0
/* Maximum characters per line of LCD display. */
#define NUMB_CHARS_PER_LINE 8
/* Number of lines on the LCD display */
#define MAXIMUM_LINES 2
/* Character position of LCD line 1 */
#define LCD_LINE1 0
/* Character position of LCD line 2 */
#define LCD_LINE2 16
/* Clear LCD display and home cursor */
#define LCD_CLEAR 0x01
/* Move cursor to line 1 */
#define LCD_HOME_L1 0x80
/* Move cursor to line 2 */
#define LCD_HOME_L2 0xC0
/* Cursor auto decrement after R/W */
#define CURSOR_MODE_DEC 0x04
/* Cursor auto increment after R/W */
#define CURSOR_MODE_INC 0x06
/* Setup, 4 bits,2 lines, 5X7 */
#define FUNCTION_SET 0x28
/* Display ON with Cursor */
#define LCD_CURSOR_ON 0x0E
/* Display ON with Cursor off */
#define LCD_CURSOR_OFF 0x0C
/* Display on with blinking cursor */
#define LCD_CURSOR_BLINK 0x0D
/* Move Cursor Left One Position */
#define LCD_CURSOR_LEFT 0x10
/* Move Cursor Right One Position */
#define LCD_CURSOR_RIGHT 0x14
/* Enable LCD display */
#define LCD_DISPLAY_ON 0x04
/* Enable both LCD lines */
#define LCD_TWO_LINE 0x08
/***********************************************************************************************************************
Exported global functions (to be accessed by other files)
***********************************************************************************************************************/
/* LCD initialisation function declaration */
void lcd_initialize (void);
/* Update display function declaration */
void lcd_display(uint8_t position, uint8_t const * string);
/* Clear LCD function delcaration */
void lcd_clear (void);
/* End of multiple inclusion prevention macro */
#endif

@ -0,0 +1,118 @@
/***********************************************************************************************************************
* DISCLAIMER
* This software is supplied by Renesas Electronics Corporation and is only intended for use with Renesas products. No
* other uses are authorized. This software is owned by Renesas Electronics Corporation and is protected under all
* applicable laws, including copyright laws.
* THIS SOFTWARE IS PROVIDED "AS IS" AND RENESAS MAKES NO WARRANTIES REGARDING
* THIS SOFTWARE, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. ALL SUCH WARRANTIES ARE EXPRESSLY DISCLAIMED. TO THE MAXIMUM
* EXTENT PERMITTED NOT PROHIBITED BY LAW, NEITHER RENESAS ELECTRONICS CORPORATION NOR ANY OF ITS AFFILIATED COMPANIES
* SHALL BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES FOR ANY REASON RELATED TO THIS
* SOFTWARE, EVEN IF RENESAS OR ITS AFFILIATES HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
* Renesas reserves the right, without notice, to make changes to this software and to discontinue the availability of
* this software. By using this software, you agree to the additional terms and conditions found by accessing the
* following link:
* http://www.renesas.com/disclaimer
*
* Copyright (C) 2011 Renesas Electronics Corporation. All rights reserved.
***********************************************************************************************************************/
/***********************************************************************************************************************
* File Name : locking.c
* Description : This implements a locking mechanism that can be used by all code. The locking is done atomically so
* common resources can be accessed safely.
***********************************************************************************************************************/
/**********************************************************************************************************************
* History : DD.MM.YYYY Version Description
* : 07.03.2012 1.00 First Release
***********************************************************************************************************************/
/***********************************************************************************************************************
Includes <System Includes> , "Project Includes"
***********************************************************************************************************************/
/* Fixed-size integer typedefs. */
#include <stdint.h>
/* bool support. */
#include <stdbool.h>
/* Has intrinsic support. Includes xchg() which is used in this code. */
#include <machine.h>
/* Includes board and MCU related header files. */
#include "platform.h"
/***********************************************************************************************************************
Macro definitions
***********************************************************************************************************************/
/***********************************************************************************************************************
Typedef definitions
***********************************************************************************************************************/
/***********************************************************************************************************************
Exported global variables (to be accessed by other files)
***********************************************************************************************************************/
/***********************************************************************************************************************
Private global variables and functions
***********************************************************************************************************************/
/***********************************************************************************************************************
* Function Name: R_BSP_Lock
* Description : Attempt to acquire the lock that has been sent in.
* Arguments : plock -
* Pointer to lock structure with lock to try and acquire.
* Return Value : true -
* Lock was acquired.
* false -
* Lock was not acquired.
***********************************************************************************************************************/
bool R_BSP_Lock(bsp_lock_t * plock)
{
bool ret = false;
/* Variable used in trying to acquire lock. Using the xchg instruction makes this atomic */
int32_t is_locked = true;
/* This example uses the RX MCU's atomic xchg() instruction. plock->lock is the lock we are trying to reserve.
The way this works is that 'is_locked' gets the value of the plock->lock and plock->lock gets the value of
'is_locked' which we just set to 'true'. Basically this is an atomic 'swap' command. If the lock had not yet been
reserved then its value would be 'false' and after the xchg() instruction finished 'is_locked' would have
'false'. If it had already been reserved then 'is_locked' would have 'true' after the xchg() instruction. Since
plock->lock was already 'true' and we just set it back to 'true' everything is ok. To see if we reserved the lock
we just need to check the value of 'is_locked' after this instruction finishes. */
/* Try to acquire semaphore to obtain lock */
xchg(&is_locked, &plock->lock);
/* Check to see if semaphore was successfully taken */
if (is_locked == false)
{
/* Lock obtained, return success. */
ret = true;
}
else
{
/* Lock was not obtained, another task already has it. */
}
return ret;
} /* End of function R_BSP_Lock() */
/***********************************************************************************************************************
* Function Name: R_BSP_Unlock
* Description : Release hold on lock.
* Arguments : plock -
* Pointer to lock structure with lock to release.
* Return Value : true -
* Lock was released.
* false -
* Lock was not released.
***********************************************************************************************************************/
bool R_BSP_Unlock(bsp_lock_t * plock)
{
/* Set lock back to unlocked. */
plock->lock = false;
return true;
} /* End of function R_BSP_Unlock() */

@ -0,0 +1,63 @@
/***********************************************************************************************************************
* DISCLAIMER
* This software is supplied by Renesas Electronics Corporation and is only intended for use with Renesas products. No
* other uses are authorized. This software is owned by Renesas Electronics Corporation and is protected under all
* applicable laws, including copyright laws.
* THIS SOFTWARE IS PROVIDED "AS IS" AND RENESAS MAKES NO WARRANTIES REGARDING
* THIS SOFTWARE, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. ALL SUCH WARRANTIES ARE EXPRESSLY DISCLAIMED. TO THE MAXIMUM
* EXTENT PERMITTED NOT PROHIBITED BY LAW, NEITHER RENESAS ELECTRONICS CORPORATION NOR ANY OF ITS AFFILIATED COMPANIES
* SHALL BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES FOR ANY REASON RELATED TO THIS
* SOFTWARE, EVEN IF RENESAS OR ITS AFFILIATES HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
* Renesas reserves the right, without notice, to make changes to this software and to discontinue the availability of
* this software. By using this software, you agree to the additional terms and conditions found by accessing the
* following link:
* http://www.renesas.com/disclaimer
*
* Copyright (C) 2011 Renesas Electronics Corporation. All rights reserved.
***********************************************************************************************************************/
/***********************************************************************************************************************
* File Name : locking.h
* Description : This implements a locking mechanism that can be used by all code. The locking is done atomically so
* common resources can be accessed safely.
***********************************************************************************************************************/
/**********************************************************************************************************************
* History : DD.MM.YYYY Version Description
* : 07.03.2012 1.00 First Release
***********************************************************************************************************************/
/***********************************************************************************************************************
Includes <System Includes> , "Project Includes"
***********************************************************************************************************************/
/* Fixed-size integer typedefs. */
#include <stdint.h>
/* bool support. */
#include <stdbool.h>
/***********************************************************************************************************************
Macro definitions
***********************************************************************************************************************/
/***********************************************************************************************************************
Typedef definitions
***********************************************************************************************************************/
typedef struct
{
/* The actual lock. int32_t is used because this is what the xchg() instruction takes as parameters. */
int32_t lock;
/* Could add a ID for locking and unlocking. In this could protect against any function being able to unlock. */
} bsp_lock_t;
/***********************************************************************************************************************
Exported global variables
***********************************************************************************************************************/
/***********************************************************************************************************************
Exported global functions (to be accessed by other files)
***********************************************************************************************************************/
bool R_BSP_Lock(bsp_lock_t * plock);
bool R_BSP_Unlock(bsp_lock_t * plock);

@ -0,0 +1,54 @@
;-----------------------------------------------------------------------
;
; FILE :lowlvl.src
; DATE :Wed, Jul 01, 2009
; DESCRIPTION :Program of Low level
; CPU TYPE :RX
;
;-----------------------------------------------------------------------
.GLB _charput
.GLB _charget
FC2E0 .EQU 00084080h
FE2C0 .EQU 00084090h
DBGSTAT .EQU 000840C0h
RXFL0EN .EQU 00001000h
TXFL0EN .EQU 00000100h
.SECTION P,CODE
;-----------------------------------------------------------------------
; _charput:
;-----------------------------------------------------------------------
_charput:
.STACK _charput = 00000000h
__C2ESTART: MOV.L #TXFL0EN,R3
MOV.L #DBGSTAT,R4
__TXLOOP: MOV.L [R4],R5
AND R3,R5
BNZ __TXLOOP
__WRITEFC2E0: MOV.L #FC2E0,R2
MOV.L R1,[R2]
__CHARPUTEXIT: RTS
;-----------------------------------------------------------------------
; _charget:
;-----------------------------------------------------------------------
_charget:
.STACK _charget = 00000000h
__E2CSTART: MOV.L #RXFL0EN,R3
MOV.L #DBGSTAT,R4
__RXLOOP: MOV.L [R4],R5
AND R3,R5
BZ __RXLOOP
__READFE2C0: MOV.L #FE2C0,R2
MOV.L [R2],R1
__CHARGETEXIT: RTS
;-----------------------------------------------------------------------
; End of conditional code
.END

@ -1,38 +1,41 @@
/***********************************************************************/
/* */
/* FILE :lowsrc.c */
/* DATE :Wed, Jun 16, 2010 */
/* DESCRIPTION :Program of I/O Stream */
/* CPU TYPE :Other */
/* */
/* This file is generated by Renesas Project Generator (Ver.4.50). */
/* NOTE:THIS IS A TYPICAL EXAMPLE. */
/* */
/***********************************************************************/
/*********************************************************************
*
* Device : RX
*
* File Name : lowsrc.c
*
* Abstract : Program of I/O Stream.
/***********************************************************************************************************************
* DISCLAIMER
* This software is supplied by Renesas Electronics Corporation and is only intended for use with Renesas products. No
* other uses are authorized. This software is owned by Renesas Electronics Corporation and is protected under all
* applicable laws, including copyright laws.
* THIS SOFTWARE IS PROVIDED "AS IS" AND RENESAS MAKES NO WARRANTIES REGARDING
* THIS SOFTWARE, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. ALL SUCH WARRANTIES ARE EXPRESSLY DISCLAIMED. TO THE MAXIMUM
* EXTENT PERMITTED NOT PROHIBITED BY LAW, NEITHER RENESAS ELECTRONICS CORPORATION NOR ANY OF ITS AFFILIATED COMPANIES
* SHALL BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES FOR ANY REASON RELATED TO THIS
* SOFTWARE, EVEN IF RENESAS OR ITS AFFILIATES HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
* Renesas reserves the right, without notice, to make changes to this software and to discontinue the availability of
* this software. By using this software, you agree to the additional terms and conditions found by accessing the
* following link:
* http://www.renesas.com/disclaimer
*
* History : 1.00 (2009-08-07)
*
* NOTE : THIS IS A TYPICAL EXAMPLE.
*
* Copyright(c) 2009 Renesas Technology Corp.
* And Renesas Solutions Corp.,All Rights Reserved.
*
*********************************************************************/
* Copyright (C) 2012 Renesas Electronics Corporation. All rights reserved.
***********************************************************************************************************************/
/***********************************************************************************************************************
* File Name : lowsrc.c
* Description : Functions to support stream I/O
***********************************************************************************************************************/
/***********************************************************************************************************************
* History : DD.MM.YYYY Version Description
* : 26.10.2011 1.00 First Release
***********************************************************************************************************************/
/***********************************************************************************************************************
Includes <System Includes> , "Project Includes"
***********************************************************************************************************************/
#include <string.h>
#include <stdio.h>
#include <stddef.h>
#include "lowsrc.h"
/***********************************************************************************************************************
Macro definitions
***********************************************************************************************************************/
/*Number of I/O Stream*/
#define IOSTREAM 20
/* file number */
#define STDIN 0 /* Standard input (console) */

@ -0,0 +1,59 @@
/***********************************************************************************************************************
* DISCLAIMER
* This software is supplied by Renesas Electronics Corporation and is only intended for use with Renesas products. No
* other uses are authorized. This software is owned by Renesas Electronics Corporation and is protected under all
* applicable laws, including copyright laws.
* THIS SOFTWARE IS PROVIDED "AS IS" AND RENESAS MAKES NO WARRANTIES REGARDING
* THIS SOFTWARE, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. ALL SUCH WARRANTIES ARE EXPRESSLY DISCLAIMED. TO THE MAXIMUM
* EXTENT PERMITTED NOT PROHIBITED BY LAW, NEITHER RENESAS ELECTRONICS CORPORATION NOR ANY OF ITS AFFILIATED COMPANIES
* SHALL BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES FOR ANY REASON RELATED TO THIS
* SOFTWARE, EVEN IF RENESAS OR ITS AFFILIATES HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
* Renesas reserves the right, without notice, to make changes to this software and to discontinue the availability of
* this software. By using this software, you agree to the additional terms and conditions found by accessing the
* following link:
* http://www.renesas.com/disclaimer
*
* Copyright (C) 2012 Renesas Electronics Corporation. All rights reserved.
***********************************************************************************************************************/
/***********************************************************************************************************************
* File Name : mcu_info.h
* Device(s) : RX
* H/W Platform : RSK+RX63N
* Description : Information about the MCU on this board.
***********************************************************************************************************************/
/***********************************************************************************************************************
* History : DD.MM.YYYY Version Description
* : 28.11.2011 1.00 First Release
* : 13.03.2012 1.10 System clock speeds are now calculated from macros in r_bsp_config.h.
***********************************************************************************************************************/
#ifndef _MCU_INFO
#define _MCU_INFO
/* MCU that is used. */
#define MCU_RX63N (1)
/* Package. */
#define PACKAGE_LQFP176 (1)
/* Memory size of your MCU. */
#define ROM_SIZE_BYTES (1048576)
#define RAM_SIZE_BYTES (131072)
#define DF_SIZE_BYTES (32768)
/* System clock speed in Hz. */
#define ICLK_HZ (((XTAL_HZ/PLL_DIV) * PLL_MUL) / ICK_DIV)
/* Peripheral Module Clock A speed in Hz. Used for ETHERC and EDMAC. */
#define PCLKA_HZ (((XTAL_HZ/PLL_DIV) * PLL_MUL) / PCKA_DIV)
/* Peripheral Module Clock B speed in Hz. */
#define PCLKB_HZ (((XTAL_HZ/PLL_DIV) * PLL_MUL) / PCKB_DIV)
/* External bus clock speed in Hz. */
#define BCLK_HZ (((XTAL_HZ/PLL_DIV) * PLL_MUL) / BCK_DIV)
/* FlashIF clock speed in Hz. */
#define FCLK_HZ (((XTAL_HZ/PLL_DIV) * PLL_MUL) / FCK_DIV)
/* USB clock speed in Hz. */
#define UCLK_HZ (((XTAL_HZ/PLL_DIV) * PLL_MUL) / UCK_DIV)
#endif /* _MCU_INFO */

@ -0,0 +1,54 @@
/***********************************************************************************************************************
* DISCLAIMER
* This software is supplied by Renesas Electronics Corporation and is only intended for use with Renesas products. No
* other uses are authorized. This software is owned by Renesas Electronics Corporation and is protected under all
* applicable laws, including copyright laws.
* THIS SOFTWARE IS PROVIDED "AS IS" AND RENESAS MAKES NO WARRANTIES REGARDING
* THIS SOFTWARE, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. ALL SUCH WARRANTIES ARE EXPRESSLY DISCLAIMED. TO THE MAXIMUM
* EXTENT PERMITTED NOT PROHIBITED BY LAW, NEITHER RENESAS ELECTRONICS CORPORATION NOR ANY OF ITS AFFILIATED COMPANIES
* SHALL BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES FOR ANY REASON RELATED TO THIS
* SOFTWARE, EVEN IF RENESAS OR ITS AFFILIATES HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
* Renesas reserves the right, without notice, to make changes to this software and to discontinue the availability of
* this software. By using this software, you agree to the additional terms and conditions found by accessing the
* following link:
* http://www.renesas.com/disclaimer
*
* Copyright (C) 2012 Renesas Electronics Corporation. All rights reserved.
***********************************************************************************************************************/
/***********************************************************************************************************************
* File Name : r_bsp.h
* H/W Platform : RSK+RX63N
* Description : Has the header files that should be included for this platform.
***********************************************************************************************************************/
/***********************************************************************************************************************
* History : DD.MM.YYYY Version Description
* : 13.01.2012 1.00 First Release
* : 13.03.2012 1.10 Added locking.h and r_bsp_config.h #includes. Removed sbrk.h since heap size is not
* defined in r_bsp_config.h.
***********************************************************************************************************************/
#ifndef PLATFORM_BOARD_RSKRX63N
#define PLATFORM_BOARD_RSKRX63N
/* Make sure that no other platforms have already been defined. Do not touch this! */
#ifdef PLATFORM_DEFINED
#error "Error - Multiple platforms defined in platform.h!"
#else
#define PLATFORM_DEFINED
#endif
/***********************************************************************************************************************
INCLUDE APPROPRIATE MCU AND BOARD FILES
***********************************************************************************************************************/
#include "r_bsp_config.h"
#include ".\mcu\rx63n\iodefine.h"
#include ".\board\rskrx63n\rskrx63n.h"
#include ".\board\rskrx63n\mcu_info.h"
#include ".\board\rskrx63n\hwsetup.h"
#include ".\board\rskrx63n\lcd.h"
#include ".\board\rskrx63n\locking.h"
#endif /* PLATFORM_BOARD_RSKRX63N */

@ -0,0 +1,409 @@
/***********************************************************************************************************************
* DISCLAIMER
* This software is supplied by Renesas Electronics Corporation and is only intended for use with Renesas products. No
* other uses are authorized. This software is owned by Renesas Electronics Corporation and is protected under all
* applicable laws, including copyright laws.
* THIS SOFTWARE IS PROVIDED "AS IS" AND RENESAS MAKES NO WARRANTIES REGARDING
* THIS SOFTWARE, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. ALL SUCH WARRANTIES ARE EXPRESSLY DISCLAIMED. TO THE MAXIMUM
* EXTENT PERMITTED NOT PROHIBITED BY LAW, NEITHER RENESAS ELECTRONICS CORPORATION NOR ANY OF ITS AFFILIATED COMPANIES
* SHALL BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES FOR ANY REASON RELATED TO THIS
* SOFTWARE, EVEN IF RENESAS OR ITS AFFILIATES HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
* Renesas reserves the right, without notice, to make changes to this software and to discontinue the availability of
* this software. By using this software, you agree to the additional terms and conditions found by accessing the
* following link:
* http://www.renesas.com/disclaimer
*
* Copyright (C) 2012 Renesas Electronics Corporation. All rights reserved.
***********************************************************************************************************************/
/***********************************************************************************************************************
* File Name : resetprg.c
* Device(s) : RX63x
* Description : Defines post-reset routines that are used to configure the MCU prior to the main program starting.
* This is were the program counter starts on power-up or reset.
***********************************************************************************************************************/
/***********************************************************************************************************************
* History : DD.MM.YYYY Version Description
* : 26.10.2011 1.00 First Release
* : 13.03.2012 1.10 Stack sizes are now defined in r_bsp_config.h. Because of this the #include for
* stacksct.h was removed. Settings for SCKCR are now set in r_bsp_config.h and used here
* to setup clocks based on user settings.
***********************************************************************************************************************/
/***********************************************************************************************************************
Includes <System Includes> , "Project Includes"
***********************************************************************************************************************/
/* Defines machine level functions used in this file */
#include <machine.h>
/* Defines MCU configuration functions used in this file */
#include <_h_c_lib.h>
/* Defines standard variable types used in this file */
#include <stdbool.h>
#include <stdint.h>
/* This macro is here so that the stack will be declared here. This is used to prevent multiplication of stack size. */
#define BSP_DECLARE_STACK
/* Define the target platform */
#include "platform.h"
/***********************************************************************************************************************
Macro definitions
***********************************************************************************************************************/
#define PSW_init (0x00030000)
#define FPSW_init (0x00000100)
/***********************************************************************************************************************
Pre-processor Directives
***********************************************************************************************************************/
/* Declare the contents of the function 'Change_PSW_PM_to_UserMode' as
assembler to the compiler */
#pragma inline_asm Change_PSW_PM_to_UserMode
/* Set this as the entry point from a power-on reset */
#pragma entry PowerON_Reset_PC
/***********************************************************************************************************************
External function Prototypes
***********************************************************************************************************************/
/* Functions to setup I/O library */
extern void _INIT_IOLIB(void);
extern void _CLOSEALL(void);
/***********************************************************************************************************************
Private global variables and functions
***********************************************************************************************************************/
/* Power-on reset function declaration */
void PowerON_Reset_PC(void);
#if RUN_IN_USER_MODE==1
#if __RENESAS_VERSION__ < 0x01010000
/* MCU usermode switcher function declaration */
static void Change_PSW_PM_to_UserMode(void);
#endif
#endif
/* Main program function delcaration */
void main(void);
static void operating_frequency_set(void);
/***********************************************************************************************************************
* Function name: PowerON_Reset_PC
* Description : This function is the MCU's entry point from a power-on reset.
* The following steps are taken in the startup code:
* 1. The User Stack Pointer (USP) and Interrupt Stack Pointer (ISP) are both set immediately after entry
* to this function. The USP and ISP stack sizes are set in the file stacksct.h.
* Default sizes are USP=4K and ISP=1K.
* 2. The interrupt vector base register is set to point to the beginning of the relocatable interrupt
* vector table.
* 3. The MCU is setup for floating point operations by setting the initial value of the Floating Point
* Status Word (FPSW).
* 4. The MCU operating frequency is set by configuring the Clock Generation Circuit (CGC) in
* operating_frequency_set.
* 5. Calls are made to functions to setup the C runtime environment which involves initializing all
* initialed data, zeroing all uninitialized variables, and configuring STDIO if used
* (calls to _INITSCT and _INIT_IOLIB).
* 6. Board-specific hardware setup, including configuring I/O pins on the MCU, in hardware_setup.
* 7. Global interrupts are enabled by setting the I bit in the Program Status Word (PSW), and the stack
* is switched from the ISP to the USP. The initial Interrupt Priority Level is set to zero, enabling
* any interrupts with a priority greater than zero to be serviced.
* 8. The processor is optionally switched to user mode. To run in user mode, set the macro
* RUN_IN_USER_MODE above to a 1.
* 9. The bus error interrupt is enabled to catch any accesses to invalid or reserved areas of memory.
*
* Once this initialization is complete, the user's main() function is called. It should not return.
* Arguments : none
* Return value : none
***********************************************************************************************************************/
void PowerON_Reset_PC(void)
{
/* Stack pointers are setup prior to calling this function - see comments above */
/* Initialise the MCU processor word */
#if __RENESAS_VERSION__ >= 0x01010000
set_intb((void *)__sectop("C$VECT"));
#else
set_intb((unsigned long)__sectop("C$VECT"));
#endif
/* Initialize FPSW for floating-point operations */
#ifdef __ROZ
#define _ROUND 0x00000001 /* Let FPSW RMbits=01 (round to zero) */
#else
#define _ROUND 0x00000000 /* Let FPSW RMbits=00 (round to nearest) */
#endif
#ifdef __DOFF
#define _DENOM 0x00000100 /* Let FPSW DNbit=1 (denormal as zero) */
#else
#define _DENOM 0x00000000 /* Let FPSW DNbit=0 (denormal as is) */
#endif
set_fpsw(FPSW_init | _ROUND | _DENOM);
/* Switch to high-speed operation */
operating_frequency_set();
/* Initialize C runtime environment */
_INITSCT();
/* Comment this out if not using I/O lib */
_INIT_IOLIB();
/* Configure the MCU and YRDK hardware */
hardware_setup();
/* Change the MCU's usermode from supervisor to user */
nop();
set_psw(PSW_init);
#if RUN_IN_USER_MODE==1
/* Use chg_pmusr() intrinsic if possible. */
#if __RENESAS_VERSION__ >= 0x01010000
chg_pmusr() ;
#else
Change_PSW_PM_to_UserMode();
#endif
#endif
/* Enable the bus error interrupt to catch accesses to illegal/reserved areas of memory */
/* The ISR for this interrupt can be found in vecttbl.c in the function "bus_error_isr" */
/* Clear any pending interrupts */
IR(BSC,BUSERR) = 0;
/* Make this the highest priority interrupt (adjust as necessary for your application */
IPR(BSC,BUSERR) = 0x0F;
/* Enable the interrupt in the ICU*/
IEN(BSC,BUSERR) = 1;
/* Enable illegal address interrupt in the BSC */
BSC.BEREN.BIT.IGAEN = 1;
/* Call the main program function (should not return) */
main();
/* Comment this out if not using I/O lib - cleans up open files */
_CLOSEALL();
while(1)
{
/* Infinite loop. Put a breakpoint here if you want to catch an exit of main(). */
}
}
/***********************************************************************************************************************
* Function name: operating_frequency_set
* Description : Configures the clock settings for each of the device clocks
* Arguments : none
* Return value : none
***********************************************************************************************************************/
void operating_frequency_set(void)
{
/* Used for constructing value to write to SCKCR register. */
uint32_t temp_clock = 0;
/*
Clock Description Frequency
----------------------------------------
Input Clock Frequency............ 12 MHz
PLL frequency (x16).............. 192 MHz
Internal Clock Frequency......... 96 MHz
Peripheral Clock Frequency....... 48 MHz
USB Clock Frequency.............. 48 MHz
External Bus Clock Frequency..... 24 MHz */
volatile unsigned int i;
/* Protect off. */
SYSTEM.PRCR.WORD = 0xA50B;
/* Uncomment if not using sub-clock */
//SYSTEM.SOSCCR.BYTE = 0x01; /* stop sub-clock */
SYSTEM.SOSCCR.BYTE = 0x00; /* Enable sub-clock for RTC */
/* Wait 131,072 cycles * 12 MHz = 10.9 ms */
SYSTEM.MOSCWTCR.BYTE = 0x0D;
/* PLL wait is 4,194,304 cycles (default) * 192 MHz (12 MHz * 16) = 20.1 ms*/
SYSTEM.PLLWTCR.BYTE = 0x0F;
/* Set PLL Input Divisor. */
SYSTEM.PLLCR.BIT.PLIDIV = PLL_DIV >> 1;
/* Set PLL Multiplier. */
SYSTEM.PLLCR.BIT.STC = PLL_MUL - 1;
/* EXTAL ON */
SYSTEM.MOSCCR.BYTE = 0x00;
/* PLL ON */
SYSTEM.PLLCR2.BYTE = 0x00;
for(i = 0;i< 0x168;i++)
{
/* Wait over 12ms */
nop() ;
}
/* Figure out setting for FCK bits. */
#if FCK_DIV == 1
/* Do nothing since FCK bits should be 0. */
#elif FCK_DIV == 2
temp_clock |= 0x10000000;
#elif FCK_DIV == 4
temp_clock |= 0x20000000;
#elif FCK_DIV == 8
temp_clock |= 0x30000000;
#elif FCK_DIV == 16
temp_clock |= 0x40000000;
#elif FCK_DIV == 32
temp_clock |= 0x50000000;
#elif FCK_DIV == 64
temp_clock |= 0x60000000;
#else
#error "Error! Invalid setting for FCK_DIV in r_bsp_config.h"
#endif
/* Figure out setting for ICK bits. */
#if ICK_DIV == 1
/* Do nothing since ICK bits should be 0. */
#elif ICK_DIV == 2
temp_clock |= 0x01000000;
#elif ICK_DIV == 4
temp_clock |= 0x02000000;
#elif ICK_DIV == 8
temp_clock |= 0x03000000;
#elif ICK_DIV == 16
temp_clock |= 0x04000000;
#elif ICK_DIV == 32
temp_clock |= 0x05000000;
#elif ICK_DIV == 64
temp_clock |= 0x06000000;
#else
#error "Error! Invalid setting for ICK_DIV in r_bsp_config.h"
#endif
/* SDCLK Pin Output and BCLK Pin Output are disabled by default. */
temp_clock |= 0x00C00000;
/* Figure out setting for BCK bits. */
#if BCK_DIV == 1
/* Do nothing since BCK bits should be 0. */
#elif BCK_DIV == 2
temp_clock |= 0x00010000;
#elif BCK_DIV == 4
temp_clock |= 0x00020000;
#elif BCK_DIV == 8
temp_clock |= 0x00030000;
#elif BCK_DIV == 16
temp_clock |= 0x00040000;
#elif BCK_DIV == 32
temp_clock |= 0x00050000;
#elif BCK_DIV == 64
temp_clock |= 0x00060000;
#else
#error "Error! Invalid setting for BCK_DIV in r_bsp_config.h"
#endif
/* Figure out setting for PCKA bits. */
#if PCKA_DIV == 1
/* Do nothing since PCKA bits should be 0. */
#elif PCKA_DIV == 2
temp_clock |= 0x00001000;
#elif PCKA_DIV == 4
temp_clock |= 0x00002000;
#elif PCKA_DIV == 8
temp_clock |= 0x00003000;
#elif PCKA_DIV == 16
temp_clock |= 0x00004000;
#elif PCKA_DIV == 32
temp_clock |= 0x00005000;
#elif PCKA_DIV == 64
temp_clock |= 0x00006000;
#else
#error "Error! Invalid setting for PCKA_DIV in r_bsp_config.h"
#endif
/* Figure out setting for PCKB bits. */
#if PCKB_DIV == 1
/* Do nothing since PCKB bits should be 0. */
#elif PCKB_DIV == 2
temp_clock |= 0x00000100;
#elif PCKB_DIV == 4
temp_clock |= 0x00000200;
#elif PCKB_DIV == 8
temp_clock |= 0x00000300;
#elif PCKB_DIV == 16
temp_clock |= 0x00000400;
#elif PCKB_DIV == 32
temp_clock |= 0x00000500;
#elif PCKB_DIV == 64
temp_clock |= 0x00000600;
#else
#error "Error! Invalid setting for PCKB_DIV in r_bsp_config.h"
#endif
/* Bottom byte of SCKCR register must be set to 0x11 */
temp_clock |= 0x00000011;
/* Set SCKCR register. */
SYSTEM.SCKCR.LONG = temp_clock;
/* Re-init temp_clock to use to set SCKCR2. */
temp_clock = 0;
/* Figure out setting for IEBCK bits. */
#if IEBCK_DIV == 2
temp_clock |= 0x00000001;
#elif IEBCK_DIV == 4
temp_clock |= 0x00000002;
#elif IEBCK_DIV == 6
temp_clock |= 0x0000000C;
#elif IEBCK_DIV == 8
temp_clock |= 0x00000003;
#elif IEBCK_DIV == 16
temp_clock |= 0x00000004;
#elif IEBCK_DIV == 32
temp_clock |= 0x00000005;
#elif IEBCK_DIV == 64
temp_clock |= 0x00000006;
#else
#error "Error! Invalid setting for IEBCK_DIV in r_bsp_config.h"
#endif
/* Figure out setting for UCK bits. */
#if UCK_DIV == 3
temp_clock |= 0x00000020;
#elif UCK_DIV == 4
temp_clock |= 0x00000030;
#else
#error "Error! Invalid setting for UCK_DIV in r_bsp_config.h"
#endif
/* Set SCKCR2 register. */
SYSTEM.SCKCR2.WORD = (uint16_t)temp_clock;
/* Choose clock source. Default for r_bsp_config.h is PLL. */
SYSTEM.SCKCR3.WORD = ((uint16_t)CLOCK_SOURCE) << 8;
/* Protect on. */
SYSTEM.PRCR.WORD = 0xA500;
}
/***********************************************************************************************************************
* Function name: Change_PSW_PM_to_UserMode
* Description : Assembler function, used to change the MCU's usermode from supervisor to user.
* Arguments : none
* Return value : none
***********************************************************************************************************************/
#if RUN_IN_USER_MODE==1
#if __RENESAS_VERSION__ < 0x01010000
static void Change_PSW_PM_to_UserMode(void)
{
MVFC PSW,R1
OR #00100000h,R1
PUSH.L R1
MVFC PC,R1
ADD #10,R1
PUSH.L R1
RTE
NOP
NOP
}
#endif
#endif

@ -0,0 +1,65 @@
/***********************************************************************************************************************
* DISCLAIMER
* This software is supplied by Renesas Electronics Corporation and is only intended for use with Renesas products. No
* other uses are authorized. This software is owned by Renesas Electronics Corporation and is protected under all
* applicable laws, including copyright laws.
* THIS SOFTWARE IS PROVIDED "AS IS" AND RENESAS MAKES NO WARRANTIES REGARDING
* THIS SOFTWARE, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. ALL SUCH WARRANTIES ARE EXPRESSLY DISCLAIMED. TO THE MAXIMUM
* EXTENT PERMITTED NOT PROHIBITED BY LAW, NEITHER RENESAS ELECTRONICS CORPORATION NOR ANY OF ITS AFFILIATED COMPANIES
* SHALL BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES FOR ANY REASON RELATED TO THIS
* SOFTWARE, EVEN IF RENESAS OR ITS AFFILIATES HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
* Renesas reserves the right, without notice, to make changes to this software and to discontinue the availability of
* this software. By using this software, you agree to the additional terms and conditions found by accessing the
* following link:
* http://www.renesas.com/disclaimer
*
* Copyright (C) 2012 Renesas Electronics Corporation. All rights reserved.
***********************************************************************************************************************/
/***********************************************************************************************************************
* File Name : rskrx63n.h
* H/W Platform : RSK+RX63N
* Description : Board specific definitions for the RSKRX630.
***********************************************************************************************************************/
/***********************************************************************************************************************
* History : DD.MM.YYYY Version Description
* : 28.11.2011 1.00 First Release
***********************************************************************************************************************/
#ifndef RSKRX63N_H
#define RSKRX63N_H
/* Local defines */
#define LED_ON (0)
#define LED_OFF (1)
#define SET_BIT_HIGH (1)
#define SET_BIT_LOW (0)
#define SET_BYTE_HIGH (0xFF)
#define SET_BYTE_LOW (0x00)
/* Switches */
#define SW_ACTIVE 0
#define SW1 PORT3.PIDR.BIT.B2
#define SW2 PORT0.PIDR.BIT.B0
#define SW3 PORT0.PIDR.BIT.B7
#define SW1_PDR PORT3.PDR.BIT.B2
#define SW2_PDR PORT0.PDR.BIT.B0
#define SW3_PDR PORT0.PDR.BIT.B7
#define SW1_PMR PORT3.PMR.BIT.B2
#define SW2_PMR PORT0.PMR.BIT.B0
#define SW3_PMR PORT0.PMR.BIT.B7
/* LEDs */
#define LED0 PORT0.PODR.BIT.B3
#define LED1 PORT0.PODR.BIT.B5
#define LED2 PORT1.PODR.BIT.B0
#define LED3 PORT1.PODR.BIT.B1
#define LED0_PDR PORT0.PDR.BIT.B3
#define LED1_PDR PORT0.PDR.BIT.B5
#define LED2_PDR PORT1.PDR.BIT.B0
#define LED3_PDR PORT1.PDR.BIT.B1
/* Slave select. */
#define FLASH_CS PORT3.PDR.BIT.B1 // SSLB0
#endif /* RSKRX63N_H */

@ -0,0 +1,96 @@
/***********************************************************************************************************************
* DISCLAIMER
* This software is supplied by Renesas Electronics Corporation and is only intended for use with Renesas products. No
* other uses are authorized. This software is owned by Renesas Electronics Corporation and is protected under all
* applicable laws, including copyright laws.
* THIS SOFTWARE IS PROVIDED "AS IS" AND RENESAS MAKES NO WARRANTIES REGARDING
* THIS SOFTWARE, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. ALL SUCH WARRANTIES ARE EXPRESSLY DISCLAIMED. TO THE MAXIMUM
* EXTENT PERMITTED NOT PROHIBITED BY LAW, NEITHER RENESAS ELECTRONICS CORPORATION NOR ANY OF ITS AFFILIATED COMPANIES
* SHALL BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES FOR ANY REASON RELATED TO THIS
* SOFTWARE, EVEN IF RENESAS OR ITS AFFILIATES HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
* Renesas reserves the right, without notice, to make changes to this software and to discontinue the availability of
* this software. By using this software, you agree to the additional terms and conditions found by accessing the
* following link:
* http://www.renesas.com/disclaimer
*
* Copyright (C) 2012 Renesas Electronics Corporation. All rights reserved.
***********************************************************************************************************************/
/***********************************************************************************************************************
* File Name : sbrk.c
* Device(s) : RX
* Description : Configures the MCU heap memory. The size of the heap is defined by the macro HEAPSIZE below.
***********************************************************************************************************************/
/***********************************************************************************************************************
* History : DD.MM.YYYY Version Description
* : 26.10.2011 1.00 First Release
* : 12.03.2012 1.10 Heap size is now defined in r_bsp_config.h, not sbrk.h.
***********************************************************************************************************************/
/***********************************************************************************************************************
Includes <System Includes> , "Project Includes"
***********************************************************************************************************************/
/* Provides standard definitions used in this file */
#include <stddef.h>
/* Defines standard input/output functions used in this file */
#include <stdio.h>
/* Defines standard variable types used in this file */
#include <stdint.h>
/* Used for getting HEAP_BYTES macro. */
#include "platform.h"
/***********************************************************************************************************************
Macro definitions
***********************************************************************************************************************/
/***********************************************************************************************************************
Function Prototypes
***********************************************************************************************************************/
/* Memory allocation function prototype declaration */
int8_t *sbrk(size_t size);
/***********************************************************************************************************************
Global Variables
***********************************************************************************************************************/
//const size_t _sbrk_size= /* Specifies the minimum unit of */
/* the defined heap area */
extern int8_t *_s1ptr;
union HEAP_TYPE
{
int32_t dummy; /* Dummy for 4-byte boundary */
int8_t heap[HEAP_BYTES]; /* Declaration of the area managed by sbrk*/
};
/* Declare memory heap area */
static union HEAP_TYPE heap_area;
/* End address allocated by sbrk */
static int8_t *brk=(int8_t *)&heap_area;
/***********************************************************************************************************************
* Function name: sbrk
* Description : This function configures MCU memory area allocation.
* Arguments : size -
* assigned area size
* Return value : Start address of allocated area (pass)
* -1 (failure)
***********************************************************************************************************************/
int8_t *sbrk(size_t size)
{
int8_t *p;
if (brk+size > heap_area.heap+HEAP_BYTES)
{
/* Empty area size */
p = (int8_t *)-1;
}
else
{
/* Area assignment */
p = brk;
/* End address update */
brk += size;
}
/* Return result */
return p;
}

@ -0,0 +1,186 @@
/***********************************************************************************************************************
* DISCLAIMER
* This software is supplied by Renesas Electronics Corporation and is only intended for use with Renesas products. No
* other uses are authorized. This software is owned by Renesas Electronics Corporation and is protected under all
* applicable laws, including copyright laws.
* THIS SOFTWARE IS PROVIDED "AS IS" AND RENESAS MAKES NO WARRANTIES REGARDING
* THIS SOFTWARE, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. ALL SUCH WARRANTIES ARE EXPRESSLY DISCLAIMED. TO THE MAXIMUM
* EXTENT PERMITTED NOT PROHIBITED BY LAW, NEITHER RENESAS ELECTRONICS CORPORATION NOR ANY OF ITS AFFILIATED COMPANIES
* SHALL BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES FOR ANY REASON RELATED TO THIS
* SOFTWARE, EVEN IF RENESAS OR ITS AFFILIATES HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
* Renesas reserves the right, without notice, to make changes to this software and to discontinue the availability of
* this software. By using this software, you agree to the additional terms and conditions found by accessing the
* following link:
* http://www.renesas.com/disclaimer
*
* Copyright (C) 2012 Renesas Electronics Corporation. All rights reserved.
***********************************************************************************************************************/
/***********************************************************************************************************************
* File Name : vecttbl.c
* Device(s) : RX
* Description : Definition of the fixed vector table
***********************************************************************************************************************/
/***********************************************************************************************************************
* History : DD.MM.YYYY Version Description
* : 26.10.2011 1.00 First Release
* : 17.02.2012 1.10 Made function names compliant with CS v4.0
* : 13.03.2012 1.20 ID Code is now specified in r_bsp_config.h. It is still used here in Fixed_Vectors[].
***********************************************************************************************************************/
/***********************************************************************************************************************
Includes <System Includes> , "Project Includes"
***********************************************************************************************************************/
#include <stdint.h>
#include <machine.h>
#include "platform.h"
/***********************************************************************************************************************
* Function name: PowerON_Reset_PC
* Description : The reset vector points to this function. Code execution starts in this function after reset.
* Arguments : none
* Return value : none
***********************************************************************************************************************/
extern void PowerON_Reset_PC(void);
/***********************************************************************************************************************
* Function name: excep_supervisor_inst_isr
* Description : Supervisor Instruction Violation ISR
* Arguments : none
* Return Value : none
***********************************************************************************************************************/
#pragma interrupt (excep_supervisor_inst_isr)
void excep_supervisor_inst_isr(void)
{
/* Add your own code here to handle this exception */
nop();
}
/***********************************************************************************************************************
* Function name: excep_undefined_inst_isr
* Description : Undefined instruction exception ISR
* Arguments : none
* Return Value : none
***********************************************************************************************************************/
#pragma interrupt (excep_undefined_inst_isr)
void excep_undefined_inst_isr(void)
{
/* Add your own code here to handle this exception */
nop();
}
/***********************************************************************************************************************
* Function name: excep_floating_point_isr
* Description : Floating point exception ISR
* Arguments : none
* Return Value : none
***********************************************************************************************************************/
#pragma interrupt (excep_floating_point_isr)
void excep_floating_point_isr(void)
{
/* Add your own code here to handle this exception */
nop();
}
/***********************************************************************************************************************
* Function name: non_maskable_isr
* Description : Non-maskable interrupt ISR
* Arguments : none
* Return Value : none
***********************************************************************************************************************/
#pragma interrupt (non_maskable_isr)
void non_maskable_isr(void)
{
/* Add your own code here to handle this exception */
nop();
}
/***********************************************************************************************************************
* Function name: undefined_interrupt_source_isr
* Description : All undefined interrupt vectors point to this function.
* Set a breakpoint in this function to determine which source is creating unwanted interrupts.
* Arguments : none
* Return Value : none
***********************************************************************************************************************/
#pragma interrupt (undefined_interrupt_source_isr)
void undefined_interrupt_source_isr(void)
{
/* Add your own code here to handle this exception */
nop();
}
/***********************************************************************************************************************
* Function name: bus_error_isr
* Description : By default, this demo code enables the Bus Error Interrupt. This interrupt will fire if the user tries
* to access code or data from one of the reserved areas in the memory map, including the areas covered
* by disabled chip selects. A nop() statement is included here as a convenient place to set a breakpoint
* during debugging and development, and further handling should be added by the user for their
* application.
* Arguments : none
* Return value : none
***********************************************************************************************************************/
#pragma interrupt (bus_error_isr(vect=VECT(BSC,BUSERR)))
void bus_error_isr (void)
{
/*
To find the address that was accessed when the bus error occured, read the register BSC.BERSR2.WORD. The upper
13 bits of this register contain the upper 13-bits of the offending address (in 512K byte units)
*/
/* Add your own code here to handle this interrupt */
nop();
}
/***********************************************************************************************************************
* The following array fills in the fixed vector table and the code
* protecction ID bytes.
***********************************************************************************************************************/
#pragma section C FIXEDVECT
void* const Fixed_Vectors[] = {
/* 0xffffff90 through 0xffffff9f: Reserved area - must be all 0xFF */
(void *)0xFFFFFFFF, /* 0xffffff90 - Reserved */
(void *)0xFFFFFFFF, /* 0xffffff94 - Reserved */
(void *)0xFFFFFFFF, /* 0xffffff98 - Reserved */
/* The 32-bit area immediately below (0xffffff9c through 0xffffff9f) is a special area that allows the ROM to be
protected from reading or writing by a parallel programmer. Please refer to the HW manual for appropriate settings.
The default (all 0xff) places no restrictions and therefore allows reads and writes by a parallel programmer. */
(void *)0xFFFFFFFF, /* 0xffffff9C - ROM Code Protection */
/* The memory are immediately below (0xffffffa0 through 0xffffffaf) is a special area that allows the on-chip firmware
to be protected. See the section "ID Code Protection" in the HW manual for details on how to enable protection.
Setting the four long words below to non-0xFF values will enable protection. Do this only after carefully review
the HW manual */
/* 0xffffffA0 through 0xffffffaf: ID Code Protection. The ID code is specified using macros in r_bsp_config.h. */
(void *) ID_CODE_LONG_1, /* 0xffffffA0 - Control code and ID code */
(void *) ID_CODE_LONG_2, /* 0xffffffA4 - ID code (cont.) */
(void *) ID_CODE_LONG_3, /* 0xffffffA8 - ID code (cont.) */
(void *) ID_CODE_LONG_4, /* 0xffffffAC - ID code (cont.) */
/* 0xffffffB0 through 0xffffffcf: Reserved area */
(void *) 0xFFFFFFFF, /* 0xffffffB0 - Reserved */
(void *) 0xFFFFFFFF, /* 0xffffffB4 - Reserved */
(void *) 0xFFFFFFFF, /* 0xffffffB8 - Reserved */
(void *) 0xFFFFFFFF, /* 0xffffffBC - Reserved */
(void *) 0xFFFFFFFF, /* 0xffffffC0 - Reserved */
(void *) 0xFFFFFFFF, /* 0xffffffC4 - Reserved */
(void *) 0xFFFFFFFF, /* 0xffffffC8 - Reserved */
(void *) 0xFFFFFFFF, /* 0xffffffCC - Reserved */
/* Fixed vector table */
(void *) excep_supervisor_inst_isr, /* 0xffffffd0 Exception(Supervisor Instruction) */
(void *) undefined_interrupt_source_isr, /* 0xffffffd4 Reserved */
(void *) undefined_interrupt_source_isr, /* 0xffffffd8 Reserved */
(void *) excep_undefined_inst_isr, /* 0xffffffdc Exception(Undefined Instruction) */
(void *) undefined_interrupt_source_isr, /* 0xffffffe0 Reserved */
(void *) excep_floating_point_isr, /* 0xffffffe4 Exception(Floating Point) */
(void *) undefined_interrupt_source_isr, /* 0xffffffe8 Reserved */
(void *) undefined_interrupt_source_isr, /* 0xffffffec Reserved */
(void *) undefined_interrupt_source_isr, /* 0xfffffff0 Reserved */
(void *) undefined_interrupt_source_isr, /* 0xfffffff4 Reserved */
(void *) non_maskable_isr, /* 0xfffffff8 NMI */
(void *) PowerON_Reset_PC /* 0xfffffffc RESET */
};

@ -1,66 +0,0 @@
/***********************************************************************/
/* */
/* FILE :dbsct.c */
/* DATE :Wed, Aug 11, 2010 */
/* DESCRIPTION :Setting of B,R Section */
/* CPU TYPE :Other */
/* */
/* This file is generated by Renesas Project Generator (Ver.4.50). */
/* NOTE:THIS IS A TYPICAL EXAMPLE. */
/* */
/***********************************************************************/
/*********************************************************************
*
* Device : RX
*
* File Name : dbsct.c
*
* Abstract : Setting of B,R Section.
*
* History : 1.00 (2009-08-07)
*
* NOTE : THIS IS A TYPICAL EXAMPLE.
*
* Copyright(c) 2009 Renesas Technology Corp.
* And Renesas Solutions Corp.,All Rights Reserved.
*
*********************************************************************/
#include "typedefine.h"
#pragma unpack
#pragma section C C$DSEC
extern const struct {
_UBYTE *rom_s; /* Start address of the initialized data section in ROM */
_UBYTE *rom_e; /* End address of the initialized data section in ROM */
_UBYTE *ram_s; /* Start address of the initialized data section in RAM */
} _DTBL[] = {
{ __sectop("D"), __secend("D"), __sectop("R") },
{ __sectop("D_2"), __secend("D_2"), __sectop("R_2") },
{ __sectop("D_1"), __secend("D_1"), __sectop("R_1") }
};
#pragma section C C$BSEC
extern const struct {
_UBYTE *b_s; /* Start address of non-initialized data section */
_UBYTE *b_e; /* End address of non-initialized data section */
} _BTBL[] = {
{ __sectop("B"), __secend("B") },
{ __sectop("B_2"), __secend("B_2") },
{ __sectop("B_1"), __secend("B_1") }
};
#pragma section
/*
** CTBL prevents excessive output of L1100 messages when linking.
** Even if CTBL is deleted, the operation of the program does not change.
*/
_UBYTE * const _CTBL[] = {
__sectop("C_1"), __sectop("C_2"), __sectop("C"),
__sectop("W_1"), __sectop("W_2"), __sectop("W")
};
#pragma packoption

@ -1,293 +0,0 @@
/******************************************************************************
* DISCLAIMER
* This software is supplied by Renesas Technology Corp. and is only
* intended for use with Renesas products. No other uses are authorized.
* This software is owned by Renesas Technology Corp. and is protected under
* all applicable laws, including copyright laws.
* THIS SOFTWARE IS PROVIDED "AS IS" AND RENESAS MAKES NO WARRANTIES
* REGARDING THIS SOFTWARE, WHETHER EXPRESS, IMPLIED OR STATUTORY,
* INCLUDING BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
* PARTICULAR PURPOSE AND NON-INFRINGEMENT. ALL SUCH WARRANTIES ARE EXPRESSLY
* DISCLAIMED.
* TO THE MAXIMUM EXTENT PERMITTED NOT PROHIBITED BY LAW, NEITHER RENESAS
* TECHNOLOGY CORP. NOR ANY OF ITS AFFILIATED COMPANIES SHALL BE LIABLE
* FOR ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES
* FOR ANY REASON RELATED TO THE THIS SOFTWARE, EVEN IF RENESAS OR ITS
* AFFILIATES HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
* Renesas reserves the right, without notice, to make changes to this
* software and to discontinue the availability of this software.
* By using this software, you agree to the additional terms and
* conditions found by accessing the following link:
* http://www.renesas.com/disclaimer
******************************************************************************
* Copyright (C) 2008. Renesas Technology Corp., All Rights Reserved.
*******************************************************************************
* File Name : hwsetup.c
* Version : 1.00
* Description : Power up hardware initializations
******************************************************************************
* History : DD.MM.YYYY Version Description
* : 15.02.2010 1.00 First Release
******************************************************************************/
/******************************************************************************
Includes <System Includes> , "Project Includes"
******************************************************************************/
#include <stdint.h>
#include "iodefine.h"
#include "r_ether.h"
#include "rskrx63ndef.h"
/******************************************************************************
Typedef definitions
******************************************************************************/
/******************************************************************************
Macro definitions
******************************************************************************/
/******************************************************************************
Imported global variables and functions (from other files)
******************************************************************************/
/******************************************************************************
Exported global variables and functions (to be accessed by other files)
******************************************************************************/
/******************************************************************************
Private global variables and functions
******************************************************************************/
void io_set_cpg(void);
void ConfigurePortPins(void);
void EnablePeripheralModules(void);
/******************************************************************************
* Function Name: HardwareSetup
* Description : This function does initial setting for CPG port pins used in
* : the Demo including the MII pins of the Ethernet PHY connection.
* Arguments : none
* Return Value : none
******************************************************************************/
void HardwareSetup(void)
{
/* CPG setting */
io_set_cpg();
/* Setup the port pins */
ConfigurePortPins();
/* Enables peripherals */
EnablePeripheralModules();
#if INCLUDE_LCD == 1
/* Initialize display */
InitialiseDisplay();
#endif
}
/******************************************************************************
* Function Name: EnablePeripheralModules
* Description : Enables Peripheral Modules before use
* Arguments : none
* Return Value : none
******************************************************************************/
void EnablePeripheralModules(void)
{
/* Module standby clear */
SYSTEM.MSTPCRB.BIT.MSTPB15 = 0; /* EtherC, EDMAC */
SYSTEM.MSTPCRA.BIT.MSTPA15 = 0; /* CMT0 */
}
/******************************************************************************
* Function Name: ConfigurePortPins
* Description : Configures port pins.
* Arguments : none
* Return Value : none
******************************************************************************/
void ConfigurePortPins(void)
{
/* Port pins default to inputs. To ensure safe initialisation set the pin states
before changing the data direction registers. This will avoid any unintentional
state changes on the external ports.
Many peripheral modules will override the setting of the port registers. Ensure
that the state is safe for external devices if the internal peripheral module is
disabled or powered down. */
#if(0) /* NOTE: ETHERNET PORT IS NOT YET CONFIGURED FOR THE RX63N. */
/* ==== MII/RMII Pins setting ==== */
/*--------------------------------------*/
/* Port Function Control Register */
/*--------------------------------------*/
#if ETH_MODE_SEL == ETH_MII_MODE
/* EE=1, PHYMODE=1, ENETE3=1, ENETE2=0, ENETE1=1, ENETE0=0 (Ethernet) */
IOPORT.PFENET.BYTE = 0x9A;
#endif /* ETH_MODE_SEL */
#if ETH_MODE_SEL == ETH_RMII_MODE
/* EE=1, PHYMODE=0, ENETE3=0, ENETE2=0, ENETE1=1, ENETE0=0 (Ethernet) */
IOPORT.PFENET.BYTE = 0x82;
#endif /* ETH_MODE_SEL */
/*-------------------------------------------*/
/* Input Buffer Control Register (ICR) */
/*-------------------------------------------*/
#if ETH_MODE_SEL == ETH_MII_MODE
/* P54=1 Set ET_LINKSTA input */
PORT5.ICR.BIT.B4 = 1;
/* P71=1 Set ET_MDIO input */
PORT7.ICR.BIT.B1 = 1;
/* P74=1 Set ET_ERXD1 input */
PORT7.ICR.BIT.B4 = 1;
/* P75=1 Set ET_ERXD0 input */
PORT7.ICR.BIT.B5 = 1;
/* P76=1 Set ET_RX_CLK input */
PORT7.ICR.BIT.B6 = 1;
/* P77=1 Set ET_RX_ER input */
PORT7.ICR.BIT.B7 = 1;
/* P83=1 Set ET_CRS input */
PORT8.ICR.BIT.B3 = 1;
/* PC0=1 Set ET_ERXD3 input */
PORTC.ICR.BIT.B0 = 1;
/* PC1=1 Set ET_ERXD2 input */
PORTC.ICR.BIT.B1 = 1;
/* PC2=1 Set ET_RX_DV input */
PORTC.ICR.BIT.B2 = 1;
/* PC4=1 Set EX_TX_CLK input */
PORTC.ICR.BIT.B4 = 1;
/* PC7=1 Set ET_COL input */
PORTC.ICR.BIT.B7 = 1;
#endif /* ETH_MODE_SEL */
#if ETH_MODE_SEL == ETH_RMII_MODE
/* P54=1 Set ET_LINKSTA input */
PORT5.ICR.BIT.B4 = 1;
/* P71=1 Set ET_MDIO input */
PORT7.ICR.BIT.B1 = 1;
/* P74=1 Set RMII_RXD1 input */
PORT7.ICR.BIT.B4 = 1;
/* P75=1 Set RMII_RXD0 input */
PORT7.ICR.BIT.B5 = 1;
/* P76=1 Set REF50CLK input */
PORT7.ICR.BIT.B6 = 1;
/* P77=1 Set RMII_RX_ER input */
PORT7.ICR.BIT.B7 = 1;
/* P83=1 Set RMII_CRS_DV input */
PORT8.ICR.BIT.B3 = 1;
#endif /* ETH_MODE_SEL */
#endif /* 0 */
/* Configure LED 0-4 pin settings */
PORT1.PODR.BIT.B4 = 1;
PORT1.PODR.BIT.B5 = 1;
PORT1.PODR.BIT.B6 = 1;
PORT1.PODR.BIT.B7 = 1;
PORT1.PDR.BIT.B4 = 1;
PORT1.PDR.BIT.B5 = 1;
PORT1.PDR.BIT.B6 = 1;
PORT1.PDR.BIT.B7 = 1;
#if INCLUDE_LCD == 1
/* Set LCD pins as outputs */
/* LCD-RS */
PORTJ.PDR.BIT.B1 = 1;
/* LCD-EN */
PORTJ.PDR.BIT.B3 = 1;
/*LCD-data */
PORTH.PDR.BYTE = 0x0F;
#endif
}
/******************************************************************************
* Function Name: io_set_cpg
* Description : Sets up operating speed
* Arguments : none
* Return Value : none
******************************************************************************/
void io_set_cpg(void)
{
unsigned long i;
SYSTEM.PRCR.WORD = 0xA503; /* Access registers via PRCR */
SYSTEM.SOSCCR.BYTE = 0x00; /* Sub-clock oscillator ON */
SYSTEM.HOCOPCR.BYTE = 0x00; /* HOCO ON */
SYSTEM.MOSCWTCR.BYTE = 0x0e; /* Main Clock Oscillator Wait Control Register */
/* 262144 states */
SYSTEM.PLLWTCR.BYTE = 0x0e; /* PLL Wait Control Register */
/* 2097152 states */
SYSTEM.MOSCCR.BYTE = 0x00; /* EXTAL ON */
SYSTEM.PLLCR2.BYTE = 0x01; /* PLL OFF */
SYSTEM.PLLCR.WORD = 0x0f00; /* x16 @PLL */
/* Input to PLL = EXTAL */
/* Therefore: */
/* PLL = EXTAL */
/* = 12 */
/* PLL * 16 = 192MHz */
/* External oscillation input selection */
SYSTEM.PLLCR2.BYTE = 0x00; /* PLL ON */
for(i = 0; i<2500; i++) /* Wait for stabilisation of PLL and main clock */
{ /* = 20ms */
/* (2500 x 1/125kHz = 20ms) */
}
/************************************************************************/
/* */
/* SYSTEM.SCKCR.BIT.PCKB = 2; ( b11: b8 ) PLL/4 = 48MHz */
/* SYSTEM.SCKCR.BIT.PCKA = 2; ( b15:b12 ) PLL/4 = 48MHz */
/* SYSTEM.SCKCR.BIT.BCK = 2; ( b16:b19 ) PLL/4 = 48MHz */
/* SYSTEM.SCKCR.BIT.PSTOP0 = 1; ( b22 ) SDCLK CLK OUT Disabled */
/* SYSTEM.SCKCR.BIT.PSTOP1 = 1; ( b23 ) BUS CLK OUT Disabled */
/* SYSTEM.SCKCR.BIT.ICK = 1; ( b24:b27 ) PLL/2 = 96MHz */
/* SYSTEM.SCKCR.BIT.FCK = 2; ( b31:b28 ) PLL/3 = 48MHz */
/* */
/* SYSTEM.SCKCR2.BIT.UCK = 2; PLL/4 = 48MHz */
/* SYSTEM.SCKCR2.BIT.IEBCK = 3; PLL/4 = 48MHz */
/************************************************************************/
SYSTEM.SCKCR.LONG = 0x21c22222; /* set these bits to the same a this bit */
/* ||| | | */
/* |++---------------+ | */
/* | | */
/* +-------------------------------------+ */
SYSTEM.SCKCR2.WORD = 0x0033;
// SYSTEM.SCKCR3.WORD = 0x0000; /* LOCO -> LOCO */
// SYSTEM.SCKCR3.WORD = 0x0100; /* LOCO -> HOCO */
// SYSTEM.SCKCR3.WORD = 0x0200; /* LOCO -> MAIN */
// SYSTEM.SCKCR3.WORD = 0x0300; /* LOCO -> Sub-Clock */
SYSTEM.SCKCR3.WORD = 0x0400; /* LOCO -> PLL */
#if 1
// Configure LED - I/O pins as Outputs
// First set the Data Levels
LED0 = 1; // LED0 : OFF =1, ON = 0
LED1 = 1; // LED1 : OFF =1, ON = 0
LED2 = 1; // LED2 : OFF =1, ON = 0
LED3 = 1; // LED3 : OFF =1, ON = 0
// Set Port Direction Registers
LED0_PDR = 1; // LED0 : 1 = output
LED1_PDR = 1; // LED1 : 1 = output
LED2_PDR = 1; // LED2 : 1 = output
LED3_PDR = 1; // LED3 : 1 = output
#endif
/* Gain access to the Port Function Select Registers */
MPC.PWPR.BIT.B0WI = 0;
MPC.PWPR.BIT.PFSWE = 1;
}

@ -1,53 +0,0 @@
/***********************************************************************/
/* */
/* FILE :intprg.c */
/* DATE :Wed, Aug 11, 2010 */
/* DESCRIPTION :Interrupt Program */
/* CPU TYPE :Other */
/* */
/* This file is generated by Renesas Project Generator (Ver.4.50). */
/* NOTE:THIS IS A TYPICAL EXAMPLE. */
/* */
/***********************************************************************/
/*********************************************************************
*
* Device : RX/RX600
*
* File Name : intprg.c
*
* Abstract : Interrupt Program.
*
* History : 1.00 (2009-08-07)
*
* NOTE : THIS IS A TYPICAL EXAMPLE.
*
* Copyright(c) 2009 Renesas Technology Corp.
* And Renesas Solutions Corp.,All Rights Reserved.
*
*********************************************************************/
#include <machine.h>
#include "vect.h"
#pragma section IntPRG
// Exception(Supervisor Instruction)
void Excep_SuperVisorInst(void){/* brk(); */}
// Exception(Undefined Instruction)
void Excep_UndefinedInst(void){/* brk(); */}
// Exception(Floating Point)
void Excep_FloatingPoint(void){/* brk(); */}
// NMI
void NonMaskableInterrupt(void){/* brk(); */}
// Dummy
void Dummy(void){/* brk(); */}
// BRK
void Excep_BRK(void){ wait(); }

@ -1,120 +0,0 @@
; Comment out the orginal code
.IF 0
;------------------------------------------------------------------------
; |
; FILE :lowlvl.src |
; DATE :Wed, Jun 16, 2010 |
; DESCRIPTION :Program of Low level |
; CPU TYPE :Other |
; |
; This file is generated by Renesas Project Generator (Ver.4.50). |
; NOTE:THIS IS A TYPICAL EXAMPLE. |
; |
;------------------------------------------------------------------------
.GLB _charput
.GLB _charget
SIM_IO .EQU 0h
.SECTION P,CODE
;-----------------------------------------------------------------------
; _charput:
;-----------------------------------------------------------------------
_charput:
MOV.L #IO_BUF,R2
MOV.B R1,[R2]
MOV.L #1220000h,R1
MOV.L #PARM,R3
MOV.L R2,[R3]
MOV.L R3,R2
MOV.L #SIM_IO,R3
JSR R3
RTS
;-----------------------------------------------------------------------
; _charget:
;-----------------------------------------------------------------------
_charget:
MOV.L #1210000h,R1
MOV.L #IO_BUF,R2
MOV.L #PARM,R3
MOV.L R2,[R3]
MOV.L R3,R2
MOV.L #SIM_IO,R3
JSR R3
MOV.L #IO_BUF,R2
MOVU.B [R2],R1
RTS
;-----------------------------------------------------------------------
; I/O Buffer
;-----------------------------------------------------------------------
.SECTION B,DATA,ALIGN=4
PARM: .BLKL 1
.SECTION B_1,DATA
IO_BUF: .BLKB 1
; .END ; Commented out for conditional assembly
; Code below is for debug console
.ELSE
;-----------------------------------------------------------------------
;
; FILE :lowlvl.src
; DATE :Wed, Jul 01, 2009
; DESCRIPTION :Program of Low level
; CPU TYPE :RX
;
;-----------------------------------------------------------------------
.GLB _charput
.GLB _charget
FC2E0 .EQU 00084080h
FE2C0 .EQU 00084090h
DBGSTAT .EQU 000840C0h
RXFL0EN .EQU 00001000h
TXFL0EN .EQU 00000100h
.SECTION P,CODE
;-----------------------------------------------------------------------
; _charput:
;-----------------------------------------------------------------------
_charput:
.STACK _charput = 00000000h
__C2ESTART: MOV.L #TXFL0EN,R3
MOV.L #DBGSTAT,R4
__TXLOOP: MOV.L [R4],R5
AND R3,R5
BNZ __TXLOOP
__WRITEFC2E0: MOV.L #FC2E0,R2
MOV.L R1,[R2]
__CHARPUTEXIT: RTS
;-----------------------------------------------------------------------
; _charget:
;-----------------------------------------------------------------------
_charget:
.STACK _charget = 00000000h
__E2CSTART: MOV.L #RXFL0EN,R3
MOV.L #DBGSTAT,R4
__RXLOOP: MOV.L [R4],R5
AND R3,R5
BZ __RXLOOP
__READFE2C0: MOV.L #FE2C0,R2
MOV.L [R2],R1
__CHARGETEXIT: RTS
;-----------------------------------------------------------------------
; End of conditional code
.ENDIF
.END

@ -1,7 +1,7 @@
/***********************************************************************/
/* */
/* FILE :iodefine.h */
/* DATE :Fri, Sep 02, 2011 */
/* DATE :Mon, Jul 11, 2011 */
/* DESCRIPTION :Definition of I/O Register */
/* CPU TYPE :RX63N */
/* */
@ -7108,7 +7108,14 @@ struct st_rspi {
unsigned char OVRF:1;
} BIT;
} SPSR;
unsigned long SPDR;
//unsigned long SPDR;
union {
unsigned long LONG;
struct {
unsigned short H;
unsigned short L;
} WORD;
} SPDR;
union {
unsigned char BYTE;
struct {
@ -9666,11 +9673,35 @@ struct st_usb0 {
} BIT;
} DVSTCTR0;
char wk2[10];
unsigned short CFIFO;
//ORIG: unsigned short CFIFO;
union {
unsigned short WORD;
struct {
unsigned char L;
unsigned char H;
} BYTE;
} CFIFO;
//ENDORIG
char wk3[2];
unsigned short D0FIFO;
//ORIG: unsigned short D0FIFO;
union {
unsigned short WORD;
struct {
unsigned char L;
unsigned char H;
} BYTE;
} D0FIFO;
//ENDORIG
char wk4[2];
unsigned short D1FIFO;
//ORIG: unsigned short D1FIFO;
union {
unsigned short WORD;
struct {
unsigned char L;
unsigned char H;
} BYTE;
} D1FIFO;
//ENDORIG
char wk5[2];
union {
unsigned short WORD;
@ -11708,6 +11739,7 @@ GCR_RSPI0_SPEI0=12,GCR_RSPI1_SPEI1=12,GCR_RSPI2_SPEI2=12
#define MSTP_USB0 SYSTEM.MSTPCRB.BIT.MSTPB19
#define MSTP_RSPI0 SYSTEM.MSTPCRB.BIT.MSTPB17
#define MSTP_RSPI1 SYSTEM.MSTPCRB.BIT.MSTPB16
#define MSTP_EDMAC SYSTEM.MSTPCRB.BIT.MSTPB15
#define MSTP_TEMPS SYSTEM.MSTPCRB.BIT.MSTPB8
#define MSTP_SCI12 SYSTEM.MSTPCRB.BIT.MSTPB4
#define MSTP_SMCI12 SYSTEM.MSTPCRB.BIT.MSTPB4

@ -1,129 +0,0 @@
/***********************************************************************/
/* */
/* FILE :resetprg.c */
/* DATE :Wed, Aug 11, 2010 */
/* DESCRIPTION :Reset Program */
/* CPU TYPE :Other */
/* */
/* This file is generated by Renesas Project Generator (Ver.4.50). */
/* NOTE:THIS IS A TYPICAL EXAMPLE. */
/* */
/***********************************************************************/
/*********************************************************************
*
* Device : RX/RX600
*
* File Name : resetprg.c
*
* Abstract : Reset Program.
*
* History : 1.00 (2009-08-07)
*
* NOTE : THIS IS A TYPICAL EXAMPLE.
*
* Copyright(c) 2009 Renesas Technology Corp.
* And Renesas Solutions Corp.,All Rights Reserved.
*
*********************************************************************/
#include <machine.h>
#include <_h_c_lib.h>
//#include <stddef.h> // Remove the comment when you use errno
//#include <stdlib.h> // Remove the comment when you use rand()
#include "typedefine.h"
#include "stacksct.h"
#pragma inline_asm Change_PSW_PM_to_UserMode
static void Change_PSW_PM_to_UserMode(void);
#ifdef __cplusplus
extern "C" {
#endif
void PowerON_Reset_PC(void);
void main(void);
#ifdef __cplusplus
}
#endif
#ifdef __cplusplus // Use SIM I/O
extern "C" {
#endif
extern void _INIT_IOLIB(void);
extern void _CLOSEALL(void);
#ifdef __cplusplus
}
#endif
#define PSW_init 0x00010000
#define FPSW_init 0x00000100
//extern void srand(_UINT); // Remove the comment when you use rand()
//extern _SBYTE *_s1ptr; // Remove the comment when you use strtok()
//#ifdef __cplusplus // Use Hardware Setup
//extern "C" {
//#endif
//extern void HardwareSetup(void);
//#ifdef __cplusplus
//}
//#endif
//#ifdef __cplusplus // Remove the comment when you use global class object
//extern "C" { // Sections C$INIT and C$END will be generated
//#endif
//extern void _CALL_INIT(void);
//extern void _CALL_END(void);
//#ifdef __cplusplus
//}
//#endif
#pragma section ResetPRG
#pragma entry PowerON_Reset_PC
void PowerON_Reset_PC(void)
{
set_intb((unsigned long)__sectop("C$VECT"));
set_fpsw(FPSW_init);
_INITSCT();
// _INIT_IOLIB(); // Remove the comment when you use SIM I/O
// errno=0; // Remove the comment when you use errno
// srand((_UINT)1); // Remove the comment when you use rand()
// _s1ptr=NULL; // Remove the comment when you use strtok()
// HardwareSetup(); // Use Hardware Setup
nop();
// _CALL_INIT(); // Remove the comment when you use global class object
set_psw(PSW_init); // Set Ubit & Ibit for PSW
// Change_PSW_PM_to_UserMode(); // DO NOT CHANGE TO USER MODE IF USING FREERTOS!
( void ) Change_PSW_PM_to_UserMode; // Just to avoid compiler warnings.
main();
// _CLOSEALL(); // Use SIM I/O
// _CALL_END(); // Remove the comment when you use global class object
brk();
}
static void Change_PSW_PM_to_UserMode(void)
{
MVFC PSW,R1
OR #00100000h,R1
PUSH.L R1
MVFC PC,R1
ADD #10,R1
PUSH.L R1
RTE
NOP
NOP
}

@ -0,0 +1,75 @@
/***********************************************************************************************************************
* DISCLAIMER
* This software is supplied by Renesas Electronics Corporation and is only intended for use with Renesas products. No
* other uses are authorized. This software is owned by Renesas Electronics Corporation and is protected under all
* applicable laws, including copyright laws.
* THIS SOFTWARE IS PROVIDED "AS IS" AND RENESAS MAKES NO WARRANTIES REGARDING
* THIS SOFTWARE, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. ALL SUCH WARRANTIES ARE EXPRESSLY DISCLAIMED. TO THE MAXIMUM
* EXTENT PERMITTED NOT PROHIBITED BY LAW, NEITHER RENESAS ELECTRONICS CORPORATION NOR ANY OF ITS AFFILIATED COMPANIES
* SHALL BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES FOR ANY REASON RELATED TO THIS
* SOFTWARE, EVEN IF RENESAS OR ITS AFFILIATES HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
* Renesas reserves the right, without notice, to make changes to this software and to discontinue the availability of
* this software. By using this software, you agree to the additional terms and conditions found by accessing the
* following link:
* http://www.renesas.com/disclaimer
*
* Copyright (C) 2012 Renesas Electronics Corporation. All rights reserved.
***********************************************************************************************************************/
/***********************************************************************************************************************
* File Name : platform.h
* Version : 1.20
* Description : The user chooses which MCU and board they are developing for in this file. If the board you are using
* is not listed below, please add your own or use the default 'User Board'.
***********************************************************************************************************************/
/***********************************************************************************************************************
* History : DD.MM.YYYY Version Description
* : 30.11.2011 1.00 First Release
* : 13.01.2012 1.10 Moved from having platform defined using macro defintion, to having platform defined
* by choosing an include path. This makes this file simpler and cleans up the issue
* where HEW shows all header files for all platforms under 'Dependencies'.
* : 14.02.2012 1.20 Added RX210 BSP.
***********************************************************************************************************************/
#ifndef _PLATFORM_H_
#define _PLATFORM_H_
/***********************************************************************************************************************
DEFINE YOUR SYSTEM - UNCOMMENT THE INCLUDE PATH FOR THE PLATFORM YOU ARE USING.
***********************************************************************************************************************/
/* RSKRX610 */
//#include "./board/rskrx610/r_bsp.h"
/* RSKRX62N */
//#include "./board/rskrx62n/r_bsp.h"
/* RSKRX62T */
//#include "./board/rskrx62t/r_bsp.h"
/* RDKRX62N */
//#include "./board/rdkrx62n/r_bsp.h"
/* RSKRX630 */
//#include "./board/rskrx630/r_bsp.h"
/* RSKRX63N */
//#include "./board/rskrx63n/r_bsp.h"
/* RDKRX63N */
#include "./board/rdkrx63n/r_bsp.h"
/* RSKRX210 */
//#include "./board/rskrx210/r_bsp.h"
/* User Board - Define your own board here. */
//#include "./board/user/r_bsp.h"
/***********************************************************************************************************************
MAKE SURE AT LEAST ONE PLATFORM WAS DEFINED - DO NOT EDIT BELOW THIS POINT
***********************************************************************************************************************/
#ifndef PLATFORM_DEFINED
#error "Error - No platform defined in platform.h!"
#endif
#endif /* _PLATFORM_H_ */

@ -1,142 +0,0 @@
/***********************************************************************/
/* */
/* FILE :resetprg.c */
/* DATE :Wed, Aug 11, 2010 */
/* DESCRIPTION :Reset Program */
/* CPU TYPE :Other */
/* */
/* This file is generated by Renesas Project Generator (Ver.4.50). */
/* NOTE:THIS IS A TYPICAL EXAMPLE. */
/* */
/***********************************************************************/
/*********************************************************************
*
* Device : RX/RX600
*
* File Name : resetprg.c
*
* Abstract : Reset Program.
*
* History : 1.00 (2009-08-07)
*
* NOTE : THIS IS A TYPICAL EXAMPLE.
*
* Copyright(c) 2009 Renesas Technology Corp.
* And Renesas Solutions Corp.,All Rights Reserved.
*
*********************************************************************/
/* Types used in this file. */
#include "typedefine.h"
/* Defines machine level functions used in this file */
#include <machine.h>
/* Defines MCU configuration functions used in this file */
#include <_h_c_lib.h>
/* Hardware definitions" */
#include "iodefine.h"
/* Defines the size of the stack which configured in this file */
#include "stacksct.h"
#define PSW_init 0x00010000
#define FPSW_init 0x00000100
extern void HardwareSetup( void );
#pragma section ResetPRG
#pragma entry PowerON_Reset_PC
/* It is ok to use stack variables here because "#pragma entry" is used, so the
stack is setup in the compiler generated prologue. */
void PowerON_Reset_PC(void)
{
volatile unsigned int i;
set_intb(__sectop("C$VECT"));
set_fpsw(FPSW_init);
/* MCU boots using the LOCO, so turn the speed up before setting up the C
run-time environment.
Clock Description Frequency
----------------------------------------
Input Clock Frequency............ 12 MHz
PLL frequency (x16).............. 192 MHz
Internal Clock Frequency......... 96 MHz
Peripheral Clock Frequency....... 48 MHz
USB Clock Frequency.............. 48 MHz
External Bus Clock Frequency..... 24 MHz */
/* Protect off. */
SYSTEM.PRCR.WORD = 0xA50B;
/* Uncomment if not using sub-clock */
//SYSTEM.SOSCCR.BYTE = 0x01; /* stop sub-clock */
SYSTEM.SOSCCR.BYTE = 0x00; /* Enable sub-clock for RTC */
/* Wait 131,072 cycles * 12 MHz = 10.9 ms */
SYSTEM.MOSCWTCR.BYTE = 0x0D;
/* PLL wait is 4,194,304 cycles (default) * 192 MHz (12 MHz * 16) = 20.1 ms*/
SYSTEM.PLLWTCR.BYTE = 0x04;
/* x16 @PLL */
SYSTEM.PLLCR.WORD = 0x0F00;
/* EXTAL ON */
SYSTEM.MOSCCR.BYTE = 0x00;
/* PLL ON */
SYSTEM.PLLCR2.BYTE = 0x00;
for(i = 0;i< 0x168;i++)
{
/* Wait over 12ms */
nop() ;
}
/* Setup system clocks
SCKCR - System Clock Control Register
b31:b28 FCK[3:0] 0x02 = Flash clock: PLL/4 = (192 / 4) = 48 MHz
b27:b24 ICK[3:0] 0x01 = System clock: PLL/2 = (192 / 2) = 96 MHz
b23 PSTOP1 0x00 = BCLK pin output is enabled
b19:b16 BCK[3:0] 0x03 = BCLK: PLL/8 = 24 MHz
b11:b8 PCKB[3:0] 0x02 = Peripheral clock B: PLL/4 = 48 MHz
*/
SYSTEM.SCKCR.LONG = 0x21031222; /* ICK=PLL/2,BCK,FCK,PCK=PLL/4 */
/* Setup IEBUS and USB clocks
SCKCR2 - System Clock Control Register 2
b7:b4 UCK[3:0] 0x03 = USB clock is PLL/4 = 48 MHz
b3:b0 IEBCK[3:0] 0x01 = IE Bus clock is PLL/2 = 96 MHz
*/
SYSTEM.SCKCR2.WORD = 0x0031;
/* ICLK, PCLKB, FCLK, BCLK, IECLK, and USBCLK all come from PLL circuit */
SYSTEM.SCKCR3.WORD = 0x0400;
/* Protect on. */
SYSTEM.PRCR.WORD = 0xA500;
/* Initialize C runtime environment */
_INITSCT();
/* Setup the hardware for the RSK. */
HardwareSetup();
nop();
/* Set Ubit and Ibit for PSW. */
set_psw(PSW_init);
/* Call the application code. */
main();
/* Main should not return. */
brk();
}

@ -1,28 +0,0 @@
#include <stddef.h>
#include <stdio.h>
#define HEAPSIZE 0x400
signed char *sbrk( size_t size );
union HEAP_TYPE
{
signed long dummy;
signed char heap[HEAPSIZE];
};
static union HEAP_TYPE heap_area;
/* End address allocated by sbrk */
static signed char *brk = ( signed char * ) &heap_area;
signed char *sbrk( size_t size )
{
signed char *p;
if( brk + size > heap_area.heap + HEAPSIZE )
{
p = ( signed char * ) - 1;
}
else
{
p = brk;
brk += size;
}
return p;
}

@ -1,64 +0,0 @@
/***********************************************************************/
/* */
/* FILE :vecttbl.c */
/* DATE :Wed, Aug 11, 2010 */
/* DESCRIPTION :Initialize of Vector Table */
/* CPU TYPE :Other */
/* */
/* This file is generated by Renesas Project Generator (Ver.4.50). */
/* NOTE:THIS IS A TYPICAL EXAMPLE. */
/* */
/***********************************************************************/
/*********************************************************************
*
* Device : RX/RX600
*
* File Name : vecttbl.c
*
* Abstract : Initialize of Vector Table.
*
* History : 1.00 (2009-08-07)
*
* NOTE : THIS IS A TYPICAL EXAMPLE.
*
* Copyright(c) 2009 Renesas Technology Corp.
* And Renesas Solutions Corp.,All Rights Reserved.
*
*********************************************************************/
#include "vect.h"
#pragma section C FIXEDVECT
void* const Fixed_Vectors[] = {
//;0xffffffd0 Exception(Supervisor Instruction)
(void*) Excep_SuperVisorInst,
//;0xffffffd4 Reserved
Dummy,
//;0xffffffd8 Reserved
Dummy,
//;0xffffffdc Exception(Undefined Instruction)
(void*) Excep_UndefinedInst,
//;0xffffffe0 Reserved
Dummy,
//;0xffffffe4 Exception(Floating Point)
(void*) Excep_FloatingPoint,
//;0xffffffe8 Reserved
Dummy,
//;0xffffffec Reserved
Dummy,
//;0xfffffff0 Reserved
Dummy,
//;0xfffffff4 Reserved
Dummy,
//;0xfffffff8 NMI
(void*) NonMaskableInterrupt,
//;0xfffffffc RESET
//;<<VECTOR DATA START (POWER ON RESET)>>
//;Power On Reset PC
PowerON_Reset_PC
//;<<VECTOR DATA END (POWER ON RESET)>>
};

@ -1,13 +0,0 @@
/***********************************************************************/
/* */
/* FILE :lowsrc.h */
/* DATE :Wed, Aug 11, 2010 */
/* DESCRIPTION :Header file of I/O Stream file */
/* CPU TYPE :Other */
/* */
/* This file is generated by Renesas Project Generator (Ver.4.50). */
/* NOTE:THIS IS A TYPICAL EXAMPLE. */
/* */
/***********************************************************************/
/*Number of I/O Stream*/
#define IOSTREAM 20

@ -1,107 +0,0 @@
/******************************************************************************
* DISCLAIMER
* Please refer to http://www.renesas.com/disclaimer
******************************************************************************
Copyright (C) 2011. Renesas Electronics Corp., All Rights Reserved.
*******************************************************************************
* File Name : rsksh7216.h
* Version : 1.00
* Description : RSK RX63N board specific settings
******************************************************************************
* History : DD.MM.YYYY Version Description
* : 12.09.2011 1.00 First Release
******************************************************************************/
#ifndef RSKRX63N_H
#define RSKRX63N_H
/******************************************************************************
Includes <System Includes> , "Project Includes"
******************************************************************************/
/******************************************************************************
Typedef definitions
******************************************************************************/
/******************************************************************************
Macro definitions
******************************************************************************/
/* System Clock Settings */
/* DETAIL THIS LATER !!!! */
#define XTAL_FREQUENCY (12000000L)
#define PLL_MUL (16)
#define PLL_INPUT_FREQ_DIV (1)
#define ICLK_DIV (2)
#define PCLK_DIV (4)
#define BCLK_DIV (4)
#define PLL_FREQUENCY (XTAL_FREQUENCY * (PLL_MUL / PLL_INPUT_FREQ_DIV))
#define ICLK_FREQUENCY (PLL_FREQUENCY / ICLK_DIV)
#define PCLK_FREQUENCY (PLL_FREQUENCY / PCLK_DIV)
#define BCLK_FREQUENCY (PLL_FREQUENCY / BCLK_DIV)
#define CMT0_CLK_SELECT (512)
/* General Values */
#define LED_ON (0)
#define LED_OFF (1)
#define SET_BIT_HIGH (1)
#define SET_BIT_LOW (0)
#define SET_BYTE_HIGH (0xFF)
#define SET_BYTE_LOW (0x00)
/* Define switches to be polled if not available as interrupts */
#define SW_ACTIVE FALSE
#define SW1 PORT0.DR.BIT.B0
#define SW2 PORT0.DR.BIT.B1
#define SW3 PORT0.DR.BIT.B7
#define SW1_DDR PORT0.DDR.BIT.B0
#define SW2_DDR PORT0.DDR.BIT.B1
#define SW3_DDR PORT0.DDR.BIT.B7
#define SW1_ICR PORT0.ICR.BIT.B0
#define SW2_ICR PORT0.ICR.BIT.B1
#define SW3_ICR PORT0.ICR.BIT.B7
/* LEDs */
#define LED0 PORT0.PODR.BIT.B3
#define LED1 PORT0.PODR.BIT.B5
#define LED2 PORT1.PODR.BIT.B0
#define LED3 PORT1.PODR.BIT.B1
//#define LED4 PORT6.DR.BIT.B0
//#define LED5 PORT7.DR.BIT.B3
#define LED0_PDR PORT0.PDR.BIT.B3
#define LED1_PDR PORT0.PDR.BIT.B5
#define LED2_PDR PORT1.PDR.BIT.B0
#define LED3_PDR PORT1.PDR.BIT.B1
//#define LED4_DDR PORT6.DDR.BIT.B0
//#define LED5_DDR PORT7.DDR.BIT.B3
/* 2x8 segment LCD */
#if 0
#define INCLUDE_LCD 1
#define LCD_RS PORTJ.PODR.BIT.B1
#define LCD_EN PORTJ.PODR.BIT.B3
#define LCD_DATA PORTH.PODR.BYTE
#define LCD_RS_DDR PORTJ.PDR.BIT.B1
#define LCD_EN_DDR PORTJ.PDR.BIT.B3
#define LCD_DATA_DDR PORTH.PDR.BYTE
#endif
/******************************************************************************
Variable Externs
******************************************************************************/
/******************************************************************************
Functions Prototypes
******************************************************************************/
/* RSKRX63N_H */
#endif

@ -1,13 +0,0 @@
/***********************************************************************/
/* */
/* FILE :stacksct.h */
/* DATE :Wed, Aug 11, 2010 */
/* DESCRIPTION :Setting of Stack area */
/* CPU TYPE :Other */
/* */
/* This file is generated by Renesas Project Generator (Ver.4.50). */
/* NOTE:THIS IS A TYPICAL EXAMPLE. */
/* */
/***********************************************************************/
#pragma stacksize su=0x300
#pragma stacksize si=0x100

@ -1,41 +0,0 @@
/***********************************************************************/
/* */
/* FILE :typedefine.h */
/* DATE :Wed, Aug 11, 2010 */
/* DESCRIPTION :Aliases of Integer Type */
/* CPU TYPE :Other */
/* */
/* This file is generated by Renesas Project Generator (Ver.4.50). */
/* NOTE:THIS IS A TYPICAL EXAMPLE. */
/* */
/***********************************************************************/
/*********************************************************************
*
* Device : RX
*
* File Name : typedefine.h
*
* Abstract : Aliases of Integer Type.
*
* History : 1.00 (2009-08-07)
*
* NOTE : THIS IS A TYPICAL EXAMPLE.
*
* Copyright(c) 2009 Renesas Technology Corp.
* And Renesas Solutions Corp.,All Rights Reserved.
*
*********************************************************************/
typedef signed char _SBYTE;
typedef unsigned char _UBYTE;
typedef signed short _SWORD;
typedef unsigned short _UWORD;
typedef signed int _SINT;
typedef unsigned int _UINT;
typedef signed long _SDWORD;
typedef unsigned long _UDWORD;
typedef signed long long _SQWORD;
typedef unsigned long long _UQWORD;

@ -1,60 +0,0 @@
/***********************************************************************/
/* */
/* FILE :vect.h */
/* DATE :Wed, Aug 11, 2010 */
/* DESCRIPTION :Definition of Vector */
/* CPU TYPE :Other */
/* */
/* This file is generated by Renesas Project Generator (Ver.4.50). */
/* NOTE:THIS IS A TYPICAL EXAMPLE. */
/* */
/***********************************************************************/
/*********************************************************************
*
* Device : RX/RX600
*
* File Name : vect.h
*
* Abstract : Definition of Vector.
*
* History : 1.00 (2009-08-07)
*
* NOTE : THIS IS A TYPICAL EXAMPLE.
*
* Copyright(c) 2009 Renesas Technology Corp.
* And Renesas Solutions Corp.,All Rights Reserved.
*
*********************************************************************/
// Exception(Supervisor Instruction)
#pragma interrupt (Excep_SuperVisorInst)
void Excep_SuperVisorInst(void);
// Exception(Undefined Instruction)
#pragma interrupt (Excep_UndefinedInst)
void Excep_UndefinedInst(void);
// Exception(Floating Point)
#pragma interrupt (Excep_FloatingPoint)
void Excep_FloatingPoint(void);
// NMI
#pragma interrupt (NonMaskableInterrupt)
void NonMaskableInterrupt(void);
// Dummy
#pragma interrupt (Dummy)
void Dummy(void);
// BRK
#pragma interrupt (Excep_BRK(vect=0))
void Excep_BRK(void);
//;<<VECTOR DATA START (POWER ON RESET)>>
//;Power On Reset PC
extern void PowerON_Reset_PC(void);
//;<<VECTOR DATA END (POWER ON RESET)>>

@ -0,0 +1,149 @@
/***********************************************************************************************************************
* DISCLAIMER
* This software is supplied by Renesas Electronics Corporation and is only intended for use with Renesas products. No
* other uses are authorized. This software is owned by Renesas Electronics Corporation and is protected under all
* applicable laws, including copyright laws.
* THIS SOFTWARE IS PROVIDED "AS IS" AND RENESAS MAKES NO WARRANTIES REGARDING
* THIS SOFTWARE, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. ALL SUCH WARRANTIES ARE EXPRESSLY DISCLAIMED. TO THE MAXIMUM
* EXTENT PERMITTED NOT PROHIBITED BY LAW, NEITHER RENESAS ELECTRONICS CORPORATION NOR ANY OF ITS AFFILIATED COMPANIES
* SHALL BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES FOR ANY REASON RELATED TO THIS
* SOFTWARE, EVEN IF RENESAS OR ITS AFFILIATES HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
* Renesas reserves the right, without notice, to make changes to this software and to discontinue the availability of
* this software. By using this software, you agree to the additional terms and conditions found by accessing the
* following link:
* http://www.renesas.com/disclaimer
*
* Copyright (C) 2012 Renesas Electronics Corporation. All rights reserved.
***********************************************************************************************************************/
/***********************************************************************************************************************
* File Name : r_bsp_config_reference.c
* Device(s) : RX63x
* Description : The file r_bsp_config.h is used to configure your BSP. r_bsp_config.h should be included
* somewhere in your package so that the r_bsp code has access to it. This file (r_bsp_config_reference.h)
* is just a reference file that the user can use to make their own r_bsp_config.h file.
************************************************************************************************************************
* History : DD.MM.YYYY Version Description
* : 13.03.2012 1.00 First Release
***********************************************************************************************************************/
#ifndef R_BSP_CONFIG_REF_HEADER_FILE
#define R_BSP_CONFIG_REF_HEADER_FILE
/***********************************************************************************************************************
Configuration Options
***********************************************************************************************************************/
/* The 'BSP_DECLARE_STACK' macro is checked so that the stack is only declared in one place (resetprg.c). Every time a
'#pragma stacksize' is encountered, the stack size is increased. This prevents multiplication of stack size. */
#if defined(BSP_DECLARE_STACK)
/* User Stack size in bytes. The Renesas RX toolchain sets the stack size using the #pragma stacksize directive. */
#pragma stacksize su=0x1000
/* Interrupt Stack size in bytes. The Renesas RX toolchain sets the stack size using the #pragma stacksize directive. */
#pragma stacksize si=0x400
#endif
/* Heap size in bytes. */
#define HEAP_BYTES (0x400)
/* After reset MCU will operate in Supervisor mode. To switch to User mode, set this macro to '1'. For more information
on the differences between these 2 modes see the CPU >> Processor Mode section of your MCU's hardware manual.
0 = Stay in Supervisor mode.
1 = Switch to User mode.
*/
#define RUN_IN_USER_MODE (0)
/* To get into User Boot Mode the user must control some pins on the MCU and also set some values in ROM. These values
in ROM are described in the Option-Setting Memory section of the hardware manual. This macro sets these values so
that User Boot Mode can be used. The user is still responsible for setting the MCU pins appropriately.
0 = Single-Chip or USB Boot Mode
1 = User Boot Mode
*/
#define USER_BOOT_ENABLE (0)
/* Set your desired ID code. NOTE, leave at the default (all 0xFF's) if you do not wish to use an ID code. If you set
this value and program it into the MCU then you will need to remember the ID code because the debugger will ask for
it when trying to connect. Note that the E1/E20 will ignore the ID code when programming the MCU during debugging.
If you set this value and then forget it then you can clear the ID code by connecting up in serial boot mode using
FDT. The ID Code is 16 bytes long. The macro below define the ID Code in 4-byte sections. */
/* Lowest 4-byte section, address 0xFFFFFFA0. From MSB to LSB: Control Code, ID code 1, ID code 2, ID code 3. */
#define ID_CODE_LONG_1 (0xFFFFFFFF)
/* 2nd ID Code section, address 0xFFFFFFA4. From MSB to LSB: ID code 4, ID code 5, ID code 6, ID code 7. */
#define ID_CODE_LONG_2 (0xFFFFFFFF)
/* 3rd ID Code section, address 0xFFFFFFA8. From MSB to LSB: ID code 8, ID code 9, ID code 10, ID code 11. */
#define ID_CODE_LONG_3 (0xFFFFFFFF)
/* 4th ID Code section, address 0xFFFFFFAC. From MSB to LSB: ID code 12, ID code 13, ID code 14, ID code 15. */
#define ID_CODE_LONG_4 (0xFFFFFFFF)
/* This macro lets other modules no if a RTOS is being used.
0 = RTOS is not used.
1 = RTOS is used.
*/
#define RTOS_USED (0)
/* Clock source select (CKSEL).
0 = Low Speed On-Chip Oscillator (LOCO)
1 = High Speed On-Chip Oscillator (HOCO)
2 = Main Clock Oscillator
3 = Sub-Clock Oscillator
4 = PLL Circuit
*/
#define CLOCK_SOURCE (4)
/* Clock configuration options.
The input clock frequency is specified and then the system clocks are set by specifying the multipliers used. The
multiplier settings are used to set the clock registers in resetprg.c. If a 12MHz clock is used and the
ICLK is 96MHz, PCLKA is 48MHz, PCLKB is 48MHz, FCLK is 48MHz, USB Clock is 48MHz, and BCLK is 12MHz then the
settings would be:
XTAL_HZ = 12000000
PLL_DIV = 1 (no division)
PLL_MUL = 16 (12MHz x 16 = 192MHz)
ICK_DIV = 2 : System Clock (ICLK) = (((XTAL_HZ/PLL_DIV) * PLL_MUL) / ICK_DIV) = 96MHz
PCKA_DIV = 4 : Peripheral Clock A (PCLKA) = (((XTAL_HZ/PLL_DIV) * PLL_MUL) / PCKA_DIV) = 48MHz
PCKB_DIV = 4 : Peripheral Clock B (PCLKB) = (((XTAL_HZ/PLL_DIV) * PLL_MUL) / PCKB_DIV) = 48MHz
FCK_DIV = 4 : Flash IF Clock (FCLK) = (((XTAL_HZ/PLL_DIV) * PLL_MUL) / FCK_DIV) = 48MHz
BCK_DIV = 8 : External Bus Clock (BCK) = (((XTAL_HZ/PLL_DIV) * PLL_MUL) / BCK_DIV) = 24MHz
UCK_DIV = 4 : USB Clock (UCLK) = (((XTAL_HZ/PLL_DIV) * PLL_MUL) / UCK_DIV) = 48MHz
*/
/* XTAL - Input clock frequency in Hz */
#define XTAL_HZ (12000000)
/* PLL Input Frequency Divider Select (PLIDIV).
Available divisors = /1 (no division), /2, /4
*/
#define PLL_DIV (1)
/* PLL Frequency Multiplication Factor Select (STC).
Available multipliers = x8, x10, x12, x16, x20, x24, x25, x50
*/
#define PLL_MUL (16)
/* System Clock Divider (ICK).
Available divisors = /1 (no division), /2, /4, /8, /16, /32, /64
*/
#define ICK_DIV (2)
/* Peripheral Module Clock A Divider (PCKA).
Available divisors = /1 (no division), /2, /4, /8, /16, /32, /64
*/
#define PCKA_DIV (4)
/* Peripheral Module Clock B Divider (PCKB).
Available divisors = /1 (no division), /2, /4, /8, /16, /32, /64
*/
#define PCKB_DIV (4)
/* External Bus Clock Divider (BCK).
Available divisors = /1 (no division), /2, /4, /8, /16, /32, /64
*/
#define BCK_DIV (8)
/* Flash IF Clock Divider (FCK).
Available divisors = /1 (no division), /2, /4, /8, /16, /32, /64
*/
#define FCK_DIV (4)
/* IEBUS Clock Divider Select.
Available divisors = /1 (no division), /2, /4, /6, /8, /16, /32, /64
*/
#define IEBCK_DIV (8)
/* USB Clock Divider Select.
Available divisors = /3, /4
*/
#define UCK_DIV (4)
#endif /* R_BSP_CONFIG_REF_HEADER_FILE */
Loading…
Cancel
Save