rel_1.6.0 init

This commit is contained in:
guocheng.kgc 2020-06-18 20:06:52 +08:00 committed by shengdong.dsd
commit 27b3e2883d
19359 changed files with 8093121 additions and 0 deletions

View file

@ -0,0 +1,15 @@
/*
* Copyright (C) 2015-2017 Alibaba Group Holding Limited
*/
#include <k_api.h>
#include <stdio.h>
void soc_err_proc(kstat_t err)
{
(void)err;
while(1);
}
krhino_err_proc_t g_err_proc = soc_err_proc;

View file

@ -0,0 +1,199 @@
/*
*********************************************************************************************************
* BOARD SUPPORT PACKAGE
*
* (c) Copyright 2014; Micrium, Inc.; Weston, FL
*
* All rights reserved. Protected by international copyright laws.
*
* BSP is provided in source form to registered licensees ONLY. It is
* illegal to distribute this source code to any third party unless you receive
* written permission by an authorized Micrium representative. Knowledge of
* the source code may NOT be used to develop a similar product.
*
* Please help us continue to provide the Embedded community with the finest
* software available. Your honesty is greatly appreciated.
*
* You can contact us at www.micrium.com.
*********************************************************************************************************
*/
/*
*********************************************************************************************************
* BOARD SUPPORT PACKAGE (BSP)
*
* RENESAS RX64M
* on the
* RSKRX64M DEVELOPMENT BOARD
*
* Filename : bsp.h
* Version : V1.00
* Programmer(s) : JPB
* JJL
* DC
*********************************************************************************************************
*/
/*
*********************************************************************************************************
* INCLUDES
*********************************************************************************************************
*/
#include "bsp_cfg.h"
#include <bsp_sys.h>
#if BSP_CFG_LED_EN > 0u
#include <bsp_led.h>
#endif
#if BSP_CFG_CAN_EN > 0u
#include <can_bsp.h>
#endif
#if BSP_CFG_CAN_OPEN_EN > 0u
#endif
#if BSP_CFG_FS_EN > 0u
#endif
#if BSP_CFG_GRAPH_LCD_EN > 0u
#include <bsp_glcd.h>
#endif
#if BSP_CFG_GUI_EN > 0u
#endif
#if BSP_CFG_MBM_EN > 0u
#endif
#if BSP_CFG_MBS_EN > 0u
#endif
#if BSP_CFG_NET_EN > 0u
#endif
#if BSP_CFG_OS2_EN > 0u
#endif
#if BSP_CFG_OS3_EN > 0u
#endif
#if BSP_CFG_USBD_EN > 0u
#endif
#if BSP_CFG_USBH_EN > 0u
#endif
#if BSP_CFG_MISC_EN > 0u
#include <bsp_misc.h>
#endif
#include <iodefine.h>
extern void OS_BSP_TickInit (void);
/*
*********************************************************************************************************
* BSP_Init()
*
* Description : This function should be called by the application code before using any functions in this
* module.
*
* Arguments : none
*
* Caller(s) : none.
*
* Return(s) : none.
*
* Note(s) : none.
*********************************************************************************************************
*/
void BSP_Init (void)
{
BSP_SysInit(); /* Initialize System Services, Clocks, etc. */
OS_BSP_TickInit(); /* Init uC/OS-xx periodic time source */
#if BSP_CFG_LED_EN > 0u
BSP_LED_Init(); /* Initialize LEDs */
#endif
#if BSP_CFG_GRAPH_LCD_EN > 0u
BSP_GraphLCD_Init(); /* Initialize the on-board graphics LCD display */
#endif
#if BSP_CFG_CAN_EN > 0u
#endif
#if BSP_CFG_CAN_OPEN_EN > 0u
#endif
#if BSP_CFG_FS_EN > 0u
#endif
#if BSP_CFG_GUI_EN > 0u
#endif
#if BSP_CFG_MBM_EN > 0u
#endif
#if BSP_CFG_MBS_EN > 0u
#endif
#if BSP_CFG_NET_EN > 0u
#endif
#if BSP_CFG_OS2_EN > 0u
#endif
#if BSP_CFG_OS3_EN > 0u
#endif
#if BSP_CFG_USBD_EN > 0u
#endif
#if BSP_CFG_USBH_EN > 0u
#endif
#if BSP_CFG_MISC_EN > 0u
BSP_MiscInit(); /* Initialize Miscellaneous Services */
#endif
}
void BSP_IntVectSet (int16_t int_id,void* isr);
void cpu_switchint_handle(void);
void os_pre_init(void);
void BSP_Pre_Init(void)
{
set_ipl(IPL_BOUNDARY);
BSP_IntVectSet(27u, cpu_switchint_handle); /* Setup kernel context switch */
os_pre_init();
}

View file

@ -0,0 +1,83 @@
/*
*********************************************************************************************************
* MICRIUM BOARD SUPPORT SUPPORT
*
* (c) Copyright 2003-2014; Micrium, Inc.; Weston, FL
*
* All rights reserved. Protected by international copyright laws.
* Knowledge of the source code may NOT be used to develop a similar product.
* Please help us continue to provide the Embedded community with the finest
* software available. Your honesty is greatly appreciated.
*********************************************************************************************************
*/
/*
*********************************************************************************************************
*
* BOARD SUPPORT PACKAGE (BSP)
*
* RENESAS RX64M
* on the
* RSKRX64M DEVELOPMENT BOARD
*
* Filename : bsp.h
* Version : V1.00
* Programmer(s) : CM
* DC
*********************************************************************************************************
*/
/*
*********************************************************************************************************
* MODULE
*********************************************************************************************************
*/
#ifndef BSP_PRESENT
#define BSP_PRESENT
#include "inttypes.h"
#include "k_api.h"
/*
*********************************************************************************************************
* EXTERNS
*********************************************************************************************************
*/
#ifdef BSP_MODULE
#define BSP_EXT
#else
#define BSP_EXT extern
#endif
#define CPU_INT_GLOBAL_EN(void) setpsw_i()
#define CPU_INT_VECT_TBL_BASE_SET(p_vect_tbl) set_intb((void *)p_vect_tbl)
#define CPU_ISR void
typedef void (*CPU_FNCT_VOID)(void);
/*
*********************************************************************************************************
* GLOBAL VARIABLES
*********************************************************************************************************
*/
/*
*********************************************************************************************************
* FUNCTION PROTOTYPES
*********************************************************************************************************
*/
void BSP_Init (void);
/*
*********************************************************************************************************
* MODULE END
*********************************************************************************************************
*/
#endif

View file

@ -0,0 +1,87 @@
/*
*********************************************************************************************************
*
* BOARD SUPPORT PACKAGE
*
* (c) Copyright 2014, Micrium, Weston, FL
* All Rights Reserved
*
* Filename : bsp_cfg.h
* Version : V1.00
* Programmer(s) : JJL
* JM
*********************************************************************************************************
*/
#ifndef BSP_CFG_H_
#define BSP_CFG_H_
/*
*********************************************************************************************************
* MODULES ENABLE
*********************************************************************************************************
*/
#define BSP_CFG_CAN_EN 0 /* Enable (1) or Disable (0) os/CAN */
#define BSP_CFG_CAN_OPEN_EN 0 /* Enable (1) or Disable (0) os/CANopen */
#define BSP_CFG_FS_EN 0 /* Enable (1) or Disable (0) os/FS */
#define BSP_CFG_GUI_EN 0 /* Enable (1) or Disable (0) os/GUI */
#define BSP_CFG_MBM_EN 0 /* Enable (1) or Disable (0) os/Modbus-Master */
#define BSP_CFG_MBS_EN 0 /* Enable (1) or Disable (0) os/Modbus-Slave */
#define BSP_CFG_NET_EN 0 /* Enable (1) or Disable (0) os/TCP-IP */
#define BSP_CFG_OS2_EN 0 /* Enable (1) or Disable (0) os/OS-II */
#define BSP_CFG_OS3_EN 1 /* Enable (1) or Disable (0) os/OS-III */
#define BSP_CFG_USBD_EN 0 /* Enable (1) or Disable (0) os/USB-D */
#define BSP_CFG_USBH_EN 0 /* Enable (1) or Disable (0) os/USB-H */
/*
*********************************************************************************************************
* INTERRUPT VECTOR TABLE
*********************************************************************************************************
*/
#define BSP_CFG_INT_VECT_TBL_RAM_EN 1 /* Enable (1) vector table in RAM or in ROM (0) */
#define BSP_CFG_INT_VECT_TBL_SIZE 256 /* Max. number of entries in the interrupt vector tbl */
/*
*********************************************************************************************************
* CLOCK MANAGEMENT
*********************************************************************************************************
*/
#define BSP_CFG_SYS_EXT_CLK_FREQ 12000000uL
/*
*********************************************************************************************************
* BOARD SPECIFIC BSPs
*********************************************************************************************************
*/
#define BSP_CFG_SER_EN 0 /* Enable (1) or Disable (0) Serial port BSP */
#define BSP_CFG_LED_EN 1 /* Enable (1) or Disable (0) LEDs */
#define BSP_CFG_GRAPH_LCD_EN 0 /* Enable (1) or Disable (0) Graphical LCD display */
#define BSP_CFG_MISC_EN 0 /* Enable (1) or Disable (0) Miscellaneous */
#define BSP_CFG_I2C_EN 0 /* Enable (1) or Disable (0) i2c */
/*
*********************************************************************************************************
* INTERRUPT PRIORITY LEVELS
*********************************************************************************************************
*/
#define BSP_CFG_OS_TICK_IPL 3
#if BSP_CFG_SER_EN > 0
#define BSP_CFG_SER_IPL 4
#endif
#endif

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,301 @@
/*
*********************************************************************************************************
*
* BOARD SUPPORT PACKAGE
*
* Renesas RX64M
* on the
* RSKRX64M Evaluation Board
*
* (c) Copyright 2014, Micrium, Weston, FL
* All Rights Reserved
*
* Filename : bsp_int_vect_tbl.h
* Version : V1.00
* Programmer(s) : JFD
* AL
* CM
* DC
*********************************************************************************************************
*/
#ifndef BSP_INT_VECT_TBL_H_
#define BSP_INT_VECT_TBL_H_
/*
*********************************************************************************************************
* FUNCTION PROTOTYPES
*********************************************************************************************************
*/
void BSP_IntVectSet (uint16_t int_id,
CPU_FNCT_VOID isr);
void BSP_IntVectTblInit (void);
/*
*********************************************************************************************************
* FUNCTION PROTOTYPES
* (STUB ISR HANDLERS)
*********************************************************************************************************
*/
void BSP_IntHandler_000 (void);
void BSP_IntHandler_001 (void);
void BSP_IntHandler_002 (void);
void BSP_IntHandler_003 (void);
void BSP_IntHandler_004 (void);
void BSP_IntHandler_005 (void);
void BSP_IntHandler_006 (void);
void BSP_IntHandler_007 (void);
void BSP_IntHandler_008 (void);
void BSP_IntHandler_009 (void);
void BSP_IntHandler_010 (void);
void BSP_IntHandler_011 (void);
void BSP_IntHandler_012 (void);
void BSP_IntHandler_013 (void);
void BSP_IntHandler_014 (void);
void BSP_IntHandler_015 (void);
void BSP_IntHandler_016 (void);
void BSP_IntHandler_017 (void);
void BSP_IntHandler_018 (void);
void BSP_IntHandler_019 (void);
void BSP_IntHandler_020 (void);
void BSP_IntHandler_021 (void);
void BSP_IntHandler_022 (void);
void BSP_IntHandler_023 (void);
void BSP_IntHandler_024 (void);
void BSP_IntHandler_025 (void);
void BSP_IntHandler_026 (void);
void BSP_IntHandler_027 (void);
void BSP_IntHandler_028 (void);
void BSP_IntHandler_029 (void);
void BSP_IntHandler_030 (void);
void BSP_IntHandler_031 (void);
void BSP_IntHandler_032 (void);
void BSP_IntHandler_033 (void);
void BSP_IntHandler_034 (void);
void BSP_IntHandler_035 (void);
void BSP_IntHandler_036 (void);
void BSP_IntHandler_037 (void);
void BSP_IntHandler_038 (void);
void BSP_IntHandler_039 (void);
void BSP_IntHandler_040 (void);
void BSP_IntHandler_041 (void);
void BSP_IntHandler_042 (void);
void BSP_IntHandler_043 (void);
void BSP_IntHandler_044 (void);
void BSP_IntHandler_045 (void);
void BSP_IntHandler_046 (void);
void BSP_IntHandler_047 (void);
void BSP_IntHandler_048 (void);
void BSP_IntHandler_049 (void);
void BSP_IntHandler_050 (void);
void BSP_IntHandler_051 (void);
void BSP_IntHandler_052 (void);
void BSP_IntHandler_053 (void);
void BSP_IntHandler_054 (void);
void BSP_IntHandler_055 (void);
void BSP_IntHandler_056 (void);
void BSP_IntHandler_057 (void);
void BSP_IntHandler_058 (void);
void BSP_IntHandler_059 (void);
void BSP_IntHandler_060 (void);
void BSP_IntHandler_061 (void);
void BSP_IntHandler_062 (void);
void BSP_IntHandler_063 (void);
void BSP_IntHandler_064 (void);
void BSP_IntHandler_065 (void);
void BSP_IntHandler_066 (void);
void BSP_IntHandler_067 (void);
void BSP_IntHandler_068 (void);
void BSP_IntHandler_069 (void);
void BSP_IntHandler_070 (void);
void BSP_IntHandler_071 (void);
void BSP_IntHandler_072 (void);
void BSP_IntHandler_073 (void);
void BSP_IntHandler_074 (void);
void BSP_IntHandler_075 (void);
void BSP_IntHandler_076 (void);
void BSP_IntHandler_077 (void);
void BSP_IntHandler_078 (void);
void BSP_IntHandler_079 (void);
void BSP_IntHandler_080 (void);
void BSP_IntHandler_081 (void);
void BSP_IntHandler_082 (void);
void BSP_IntHandler_083 (void);
void BSP_IntHandler_084 (void);
void BSP_IntHandler_085 (void);
void BSP_IntHandler_086 (void);
void BSP_IntHandler_087 (void);
void BSP_IntHandler_088 (void);
void BSP_IntHandler_089 (void);
void BSP_IntHandler_090 (void);
void BSP_IntHandler_091 (void);
void BSP_IntHandler_092 (void);
void BSP_IntHandler_093 (void);
void BSP_IntHandler_094 (void);
void BSP_IntHandler_095 (void);
void BSP_IntHandler_096 (void);
void BSP_IntHandler_097 (void);
void BSP_IntHandler_098 (void);
void BSP_IntHandler_099 (void);
void BSP_IntHandler_100 (void);
void BSP_IntHandler_101 (void);
void BSP_IntHandler_102 (void);
void BSP_IntHandler_103 (void);
void BSP_IntHandler_104 (void);
void BSP_IntHandler_105 (void);
void BSP_IntHandler_106 (void);
void BSP_IntHandler_107 (void);
void BSP_IntHandler_108 (void);
void BSP_IntHandler_109 (void);
void BSP_IntHandler_110 (void);
void BSP_IntHandler_111 (void);
void BSP_IntHandler_112 (void);
void BSP_IntHandler_113 (void);
void BSP_IntHandler_114 (void);
void BSP_IntHandler_115 (void);
void BSP_IntHandler_116 (void);
void BSP_IntHandler_117 (void);
void BSP_IntHandler_118 (void);
void BSP_IntHandler_119 (void);
void BSP_IntHandler_120 (void);
void BSP_IntHandler_121 (void);
void BSP_IntHandler_122 (void);
void BSP_IntHandler_123 (void);
void BSP_IntHandler_124 (void);
void BSP_IntHandler_125 (void);
void BSP_IntHandler_126 (void);
void BSP_IntHandler_127 (void);
void BSP_IntHandler_128 (void);
void BSP_IntHandler_129 (void);
void BSP_IntHandler_130 (void);
void BSP_IntHandler_131 (void);
void BSP_IntHandler_132 (void);
void BSP_IntHandler_133 (void);
void BSP_IntHandler_134 (void);
void BSP_IntHandler_135 (void);
void BSP_IntHandler_136 (void);
void BSP_IntHandler_137 (void);
void BSP_IntHandler_138 (void);
void BSP_IntHandler_139 (void);
void BSP_IntHandler_140 (void);
void BSP_IntHandler_141 (void);
void BSP_IntHandler_142 (void);
void BSP_IntHandler_143 (void);
void BSP_IntHandler_144 (void);
void BSP_IntHandler_145 (void);
void BSP_IntHandler_146 (void);
void BSP_IntHandler_147 (void);
void BSP_IntHandler_148 (void);
void BSP_IntHandler_149 (void);
void BSP_IntHandler_150 (void);
void BSP_IntHandler_151 (void);
void BSP_IntHandler_152 (void);
void BSP_IntHandler_153 (void);
void BSP_IntHandler_154 (void);
void BSP_IntHandler_155 (void);
void BSP_IntHandler_156 (void);
void BSP_IntHandler_157 (void);
void BSP_IntHandler_158 (void);
void BSP_IntHandler_159 (void);
void BSP_IntHandler_160 (void);
void BSP_IntHandler_161 (void);
void BSP_IntHandler_162 (void);
void BSP_IntHandler_163 (void);
void BSP_IntHandler_164 (void);
void BSP_IntHandler_165 (void);
void BSP_IntHandler_166 (void);
void BSP_IntHandler_167 (void);
void BSP_IntHandler_168 (void);
void BSP_IntHandler_169 (void);
void BSP_IntHandler_170 (void);
void BSP_IntHandler_171 (void);
void BSP_IntHandler_172 (void);
void BSP_IntHandler_173 (void);
void BSP_IntHandler_174 (void);
void BSP_IntHandler_175 (void);
void BSP_IntHandler_176 (void);
void BSP_IntHandler_177 (void);
void BSP_IntHandler_178 (void);
void BSP_IntHandler_179 (void);
void BSP_IntHandler_180 (void);
void BSP_IntHandler_181 (void);
void BSP_IntHandler_182 (void);
void BSP_IntHandler_183 (void);
void BSP_IntHandler_184 (void);
void BSP_IntHandler_185 (void);
void BSP_IntHandler_186 (void);
void BSP_IntHandler_187 (void);
void BSP_IntHandler_188 (void);
void BSP_IntHandler_189 (void);
void BSP_IntHandler_190 (void);
void BSP_IntHandler_191 (void);
void BSP_IntHandler_192 (void);
void BSP_IntHandler_193 (void);
void BSP_IntHandler_194 (void);
void BSP_IntHandler_195 (void);
void BSP_IntHandler_196 (void);
void BSP_IntHandler_197 (void);
void BSP_IntHandler_198 (void);
void BSP_IntHandler_199 (void);
void BSP_IntHandler_200 (void);
void BSP_IntHandler_201 (void);
void BSP_IntHandler_202 (void);
void BSP_IntHandler_203 (void);
void BSP_IntHandler_204 (void);
void BSP_IntHandler_205 (void);
void BSP_IntHandler_206 (void);
void BSP_IntHandler_207 (void);
void BSP_IntHandler_208 (void);
void BSP_IntHandler_209 (void);
void BSP_IntHandler_210 (void);
void BSP_IntHandler_211 (void);
void BSP_IntHandler_212 (void);
void BSP_IntHandler_213 (void);
void BSP_IntHandler_214 (void);
void BSP_IntHandler_215 (void);
void BSP_IntHandler_216 (void);
void BSP_IntHandler_217 (void);
void BSP_IntHandler_218 (void);
void BSP_IntHandler_219 (void);
void BSP_IntHandler_220 (void);
void BSP_IntHandler_221 (void);
void BSP_IntHandler_222 (void);
void BSP_IntHandler_223 (void);
void BSP_IntHandler_224 (void);
void BSP_IntHandler_225 (void);
void BSP_IntHandler_226 (void);
void BSP_IntHandler_227 (void);
void BSP_IntHandler_228 (void);
void BSP_IntHandler_229 (void);
void BSP_IntHandler_230 (void);
void BSP_IntHandler_231 (void);
void BSP_IntHandler_232 (void);
void BSP_IntHandler_233 (void);
void BSP_IntHandler_234 (void);
void BSP_IntHandler_235 (void);
void BSP_IntHandler_236 (void);
void BSP_IntHandler_237 (void);
void BSP_IntHandler_238 (void);
void BSP_IntHandler_239 (void);
void BSP_IntHandler_240 (void);
void BSP_IntHandler_241 (void);
void BSP_IntHandler_242 (void);
void BSP_IntHandler_243 (void);
void BSP_IntHandler_244 (void);
void BSP_IntHandler_245 (void);
void BSP_IntHandler_246 (void);
void BSP_IntHandler_247 (void);
void BSP_IntHandler_248 (void);
void BSP_IntHandler_249 (void);
void BSP_IntHandler_250 (void);
void BSP_IntHandler_251 (void);
void BSP_IntHandler_252 (void);
void BSP_IntHandler_253 (void);
void BSP_IntHandler_254 (void);
void BSP_IntHandler_255 (void);
#endif

View file

@ -0,0 +1,230 @@
/*
*********************************************************************************************************
* BOARD SUPPORT PACKAGE
*
* (c) Copyright 2014; Micrium, Inc.; Weston, FL
*
* All rights reserved. Protected by international copyright laws.
*
* BSP is provided in source form to registered licensees ONLY. It is
* illegal to distribute this source code to any third party unless you receive
* written permission by an authorized Micrium representative. Knowledge of
* the source code may NOT be used to develop a similar product.
*
* Please help us continue to provide the Embedded community with the finest
* software available. Your honesty is greatly appreciated.
*
* You can contact us at www.micrium.com.
*********************************************************************************************************
*/
/*
*********************************************************************************************************
* Filename : bsp_led.c
* Version : V1.00
* Programmer(s) : JPB
* AA
* JJL
* JM
*********************************************************************************************************
*/
/*
*********************************************************************************************************
* INCLUDES
*********************************************************************************************************
*/
#include <bsp_cfg.h>
#if BSP_CFG_LED_EN > 0u
#include <lib_def.h>
#include <bsp_led.h>
#include <iodefine.h>
/*
*********************************************************************************************************
* BSP_LED_Init()
*
* Description : This function is used to initialize the LEDs on the board.
*
* Arguments : none
*
* Caller(s) : none.
*
* Return(s) : none.
*
* Note(s) : none.
*********************************************************************************************************
*/
void BSP_LED_Init (void)
{
PORT7.PDR.BIT.B0 = 1u; /* Select port function. */
// PORT0.PDR.BIT.B5 = 1u;
// PORT2.PDR.BIT.B6 = 1u;
// PORT2.PDR.BIT.B7 = 1u;
BSP_LED_Off(0u); /* Turn OFF all LEDs. */
}
/*
*********************************************************************************************************
* BSP_LED_On()
*
* Description : This function is used to control any or all the LEDs on the board.
*
* Arguments : led Is the number of the LED to control
* 0 indicates that you want ALL the LEDs to be ON
* 1 turns ON LED1 on the board
* .
* .
* 3 turns ON LED3 on the board
*
* Caller(s) : none.
*
* Return(s) : none.
*
* Note(s) : none.
*********************************************************************************************************
*/
void BSP_LED_On (uint8_t led)
{
switch (led) {
case 0u:
BSP_LED0 = DEF_OFF;
BSP_LED1 = DEF_OFF;
BSP_LED2 = DEF_OFF;
BSP_LED3 = DEF_OFF;
break;
case 1u:
BSP_LED0 = DEF_OFF;
break;
case 2u:
BSP_LED1 = DEF_OFF;
break;
case 3u:
BSP_LED2 = DEF_OFF;
break;
case 4u:
BSP_LED3 = DEF_OFF;
break;
default:
break;
}
}
/*
*********************************************************************************************************
* BSP_LED_Off()
*
* Description : This function is used to control any or all the LEDs on the board.
*
* Arguments : led Is the number of the LED to turn OFF
* 0 indicates that you want ALL the LEDs to be OFF
* 1 turns OFF LED1 on the board
* .
* .
* 3 turns OFF LED3 on the board
*
* Caller(s) : none.
*
* Return(s) : none.
*
* Note(s) : none.
*********************************************************************************************************
*/
void BSP_LED_Off (uint8_t led)
{
switch (led) {
case 0u:
BSP_LED0 = DEF_ON;
BSP_LED1 = DEF_ON;
BSP_LED2 = DEF_ON;
BSP_LED3 = DEF_ON;
break;
case 1u:
BSP_LED0 = DEF_ON;
break;
case 2u:
BSP_LED1 = DEF_ON;
break;
case 3u:
BSP_LED2 = DEF_ON;
break;
case 4u:
BSP_LED3 = DEF_ON;
break;
default:
break;
}
}
/*
*********************************************************************************************************
* BSP_LED_Toggle()
*
* Description : This function is used to toggle the state of any or all the LEDs on the board.
*
* Arguments : led Is the number of the LED to toggle
* 0 indicates that you want ALL the LEDs to toggle
* 1 Toggle LED1 on the board
* .
* .
* 3 Toggle LED3 on the board
*
* Caller(s) : none.
*
* Return(s) : none.
*
* Note(s) : none.
*********************************************************************************************************
*/
void BSP_LED_Toggle (uint8_t led)
{
switch (led) {
case 0u:
BSP_LED0 = ~BSP_LED0;
BSP_LED1 = ~BSP_LED1;
BSP_LED2 = ~BSP_LED2;
BSP_LED3 = ~BSP_LED3;
break;
case 1u:
BSP_LED0 = ~BSP_LED0;
break;
case 2u:
BSP_LED1 = ~BSP_LED1;
break;
case 3u:
BSP_LED2 = ~BSP_LED2;
break;
case 4u:
BSP_LED3 = ~BSP_LED3;
break;
default:
break;
}
}
#endif

View file

@ -0,0 +1,56 @@
/*
*********************************************************************************************************
* BOARD SUPPORT PACKAGE
*
* (c) Copyright 2014; Micrium, Inc.; Weston, FL
*
* All rights reserved. Protected by international copyright laws.
*
* BSP is provided in source form to registered licensees ONLY. It is
* illegal to distribute this source code to any third party unless you receive
* written permission by an authorized Micrium representative. Knowledge of
* the source code may NOT be used to develop a similar product.
*
* Please help us continue to provide the Embedded community with the finest
* software available. Your honesty is greatly appreciated.
*
* You can contact us at www.micrium.com.
*********************************************************************************************************
*/
/*
*********************************************************************************************************
* Filename : bsp_led.h
* Version : V1.00
* Programmer(s) : DC
*********************************************************************************************************
*/
#ifndef BSP_LED_H_
#define BSP_LED_H_
#include "bsp.h"
/*
*********************************************************************************************************
* CONSTANTS
*********************************************************************************************************
*/
#define BSP_LED0 PORT7.PODR.BIT.B0
#define BSP_LED1 PORT0.PODR.BIT.B5
#define BSP_LED2 PORT2.PODR.BIT.B6
#define BSP_LED3 PORT2.PODR.BIT.B7
/*
*********************************************************************************************************
* PROTOTYPES
*********************************************************************************************************
*/
void BSP_LED_Init (void);
void BSP_LED_On (uint8_t led);
void BSP_LED_Off (uint8_t led);
void BSP_LED_Toggle (uint8_t led);
#endif

View file

@ -0,0 +1,287 @@
/*
*********************************************************************************************************
* MICRIUM BOARD SUPPORT SUPPORT
*
* (c) Copyright 2003-2014; Micrium, Inc.; Weston, FL
*
* All rights reserved. Protected by international copyright laws.
* Knowledge of the source code may NOT be used to develop a similar product.
* Please help us continue to provide the Embedded community with the finest
* software available. Your honesty is greatly appreciated.
*********************************************************************************************************
*/
/*
*********************************************************************************************************
*
* BOARD SUPPORT PACKAGE (BSP)
*
* RENESAS RX64M
* on the
* RSKRX64M DEVELOPMENT BOARD
*
* Filename : bsp.c
* Version : V1.00
* Programmer(s) : DC
*********************************************************************************************************
*/
/*
*********************************************************************************************************
* INCLUDE FILES
*********************************************************************************************************
*/
/*#include <lib_def.h>*/
#include <bsp_cfg.h>
#include <iodefine.h>
#if BSP_CFG_LED_EN > 0u
#include <bsp_led.h>
#endif
/*
*********************************************************************************************************
* LOCAL VARIABLES
*********************************************************************************************************
*/
#define BSP_SYS_MOSCWTCR_WAIT_TIME 0x52u /* Main Clock Oscillator Wait Time */
#define BSP_SYS_TIMEOUT_VAL 0xFFFFu
/*
*********************************************************************************************************
* REGISTER DEFINES
*********************************************************************************************************
*/
/* --------------- PLL CONTROL REGISTER --------------- */
#define BSP_SYS_PLLCR_PLLDIV_1 0x00u
#define BSP_SYS_PLLCR_PLLDIV_1_2 0x01u
#define BSP_SYS_PLLCR_PLLDIV_1_3 0x10u
#define BSP_SYS_PLLCR_STC_x10 0x13u
#define BSP_SYS_PLLCR_STC_x10_5 0x14u
#define BSP_SYS_PLLCR_STC_x11 0x15u
#define BSP_SYS_PLLCR_STC_x11_5 0x16u
#define BSP_SYS_PLLCR_STC_x12 0x17u
#define BSP_SYS_PLLCR_STC_x12_5 0x18u
#define BSP_SYS_PLLCR_STC_x13 0x19u
#define BSP_SYS_PLLCR_STC_x13_5 0x1Au
#define BSP_SYS_PLLCR_STC_x14 0x1Bu
#define BSP_SYS_PLLCR_STC_x14_5 0x1Cu
#define BSP_SYS_PLLCR_STC_x15 0x1Du
#define BSP_SYS_PLLCR_STC_x15_5 0x1Eu
#define BSP_SYS_PLLCR_STC_x16 0x1Fu
#define BSP_SYS_PLLCR_STC_x16_5 0x20u
#define BSP_SYS_PLLCR_STC_x17 0x21u
#define BSP_SYS_PLLCR_STC_x17_5 0x22u
#define BSP_SYS_PLLCR_STC_x18 0x23u
#define BSP_SYS_PLLCR_STC_x18_5 0x24u
#define BSP_SYS_PLLCR_STC_x19 0x25u
#define BSP_SYS_PLLCR_STC_x19_5 0x26u
#define BSP_SYS_PLLCR_STC_x20 0x27u
#define BSP_SYS_PLLCR_STC_x20_5 0x28u
#define BSP_SYS_PLLCR_STC_x21 0x29u
#define BSP_SYS_PLLCR_STC_x21_5 0x2Au
#define BSP_SYS_PLLCR_STC_x22 0x2Bu
#define BSP_SYS_PLLCR_STC_x22_5 0x2Cu
#define BSP_SYS_PLLCR_STC_x23 0x2Du
#define BSP_SYS_PLLCR_STC_x23_5 0x2Eu
#define BSP_SYS_PLLCR_STC_x24 0x2Fu
#define BSP_SYS_PLLCR_STC_x24_5 0x30u
#define BSP_SYS_PLLCR_STC_x25 0x31u
#define BSP_SYS_PLLCR_STC_x25_5 0x32u
#define BSP_SYS_PLLCR_STC_x26 0x33u
#define BSP_SYS_PLLCR_STC_x26_5 0x34u
#define BSP_SYS_PLLCR_STC_x27 0x35u
#define BSP_SYS_PLLCR_STC_x27_5 0x36u
#define BSP_SYS_PLLCR_STC_x28 0x37u
#define BSP_SYS_PLLCR_STC_x28_5 0x38u
#define BSP_SYS_PLLCR_STC_x29 0x39u
#define BSP_SYS_PLLCR_STC_x29_5 0x3Au
#define BSP_SYS_PLLCR_STC_x30 0x3Bu
/* -------------- SYS CLK CTRL REGISTER 2 ------------- */
#define BSP_SYS_SCKCR2_UCK_1_2 0x01u
#define BSP_SYS_SCKCR2_UCK_1_3 0x02u
#define BSP_SYS_SCKCR2_UCK_1_4 0x03u
#define BSP_SYS_SCKCR2_UCK_1_5 0x04u
/* -------------- SYS CLK CTRL REGISTER 3 ------------- */
#define BSP_SYS_SCKCR3_CKSEL_LOCO 0x00u
#define BSP_SYS_SCKCR3_CKSEL_HOCO 0x01u
#define BSP_SYS_SCKCR3_CKSEL_MAIN 0x02u
#define BSP_SYS_SCKCR3_CKSEL_SUB_CLK 0x03u
#define BSP_SYS_SCKCR3_CKSEL_PLL 0x04u
/*
*********************************************************************************************************
* BSP_SysInit()
*
* Description : Initializes & Configures system clock and peripheral clocks.
*
* Argument(s) : none.
*
* Caller(s) : none.
*
* Return(s) : none.
*
* Note(s) : none.
*********************************************************************************************************
*/
void BSP_SysInit (void)
{
uint16_t timeout;
timeout = BSP_SYS_TIMEOUT_VAL; /* Init Var(s). */
SYSTEM.PRCR.WORD = 0xA50Bu; /* Remove Protection from Registers. */
MPC.PWPR.BIT.B0WI = 0u; /* Enable Writing to MPC Pin Function Control reg. */
MPC.PWPR.BIT.PFSWE = 1u;
SYSTEM.MOFCR.BIT.MOSEL = 0u; /* Set Clk Osc Switch to Resonator. */
SYSTEM.MOFCR.BIT.MODRV2 = 0u; /* Set Clk Osc Drive to 20-24 MHz. */
SYSTEM.MOSCWTCR.BYTE = BSP_SYS_MOSCWTCR_WAIT_TIME; /* Main Clk Osc Wait Time. */
SYSTEM.MOSCCR.BIT.MOSTP = 0u; /* Set Main Clk Osc to Operation Mode. */
/* Wait for Main Clk Osc to be stable for Sys Clk use. */
while ((SYSTEM.OSCOVFSR.BIT.MOOVF == 0u) && (timeout > 0u)) {
timeout--;
}
/* ---------------- PLL CONFIGURATION ----------------- */
SYSTEM.PLLCR.BIT.PLIDIV = BSP_SYS_PLLCR_PLLDIV_1; /* - PLIDIV = 1 */
SYSTEM.PLLCR.BIT.STC = BSP_SYS_PLLCR_STC_x10; /* - STC = 10 */
/* - PLL = (XTAL_FREQ * PLIDIV) * STC */
/* = (12000000 * 1) * 10 */
/* = 120 MHz */
SYSTEM.PLLCR.BIT.PLLSRCSEL = 0u; /* Set main Clk Osc as PPL Clk Source. */
SYSTEM.PLLCR2.BIT.PLLEN = 0u; /* Start PLL Operation. */
timeout = BSP_SYS_TIMEOUT_VAL; /* Reset Timeout Val & Check PLL Clk Stability. */
while ((SYSTEM.OSCOVFSR.BIT.PLOVF == 0u) && (timeout > 0u)) {
timeout--;
}
/* --------------- SYSTEM CONFIGURATION --------------- */
SYSTEM.SCKCR.LONG = 0x21021222u; /* - PCKD = PLL * 1/4 = 30 MHz. */
/* - PCKC = PLL * 1/4 = 30 MHz. */
/* - PCKB = PLL * 1/4 = 30 MHz. */
/* - PCKA = PLL * 1/2 = 60 MHz. */
/* - BCK = PLL * 1/4 = 30 MHz. */
/* - ICK = PLL * 1/2 = 60 MHz. */
/* - FCK = PLL * 1/4 = 30 MHz. */
SYSTEM.SOSCCR.BIT.SOSTP = 1u; /* Disable Sub-Clock Osc. */
timeout = BSP_SYS_TIMEOUT_VAL; /* Reset Timeout Val & Check Sub-Clock is Disabled. */
while ((SYSTEM.SOSCCR.BIT.SOSTP == 0u) && (timeout > 0u)) {
timeout--;
}
SYSTEM.LOCOCR.BIT.LCSTP = 0u; /* Set Low Speed On-Chip Osc. */
SYSTEM.SCKCR2.BIT.UCK = BSP_SYS_SCKCR2_UCK_1_5; /* Set USB Clk Select = PLL * 1/5 = 24 MHz. */
SYSTEM.SCKCR.BIT.PSTOP0 = 1u; /* SDCLK Pin Output Control is Disabled. */
SYSTEM.SCKCR3.BIT.CKSEL = BSP_SYS_SCKCR3_CKSEL_PLL; /* Set Clock Source as PLL Circuit. */
}
/*
*********************************************************************************************************
* BSP_SysPerClkFreqGet()
*
* Description : This function is used to retrieve peripheral clock frequency.
*
* Argument(s) : none.
*
* Caller(s) : none.
*
* Return(s) : Peripheral clock frequency in cycles.
*
* Note(s) : none.
*********************************************************************************************************
*/
uint32_t BSP_SysPerClkFreqGet (void)
{
uint32_t pll_stc;
uint32_t pll_div;
uint32_t pll_freq;
uint32_t per_div;
uint32_t per_clk;
pll_stc = SYSTEM.PLLCR.BIT.STC;
pll_stc++;
pll_div = SYSTEM.PLLCR.BIT.PLIDIV;
switch (pll_div) {
case 0u:
pll_div = 1u;
break;
case 1u:
pll_div = 2u;
break;
case 2u:
pll_div = 4u;
break;
case 3u:
default:
return (0u);
}
pll_freq = BSP_CFG_SYS_EXT_CLK_FREQ * pll_stc / pll_div;
per_div = SYSTEM.SCKCR.BIT.PCKB;
switch (per_div) {
case 0u:
per_div = 1u;
break;
case 1u:
per_div = 2u;
break;
case 2u:
per_div = 4u;
break;
case 3u:
per_div = 8u;
break;
case 4u:
per_div = 16u;
break;
case 5u:
per_div = 32u;
break;
case 6u:
per_div = 64u;
break;
default:
return (0u);
}
per_clk = (pll_freq / per_div);
return (per_clk);
}

View file

@ -0,0 +1,44 @@
/*
*********************************************************************************************************
* MICRIUM BOARD SUPPORT SUPPORT
*
* (c) Copyright 2003-2014; Micrium, Inc.; Weston, FL
*
* All rights reserved. Protected by international copyright laws.
* Knowledge of the source code may NOT be used to develop a similar product.
* Please help us continue to provide the Embedded community with the finest
* software available. Your honesty is greatly appreciated.
*********************************************************************************************************
*/
/*
*********************************************************************************************************
*
* BOARD SUPPORT PACKAGE (BSP)
*
* RENESAS RX64M
* on the
* RSKRX64M DEVELOPMENT BOARD
*
* Filename : bsp.h
* Version : V1.00
* Programmer(s) : DC
*********************************************************************************************************
*/
#include "bsp.h"
/*
*********************************************************************************************************
* FUNCTION PROTOTYPES
*********************************************************************************************************
*/
void BSP_SysInit (void);
uint32_t BSP_SysPerClkFreqGet (void);
/*
*********************************************************************************************************
* MODULE END
*********************************************************************************************************
*/

View file

@ -0,0 +1,305 @@
/*
*********************************************************************************************************
*
* EXCEPTION VECTORS
*
* Renesas RX64M
* on the
* RSKRX64M Evaluation Board
*
* Filename : bsp_vect_tbl.c
* Version : V1.00
* Programmer(s) : DC
*********************************************************************************************************
*/
/*
*********************************************************************************************************
* FUNCTION PROTOTYPES
*********************************************************************************************************
*/
#pragma interrupt (Excep_SuperVisorInst) /* Supervisor Instruction Exception ISR Handler. */
void Excep_SuperVisorInst (void);
#pragma interrupt (Excep_AccessInst) /* Access Instruction Exception ISR Handler. */
void Excep_AccessInst (void);
#pragma interrupt (Excep_UndefinedInst) /* Undefined Instruction Exception ISR Handler. */
void Excep_UndefinedInst (void);
#pragma interrupt (Excep_FloatingPoint) /* Floating Point Exception ISR Handler. */
void Excep_FloatingPoint (void);
#pragma interrupt (NonMaskableInterrupt) /* NMI Exception ISR Handler. */
void NonMaskableInterrupt (void);
#pragma interrupt (Dummy) /* Generic "Dummy" ISR Handler. */
void Dummy (void);
extern void PowerON_Reset_PC (void); /* External: Reset Function. */
/*
*********************************************************************************************************
* EXCEPTION / INTERRUPT VECTOR TABLE
*********************************************************************************************************
*/
#pragma section C EXCEPTVECT
void (*const Except_Vectors[])(void) = {
Dummy, /* 0xffffff80 Reserved. */
Dummy, /* 0xffffff84 Reserved. */
Dummy, /* 0xffffff88 Reserved. */
Dummy, /* 0xffffff8c Reserved. */
Dummy, /* 0xffffff90 Reserved. */
Dummy, /* 0xffffff94 Reserved. */
Dummy, /* 0xffffff98 Reserved. */
Dummy, /* 0xffffff9c Reserved. */
Dummy, /* 0xffffffa0 Reserved. */
Dummy, /* 0xffffffa4 Reserved. */
Dummy, /* 0xffffffa8 Reserved. */
Dummy, /* 0xffffffac Reserved. */
Dummy, /* 0xffffffb0 Reserved. */
Dummy, /* 0xffffffb4 Reserved. */
Dummy, /* 0xffffffb8 Reserved. */
Dummy, /* 0xffffffbc Reserved. */
Dummy, /* 0xffffffc0 Reserved. */
Dummy, /* 0xffffffc4 Reserved. */
Dummy, /* 0xffffffc8 Reserved. */
Dummy, /* 0xffffffcc Reserved. */
Excep_SuperVisorInst, /* 0xffffffd0 Supervisor Instruction Exception. */
Excep_AccessInst, /* 0xffffffd4 Access Instruction Exception. */
Dummy, /* 0xffffffd8 Reserved */
Excep_UndefinedInst, /* 0xffffffdc Undefined Instruction Exception. */
Dummy, /* 0xffffffe0 Reserved. */
Excep_FloatingPoint, /* 0xffffffe4 Floating Point Exception. */
Dummy, /* 0xffffffe8 Reserved. */
Dummy, /* 0xffffffec Reserved. */
Dummy, /* 0xfffffff0 Reserved. */
Dummy, /* 0xfffffff4 Reserved. */
NonMaskableInterrupt, /* 0xfffffff8 NMI Exception. */
};
/*
*********************************************************************************************************
* RESET VECTOR TABLE
*********************************************************************************************************
*/
#pragma section C RESETVECT
void (*const Reset_Vectors[])(void) = { /* <<VECTOR DATA START (POWER ON RESET)>> */
PowerON_Reset_PC /* (void*) Power On Reset PC */
}; /* <<VECTOR DATA END (POWER ON RESET)>> */
/*
*********************************************************************************************************
* STARTUP REGISTER DEFINES
*********************************************************************************************************
*/
#if 0
#pragma address __SPCCreg=0x00120040 /* SPCC register */
const unsigned long __SPCCreg = 0xffffffff;
#pragma address __OSISreg=0x00120050 /* OSIC register (ID codes) */
const unsigned long __OSISreg[4] = {
0xffffffff,
0xffffffff,
0xffffffff,
0xffffffff,
};
#pragma address __MDEreg=0x00120064 /* MDE register (Single Chip Mode) */
#ifdef __BIG
const unsigned long __MDEreg = 0xfffffff8; /* Big */
#else
const unsigned long __MDEreg = 0xffffffff; /* Little */
#endif
#pragma address __OFS0reg=0x00120068 /* OFS0 register */
const unsigned long __OFS0reg = 0xffffffff;
#pragma address __OFS1reg=0x0012006c /* OFS1 register */
const unsigned long __OFS1reg = 0xffffffff;
#endif
#pragma address __MDEreg=0xfe7f5d00 // MDE register (Single Chip Mode)
#ifdef __BIG
const unsigned long __MDEreg = 0xfffffff8; // big
#else
const unsigned long __MDEreg = 0xffffffff; // little
#endif
#pragma address __OFS0reg=0xfe7f5d04 // OFS0 register
const unsigned long __OFS0reg = 0xffffffff;
#pragma address __OFS1reg=0xfe7f5d08 // OFS1 register
const unsigned long __OFS1reg = 0xffffffff;
#pragma address __TMINFreg=0xfe7f5d10 // TMINF register
const unsigned long __TMINFreg = 0xffffffff;
#pragma address __SPCCreg=0xfe7f5d40 // SPCC register
const unsigned long __SPCCreg = 0xffffffff;
#pragma address __TMEFreg=0xfe7f5d48 // TMEF register
const unsigned long __TMEFreg = 0xffffffff;
#pragma address __OSISreg=0xfe7f5d50 // OSIC register (ID codes)
const unsigned long __OSISreg[4] = {
0xffffffff,
0xffffffff,
0xffffffff,
0xffffffff,
};
#pragma address __FAWreg=0xfe7f5d64 // FAW register
const unsigned long __FAWreg = 0xffffffff;
#pragma address __RCPreg=0xfe7f5d70 // RCP register
const unsigned long __RCPreg = 0xffffffff;
/*
*********************************************************************************************************
* EXCEPTION HANDLER ISRs
*********************************************************************************************************
*/
#pragma section IntPRG
/*
*********************************************************************************************************
* Excep_SuperVisorInst()
*
* Description : Supervisor Instruction Exception ISR Handler.
*
* Argument(s) : none.
*
* Return(s) : none.
*
* Caller(s) : Application.
*
* Note(s) : none.
*********************************************************************************************************
*/
void Excep_SuperVisorInst (void)
{
while(1);
}
/*
*********************************************************************************************************
* Excep_AccessInst()
*
* Description : Access Instruction Exception ISR Handler.
*
* Argument(s) : none.
*
* Return(s) : none.
*
* Caller(s) : Application.
*
* Note(s) : none.
*********************************************************************************************************
*/
void Excep_AccessInst (void)
{
while(1);
}
/*
*********************************************************************************************************
* Excep_UndefinedInst()
*
* Description : Undefined Instruction Exception ISR Handler.
*
* Argument(s) : none.
*
* Return(s) : none.
*
* Caller(s) : Application.
*
* Note(s) : none.
*********************************************************************************************************
*/
void Excep_UndefinedInst (void)
{
while(1);
}
/*
*********************************************************************************************************
* Excep_FloatingPoint()
*
* Description : Floating Point Exception ISR Handler.
*
* Argument(s) : none.
*
* Return(s) : none.
*
* Caller(s) : Application.
*
* Note(s) : none.
*********************************************************************************************************
*/
void Excep_FloatingPoint (void)
{
while(1);
}
/*
*********************************************************************************************************
* NonMaskableInterrupt()
*
* Description : Non-Maskable Interrupt Exception ISR Handler.
*
* Argument(s) : none.
*
* Return(s) : none.
*
* Caller(s) : Application.
*
* Note(s) : none.
*********************************************************************************************************
*/
void NonMaskableInterrupt (void)
{
while(1);
}
/*
*********************************************************************************************************
* Dummy()
*
* Description : Generic "Dummy" ISR Handler.
*
* Argument(s) : none.
*
* Return(s) : none.
*
* Caller(s) : Application.
*
* Note(s) : none.
*********************************************************************************************************
*/
void Dummy (void)
{
while(1);
}

View file

@ -0,0 +1,71 @@
/***************************************************************/
/* */
/* PROJECT NAME : OS3_CAN */
/* FILE : dbsct.c */
/* DESCRIPTION : Setting of B and R sections */
/* CPU SERIES : RX600 */
/* CPU TYPE : RX64M */
/* */
/* This file is generated by e2 studio. */
/* */
/***************************************************************/
/************************************************************************
*
* Device : RX
*
* File Name : dbsct.c
*
* Abstract : Setting of B,R Section.
*
* History : 1.00 (2009-08-07)
* : 1.10 (2013-02-13)
*
* NOTE : THIS IS A TYPICAL EXAMPLE.
*
* Copyright (C) 2009 Renesas Electronics Corporation.
* and Renesas Solutions Corporation. All rights reserved.
*
************************************************************************/
#pragma unpack
#pragma section C C$DSEC
extern const struct {
unsigned char *rom_s; /* Start address of the initialized data section in ROM */
unsigned char *rom_e; /* End address of the initialized data section in ROM */
unsigned char *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 {
unsigned char *b_s; /* Start address of non-initialized data section */
unsigned char *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.
*/
unsigned char * const _CTBL[] = {
__sectop("C_1"), __sectop("C_2"), __sectop("C"),
__sectop("W_1"), __sectop("W_2"), __sectop("W"),
__sectop("L"), __sectop("SU"),
__sectop("C$DSEC"), __sectop("C$BSEC"),
__sectop("C$INIT"), __sectop("C$VTBL"), __sectop("C$VECT"),
};
#pragma packoption

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,121 @@
/*
*********************************************************************************************************
* BOARD SUPPORT PACKAGE
*
* (c) Copyright 2014; Micrium, Inc.; Weston, FL
* All rights reserved. Protected by international copyright laws.
*
* Renesas RX Specific code
*
* File : os_bsp.c
* By : PC
* JM
*
* LICENSING TERMS:
* ---------------
* BSP is provided in source form to registered licensees ONLY. It is
* illegal to distribute this source code to any third party unless you receive
* written permission by an authorized Micrium representative. Knowledge of
* the source code may NOT be used to develop a similar product.
*
* Please help us continue to provide the Embedded community with the finest
* software available. Your honesty is greatly appreciated.
*
* You can contact us at www.micrium.com.
*********************************************************************************************************
*/
#ifdef VSC_INCLUDE_SOURCE_FILE_NAMES
const CPU_CHAR *bsp_tick_c__c = "$Id: $";
#endif
/*
*********************************************************************************************************
* INCLUDE FILES
*********************************************************************************************************
*/
#include <bsp.h>
#include "bsp_cfg.h"
#include <bsp_sys.h>
#include <bsp_int_vect_tbl.h>
#include <iodefine.h>
#include <machine.h>
CPU_ISR OS_BSP_TickISR (void);
/*
*********************************************************************************************************
* OS_BSP_TickInit()
*
* Description : Initialize the kernel's tick interrupt.
*
* Argument(s) : none.
*
* Caller(s) : Application.
*
* Return(s) : none.
*
* Note(s) : (1) This function MUST be called after OSStart() & after processor initialization.
*********************************************************************************************************
*/
void OS_BSP_TickInit (void)
{
uint16_t cmcor;
BSP_IntVectSet(VECT_CMT0_CMI0, (CPU_FNCT_VOID)OS_BSP_TickISR);
#if (OS_VERSION >= 30000u)
cmcor = BSP_SysPerClkFreqGet() / (32u * RHINO_CONFIG_TICKS_PER_SECOND);
#else
cmcor = BSP_SysPerClkFreqGet() / (32u * RHINO_CONFIG_TICKS_PER_SECOND);
#endif
MSTP(CMT0) = 0u; /* Enable CMT0 module. */
CMT.CMSTR0.BIT.STR0 = 0u; /* Stop timer channel 0. */
CMT0.CMCR.BIT.CKS = 1u; /* Set peripheral clock divider. */
CMT0.CMCOR = (cmcor - 1u); /* Set compare-match value. */
CMT0.CMCNT = 0u; /* Clear counter register. */
IR(CMT0, CMI0) = 0u; /* Clear any pending ISR. */
IPR(CMT0, CMI0) = BSP_CFG_OS_TICK_IPL; /* Set interrupt priority. */
IEN(CMT0, CMI0) = 1u; /* Enable interrupt source. */
CMT0.CMCR.BIT.CMIE = 1u; /* Enable interrupt. */
CMT.CMSTR0.BIT.STR0 = 1u; /* Start timer. */
}
/*
*********************************************************************************************************
* OS_BSP_TickISR()
*
* Description : Kernel's tick interrupt handler
*
* Argument(s) : none.
*
* Caller(s) : tick interrupt.
*
* Return(s) : none.
*********************************************************************************************************
*/
#if __RENESAS__
#pragma interrupt OS_BSP_TickISR
#endif
CPU_ISR OS_BSP_TickISR (void)
{
krhino_intrpt_enter(); /* Notify uC/OS-III or uCOS-II of ISR entry */
CPU_INT_GLOBAL_EN(); /* Reenable global interrupts */
krhino_tick_proc();
krhino_intrpt_exit(); /* Notify uC/OS-III or uCOS-II of ISR exit */
}

View file

@ -0,0 +1,128 @@
/***************************************************************/
/* */
/* PROJECT NAME : OS3_CAN */
/* FILE : reset_program.c */
/* DESCRIPTION : Reset program */
/* CPU SERIES : RX600 */
/* CPU TYPE : RX64M */
/* */
/* This file is generated by e2 studio. */
/* */
/***************************************************************/
/*********************************************************************
*
* Device : RX/RX600
*
* File Name : resetprg.c
*
* Abstract : Reset Program.
*
* History : 1.00 (2009-08-07)
* : 1.10 (2011-02-21)
* : 1.11 (2011-06-20)
*
* NOTE : THIS IS A TYPICAL EXAMPLE.
*
* Copyright (C) 2009 (2011) Renesas Electronics Corporation.
* and Renesas Solutions Corp.
*
*********************************************************************/
#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 "stacksct.h" // Stack Sizes (Interrupt and User)
#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 // PSW bit pattern
#define FPSW_init 0x00000000 // FPSW bit base pattern
//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 // output PowerON_Reset_PC to PResetPRG section
#pragma entry PowerON_Reset_PC
void PowerON_Reset_PC(void)
{
#ifdef __RXV2
set_extb(__sectop("EXCEPTVECT"));
#endif
set_intb(__sectop("C$VECT"));
#ifdef __ROZ // Initialize FPSW
#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);
_INITSCT();
// _INIT_IOLIB(); // 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
// chg_pmusr(); // Remove the comment when you need to change PSW PMbit (SuperVisor->User)
main();
// _CLOSEALL(); // Use SIM I/O
// _CALL_END(); // Remove the comment when you use global class object
brk();
}

View file

@ -0,0 +1,13 @@
/***************************************************************/
/* */
/* PROJECT NAME : OS3_CAN */
/* FILE : stacksct.h */
/* DESCRIPTION : Setting of Stack area */
/* CPU SERIES : RX600 */
/* CPU TYPE : RX64M */
/* */
/* This file is generated by e2 studio. */
/* */
/***************************************************************/
#pragma stacksize su=0x200
#pragma stacksize si=0x300

View file

@ -0,0 +1,226 @@
/*
* Copyright (C) 2015-2017 Alibaba Group Holding Limited
*/
#ifndef CONFIG_H
#define CONFIG_H
/* chip level conf */
#ifndef RHINO_CONFIG_LITTLE_ENDIAN
#define RHINO_CONFIG_LITTLE_ENDIAN 1
#endif
#ifndef RHINO_CONFIG_CPU_STACK_DOWN
#define RHINO_CONFIG_CPU_STACK_DOWN 1
#endif
/* kernel feature conf */
#ifndef RHINO_CONFIG_SEM
#define RHINO_CONFIG_SEM 1
#endif
#ifndef RHINO_CONFIG_QUEUE
#define RHINO_CONFIG_QUEUE 1
#endif
#ifndef RHINO_CONFIG_TASK_SEM
#define RHINO_CONFIG_TASK_SEM 0
#endif
#ifndef RHINO_CONFIG_EVENT_FLAG
#define RHINO_CONFIG_EVENT_FLAG 0
#endif
#ifndef RHINO_CONFIG_TIMER
#define RHINO_CONFIG_TIMER 1
#endif
#ifndef RHINO_CONFIG_BUF_QUEUE
#define RHINO_CONFIG_BUF_QUEUE 1
#endif
#ifndef RHINO_CONFIG_MM_BLK
#define RHINO_CONFIG_MM_BLK 0
#endif
#ifndef RHINO_CONFIG_MM_DEBUG
#define RHINO_CONFIG_MM_DEBUG 0
#endif
#ifndef RHINO_CONFIG_MM_TLF
#define RHINO_CONFIG_MM_TLF 0
#endif
#ifndef RHINO_CONFIG_MM_TLF_BLK_SIZE
#define RHINO_CONFIG_MM_TLF_BLK_SIZE 8192
#endif
#define K_MM_STATISTIC 0
#ifndef RHINO_CONFIG_MM_MAXMSIZEBIT
#define RHINO_CONFIG_MM_MAXMSIZEBIT 19
#endif
#ifndef RHINO_CONFIG_GCC_RETADDR
#define RHINO_CONFIG_GCC_RETADDR 0
#endif
#ifndef RHINO_CONFIG_MM_LEAKCHECK
#define RHINO_CONFIG_MM_LEAKCHECK 0
#endif
#ifndef RHINO_CONFIG_RINGBUF_VENDOR
#define RHINO_CONFIG_RINGBUF_VENDOR 0
#endif
#ifndef RHINO_CONFIG_KOBJ_SET
#define RHINO_CONFIG_KOBJ_SET 0
#endif
/* kernel task conf */
#ifndef RHINO_CONFIG_TASK_SUSPEND
#define RHINO_CONFIG_TASK_SUSPEND 1
#endif
#ifndef RHINO_CONFIG_TASK_INFO
#define RHINO_CONFIG_TASK_INFO 0
#endif
#ifndef RHINO_CONFIG_TASK_DEL
#define RHINO_CONFIG_TASK_DEL 1
#endif
#ifndef RHINO_CONFIG_TASK_STACK_CUR_CHECK
#define RHINO_CONFIG_TASK_STACK_CUR_CHECK 0
#endif
#ifndef RHINO_CONFIG_TASK_WAIT_ABORT
#define RHINO_CONFIG_TASK_WAIT_ABORT 0
#endif
#ifndef RHINO_CONFIG_TASK_STACK_OVF_CHECK
#define RHINO_CONFIG_TASK_STACK_OVF_CHECK 1
#endif
#ifndef RHINO_CONFIG_SCHED_RR
#define RHINO_CONFIG_SCHED_RR 0
#endif
#ifndef RHINO_CONFIG_TIME_SLICE_DEFAULT
#define RHINO_CONFIG_TIME_SLICE_DEFAULT 50
#endif
#ifndef RHINO_CONFIG_PRI_MAX
#define RHINO_CONFIG_PRI_MAX 62
#endif
#ifndef RHINO_CONFIG_USER_PRI_MAX
#define RHINO_CONFIG_USER_PRI_MAX (RHINO_CONFIG_PRI_MAX - 2)
#endif
/* kernel workqueue conf */
#ifndef RHINO_CONFIG_WORKQUEUE
#define RHINO_CONFIG_WORKQUEUE 0
#endif
#ifndef RHINO_CONFIG_WORKQUEUE_STACK_SIZE
#define RHINO_CONFIG_WORKQUEUE_STACK_SIZE 768
#endif
/* kernel mm_region conf */
#ifndef RHINO_CONFIG_MM_REGION_MUTEX
#define RHINO_CONFIG_MM_REGION_MUTEX 0
#endif
/* kernel timer&tick conf */
#ifndef RHINO_CONFIG_HW_COUNT
#define RHINO_CONFIG_HW_COUNT 0
#endif
#ifndef RHINO_CONFIG_TICK_TASK
#define RHINO_CONFIG_TICK_TASK 0
#endif
#if (RHINO_CONFIG_TICK_TASK > 0)
#ifndef RHINO_CONFIG_TICK_TASK_STACK_SIZE
#define RHINO_CONFIG_TICK_TASK_STACK_SIZE 256
#endif
#ifndef RHINO_CONFIG_TICK_TASK_PRI
#define RHINO_CONFIG_TICK_TASK_PRI 1
#endif
#endif
#ifndef RHINO_CONFIG_TICKLESS
#define RHINO_CONFIG_TICKLESS 0
#endif
#ifndef RHINO_CONFIG_TICKS_PER_SECOND
#define RHINO_CONFIG_TICKS_PER_SECOND 1000
#endif
/* must be 2^n size!, such as 1, 2, 4, 8, 16,32, etc....... */
#ifndef RHINO_CONFIG_TICK_HEAD_ARRAY
#define RHINO_CONFIG_TICK_HEAD_ARRAY 8
#endif
/*must reserve enough stack size for timer cb will consume*/
#ifndef RHINO_CONFIG_TIMER_TASK_STACK_SIZE
#define RHINO_CONFIG_TIMER_TASK_STACK_SIZE 300
#endif
#ifndef RHINO_CONFIG_TIMER_RATE
#define RHINO_CONFIG_TIMER_RATE 1
#endif
#ifndef RHINO_CONFIG_TIMER_TASK_PRI
#define RHINO_CONFIG_TIMER_TASK_PRI 5
#endif
/* kernel intrpt conf */
#ifndef RHINO_CONFIG_INTRPT_STACK_REMAIN_GET
#define RHINO_CONFIG_INTRPT_STACK_REMAIN_GET 0
#endif
#ifndef RHINO_CONFIG_INTRPT_STACK_OVF_CHECK
#define RHINO_CONFIG_INTRPT_STACK_OVF_CHECK 0
#endif
#ifndef RHINO_CONFIG_INTRPT_MAX_NESTED_LEVEL
#define RHINO_CONFIG_INTRPT_MAX_NESTED_LEVEL 188u
#endif
#ifndef RHINO_CONFIG_INTRPT_GUARD
#define RHINO_CONFIG_INTRPT_GUARD 0
#endif
/* kernel dyn alloc conf */
#ifndef RHINO_CONFIG_KOBJ_DYN_ALLOC
#define RHINO_CONFIG_KOBJ_DYN_ALLOC 0
#endif
#if (RHINO_CONFIG_KOBJ_DYN_ALLOC > 0)
#ifndef RHINO_CONFIG_K_DYN_QUEUE_MSG
#define RHINO_CONFIG_K_DYN_QUEUE_MSG 30
#endif
#ifndef RHINO_CONFIG_K_DYN_TASK_STACK
#define RHINO_CONFIG_K_DYN_TASK_STACK 256
#endif
#ifndef RHINO_CONFIG_K_DYN_MEM_TASK_PRI
#define RHINO_CONFIG_K_DYN_MEM_TASK_PRI 6
#endif
#endif
/* kernel idle conf */
#ifndef RHINO_CONFIG_IDLE_TASK_STACK_SIZE
#define RHINO_CONFIG_IDLE_TASK_STACK_SIZE 100
#endif
/* kernel hook conf */
#ifndef RHINO_CONFIG_USER_HOOK
#define RHINO_CONFIG_USER_HOOK 0
#endif
/* kernel stats conf */
#ifndef RHINO_CONFIG_SYSTEM_STATS
#define RHINO_CONFIG_SYSTEM_STATS 1
#endif
#ifndef RHINO_CONFIG_DISABLE_SCHED_STATS
#define RHINO_CONFIG_DISABLE_SCHED_STATS 0
#endif
#ifndef RHINO_CONFIG_DISABLE_INTRPT_STATS
#define RHINO_CONFIG_DISABLE_INTRPT_STATS 0
#endif
#ifndef RHINO_CONFIG_CPU_USAGE_STATS
#define RHINO_CONFIG_CPU_USAGE_STATS 0
#endif
#ifndef RHINO_CONFIG_CPU_USAGE_TASK_PRI
#define RHINO_CONFIG_CPU_USAGE_TASK_PRI (RHINO_CONFIG_PRI_MAX - 2)
#endif
#ifndef RHINO_CONFIG_TASK_SCHED_STATS
#define RHINO_CONFIG_TASK_SCHED_STATS 0
#endif
#ifndef RHINO_CONFIG_CPU_USAGE_TASK_STACK
#define RHINO_CONFIG_CPU_USAGE_TASK_STACK 256
#endif
#ifndef RHINO_CONFIG_CPU_NUM
#define RHINO_CONFIG_CPU_NUM 1
#endif
/* kernel trace conf */
#ifndef RHINO_CONFIG_TRACE
#define RHINO_CONFIG_TRACE 0
#endif
#endif /* CONFIG_H */