RX65N RTC Driver added

This commit is contained in:
rajeshwaribhat 2020-03-02 17:46:04 +05:30 committed by Gregory Nutt
parent aa205b3732
commit e671a10b2a
37 changed files with 24298 additions and 1323 deletions

File diff suppressed because it is too large Load diff

View file

@ -182,6 +182,13 @@ config RX65N_EMAC0
select NETDEVICES
select ARCH_HAVE_PHY
config RX65N_RTC
bool "RTC"
default y
config RX65N_CARRY
bool "RTC"
default y
endmenu # RX65N Peripheral Selections
endif
@ -529,4 +536,11 @@ config RX65N_EMAC_REGDEBUG
---help---
Enable very low-level register access debug. Depends on CONFIG_DEBUG_NET.
config RX65N_RTC
bool "RTC"
default y
config RX65N_CARRY
bool "RTC"
default y
endmenu # EMAC0 device driver options

View file

@ -52,3 +52,10 @@ CHIP_CSRCS += rx65n_timerisr.c
ifeq ($(CONFIG_RX65N_EMAC),y)
CHIP_CSRCS += rx65n_eth.c rx65n_cmtw0.c
endif
ifeq ($(CONFIG_RX65N_RTC),y)
CHIP_CSRCS += rx65n_rtc.c
endif
ifeq ($(CONFIG_RTC_DRIVER),y)
CHIP_CSRCS += rx65n_rtc_lowerhalf.c
endif

View file

@ -1,37 +1,22 @@
/****************************************************************************
* arch/renesas/src/rx65n/chip.h
*
* Copyright (C) 2008-2019 Gregory Nutt. All rights reserved.
* Author: Anjana <anjana@tataelxsi.co.in>
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership. The
* ASF licenses this file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the
* License. You may obtain a copy of the License at
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* http://www.apache.org/licenses/LICENSE-2.0
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* 3. Neither the name NuttX nor the names of its contributors may be
* used to endorse or promote products derived from this software
* without specific prior written permission.
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
***************************************************************************/
****************************************************************************/
#ifndef __ARCH_RENESAS_SRC_RX65N_CHIP_H
#define __ARCH_RENESAS_SRC_RX65N_CHIP_H
@ -39,7 +24,7 @@
/****************************************************************************
* Included Files
***************************************************************************/
****************************************************************************/
#include <nuttx/config.h>
@ -50,23 +35,19 @@
/****************************************************************************
* Pre-processor Definitions
***************************************************************************/
****************************************************************************/
/****************************************************************************
* Public Types
***************************************************************************/
****************************************************************************/
/***************************************************************************
/****************************************************************************
* Public Data
**************************************************************************/
****************************************************************************/
#ifndef __ASSEMBLY__
extern uint16_t ebss;
#endif
/**************************************************************************
* Public Functions
*************************************************************************/
#endif
#endif /* __ARCH_RENESAS_SRC_SH1_CHIP_H */

View file

@ -1,35 +1,20 @@
/****************************************************************************
* arch/renesas/src/rx65n/rx65n_cgc.c
*
* Copyright (C) 2008-2019 Gregory Nutt. All rights reserved.
* Author: Anjana <anjana@tataelxsi.co.in>
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership. The
* ASF licenses this file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the
* License. You may obtain a copy of the License at
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* http://www.apache.org/licenses/LICENSE-2.0
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* 3. Neither the name NuttX nor the names of its contributors may be
* used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
****************************************************************************/
@ -54,6 +39,7 @@
void r_cgc_create(void)
{
volatile uint8_t i;
#if ((24 * RX_CLK_1MHz) == RX_RESONATOR)
/* Set main clock control registers */
@ -141,6 +127,67 @@ void r_cgc_create(void)
/* Set LOCO */
SYSTEM.LOCOCR.BIT.LCSTP = 1U;
#ifdef CONFIG_RX65N_RTC
RTC.RCR4.BYTE = _00_RTC_SOURCE_SELECT_SUB;
for (i = 0; i < 4; i++)
{
__asm("nop");
}
if (0 != RTC.RCR4.BIT.RCKSEL)
{
__asm("nop");
}
RTC.RCR3.BIT.RTCEN = 0;
for (i = 0; i < 4; i++)
{
__asm("nop");
}
if (0 != RTC.RCR3.BIT.RTCEN)
{
__asm("nop");
}
SYSTEM.SOSCCR.BYTE = 0x01;
if (0x01 != SYSTEM.SOSCCR.BYTE)
{
__asm("nop");
}
while (0 != SYSTEM.OSCOVFSR.BIT.SOOVF);
RTC.RCR3.BIT.RTCDV = 1U;
/* Wait for the register modification to complete */
while (1U != RTC.RCR3.BIT.RTCDV)
{
/* Do nothing */
}
/* Set sub-clock oscillation wait time */
SYSTEM.SOSCWTCR.BYTE = _25_CGC_SOSCWTCR_VALUE;
/* Set sub-clock */
SYSTEM.SOSCCR.BIT.SOSTP = 0U;
/* Wait for the register modification to complete */
while (0U != SYSTEM.SOSCCR.BIT.SOSTP)
{
/* Do nothing */
}
/* Wait for sub-clock to be stable */
while (1U != SYSTEM.OSCOVFSR.BIT.SOOVF)
{
/* Do nothing */
}
#endif
#elif ((12 * RX_CLK_1MHz) == RX_RESONATOR)
SYSTEM.MOFCR.BIT.MOFXIN = 0;
SYSTEM.MOFCR.BIT.MOSEL = 0;
@ -154,6 +201,7 @@ void r_cgc_create(void)
{
while (0 == SYSTEM.OSCOVFSR.BIT.HCOVF);
}
SYSTEM.MOFCR.BIT.MODRV2 = 2;
SYSTEM.MOSCWTCR.BYTE = 0x53;
SYSTEM.MOSCCR.BYTE = 0x00;
@ -166,36 +214,67 @@ void r_cgc_create(void)
while (0 == SYSTEM.OSCOVFSR.BIT.MOOVF);
if (0 == SYSTEM.RSTSR1.BIT.CWSF)
{
volatile uint8_t i;
RTC.RCR4.BIT.RCKSEL = 0;
for (i = 0; i < 4; i++)
{
__asm("nop");
}
#ifdef CONFIG_RX65N_RTC
RTC.RCR4.BYTE = _00_RTC_SOURCE_SELECT_SUB;
for (i = 0; i < 4; i++)
{
__asm("nop");
}
if (0 != RTC.RCR4.BIT.RCKSEL)
{
__asm("nop");
}
if (0 != RTC.RCR4.BIT.RCKSEL)
{
__asm("nop");
}
RTC.RCR3.BIT.RTCEN = 0;
for (i = 0; i < 4; i++)
{
__asm("nop");
}
RTC.RCR3.BIT.RTCEN = 0;
for (i = 0; i < 4; i++)
{
__asm("nop");
}
if (0 != RTC.RCR3.BIT.RTCEN)
{
__asm("nop");
}
if (0 != RTC.RCR3.BIT.RTCEN)
{
__asm("nop");
}
SYSTEM.SOSCCR.BYTE = 0x01;
if (0x01 != SYSTEM.SOSCCR.BYTE)
{
__asm("nop");
}
SYSTEM.SOSCCR.BYTE = 0x01;
if (0x01 != SYSTEM.SOSCCR.BYTE)
{
__asm("nop");
}
while (0 != SYSTEM.OSCOVFSR.BIT.SOOVF);
while (0 != SYSTEM.OSCOVFSR.BIT.SOOVF);
RTC.RCR3.BIT.RTCDV = 1U;
/* Wait for the register modification to complete */
while (1U != RTC.RCR3.BIT.RTCDV)
{
/* Do nothing */
}
/* Set sub-clock oscillation wait time */
SYSTEM.SOSCWTCR.BYTE = _25_CGC_SOSCWTCR_VALUE;
/* Set sub-clock */
SYSTEM.SOSCCR.BIT.SOSTP = 0U;
/* Wait for the register modification to complete */
while (0U != SYSTEM.SOSCCR.BIT.SOSTP)
{
/* Do nothing */
}
/* Wait for sub-clock to be stable */
while (1U != SYSTEM.OSCOVFSR.BIT.SOOVF)
{
/* Do nothing */
}
#endif
}
else
{

View file

@ -1,35 +1,20 @@
/****************************************************************************
* arch/renesas/src/rx65n/rx65n_cgc.h
*
* Copyright (C) 2008-2019 Gregory Nutt. All rights reserved.
* Author: Anjana <anjana@tataelxsi.co.in>
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership. The
* ASF licenses this file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the
* License. You may obtain a copy of the License at
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* http://www.apache.org/licenses/LICENSE-2.0
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* 3. Neither the name NuttX nor the names of its contributors may be
* used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
****************************************************************************/
@ -253,7 +238,7 @@
#define _00_RTC_SOURCE_SELECT_SUB (0x00u) /* Select sub-clock oscillator */
#define _01_RTC_SOURCE_SELECT_MAIN_FORCED (0x01u) /* Select main clock oscillator */
#define _25_CGC_SOSCWTCR_VALUE (0x25U)
/* Interrupt Source Priority Register n (IPRn) */
/* Interrupt Priority Level Select (IPR[3:0]) */
@ -281,7 +266,7 @@
/****************************************************************************
* Public Function Prototypes
***************************************************************************/
****************************************************************************/
/****************************************************************************
* Name: r_cgc_create

View file

@ -1,45 +1,29 @@
/****************************************************************************
* arch/renesas/src/rx65n/rx65n_definitions.h
*
* Copyright (C) 2008-2019 Gregory Nutt. All rights reserved.
* Author: Anjana <anjana@tataelxsi.co.in>
* Surya <surya.prakash@tataelxsi.co.in>
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership. The
* ASF licenses this file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the
* License. You may obtain a copy of the License at
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* http://www.apache.org/licenses/LICENSE-2.0
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* 3. Neither the name NuttX nor the names of its contributors may be
* used to endorse or promote products derived from this software
* without specific prior written permission.
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
***************************************************************************/
****************************************************************************/
#ifndef __ARCH_RENESAS_SRC_RX65N_RX65N_DEFINITIONS_H
#define __ARCH_RENESAS_SRC_RX65N_RX65N_DEFINITIONS_H
/****************************************************************************
* Included Files
***************************************************************************/
****************************************************************************/
#include <nuttx/config.h>
#include "rx65n/iodefine.h"
@ -47,9 +31,9 @@
/****************************************************************************
* Pre-processor Definitions
***************************************************************************/
****************************************************************************/
/* Memory-mapped register addresses ****************************************/
/* Memory-mapped register addresses *****************************************/
#define RX65N_SCI0_BASE (uint32_t)&SCI0
#define RX65N_SCI1_BASE (uint32_t)&SCI1
@ -468,13 +452,98 @@
#define SET_BYTE_HIGH (0xff)
#define SET_BYTE_LOW (0x00)
/* RTC Register Offsets */
#define RX65N_RTC_R64CNT_OFFSET (0x0000)
#define RX65N_RTC_RSECCNT_OFFSET (0x0002)
#define RX65N_RTC_RMINCNT_OFFSET (0x0004)
#define RX65N_RTC_RHRCNT_OFFSET (0x0006)
#define RX65N_RTC_RWKCNT_OFFSET (0x0008)
#define RX65N_RTC_RDAYCNT_OFFSET (0x000a)
#define RX65N_RTC_RMONCNT_OFFSET (0x000c)
#define RX65N_RTC_RYRCNT_OFFSET (0x000e)
#define RX65N_RTC_RSECAR_OFFSET (0x0010)
#define RX65N_RTC_RMINAR_OFFSET (0x0012)
#define RX65N_RTC_RHRAR_OFFSET (0x0014)
#define RX65N_RTC_RWKAR_OFFSET (0x0016)
#define RX65N_RTC_RDAYAR_OFFSET (0x0018)
#define RX65N_RTC_RMONAR_OFFSET (0x001a)
#define RX65N_RTC_RYRAR_OFFSET (0x001c)
#define RX65N_RTC_RYRAREN_OFFSET (0x001e)
#define RX65N_RTC_RCR1_OFFSET (0x0022)
#define RX65N_RTC_RCR2_OFFSET (0x0024)
#define RX65N_RTC_RCR3_OFFSET (0x0026)
#define RX65N_RTC_RCR4_OFFSET (0x0028)
#define RX65N_RTC_RADJ_OFFSET (0x002e)
#define RX65N_RTC_BASE (0x0008c400)
#define RX65N_RTC_R64CNT (RX65N_RTC_BASE + RX65N_RTC_R64CNT_OFFSET)
#define RX65N_RTC_RSECCNT (RX65N_RTC_BASE + RX65N_RTC_RSECCNT_OFFSET)
#define RX65N_RTC_RMINCNT (RX65N_RTC_BASE + RX65N_RTC_RMINCNT_OFFSET)
#define RX65N_RTC_RHRCNT (RX65N_RTC_BASE + RX65N_RTC_RHRCNT_OFFSET)
#define RX65N_RTC_RWKCNT (RX65N_RTC_BASE + RX65N_RTC_RWKCNT_OFFSET)
#define RX65N_RTC_RDAYCNT (RX65N_RTC_BASE + RX65N_RTC_RDAYCNT_OFFSET)
#define RX65N_RTC_RMONCNT (RX65N_RTC_BASE + RX65N_RTC_RMONCNT_OFFSET)
#define RX65N_RTC_RYRCNT (RX65N_RTC_BASE + RX65N_RTC_RYRCNT_OFFSET)
#define RX65N_RTC_RSECAR (RX65N_RTC_BASE + RX65N_RTC_RSECAR_OFFSET)
#define RX65N_RTC_RMINAR (RX65N_RTC_BASE + RX65N_RTC_RMINAR_OFFSET)
#define RX65N_RTC_RHRAR (RX65N_RTC_BASE + RX65N_RTC_RHRAR_OFFSET)
#define RX65N_RTC_RWKAR (RX65N_RTC_BASE + RX65N_RTC_RWKAR_OFFSET)
#define RX65N_RTC_RDAYAR (RX65N_RTC_BASE + RX65N_RTC_RDAYAR_OFFSET)
#define RX65N_RTC_RMONAR (RX65N_RTC_BASE + RX65N_RTC_RMONAR_OFFSET)
#define RX65N_RTC_RYRAR (RX65N_RTC_BASE + RX65N_RTC_RYRAR_OFFSET)
#define RX65N_RTC_RYRAREN (RX65N_RTC_BASE + RX65N_RTC_RYRAREN_OFFSET)
#define RX65N_RTC_RCR1 (RX65N_RTC_BASE + RX65N_RTC_RCR1_OFFSET)
#define RX65N_RTC_RCR2 (RX65N_RTC_BASE + RX65N_RTC_RCR2_OFFSET)
#define RX65N_RTC_RCR3 (RX65N_RTC_BASE + RX65N_RTC_RCR3_OFFSET)
#define RX65N_RTC_RCR4 (RX65N_RTC_BASE + RX65N_RTC_RCR4_OFFSET)
#define RX65N_RTC_RADJ (RX65N_RTC_BASE + RX65N_RTC_RADJ_OFFSET)
#define RTC_RTC_ALRDIS (0x00)
#define RTC_RCR4_RCKSEL (0x00)
#define RTC_RCR3_RTCEN (0x01)
#define RTC_RCR3_RTCDV (0x02)
#define RTC_RCR2_START (0x01)
#define RTC_RCR2_CNTMD (0x00)
#define RTC_RCR2_RESET (0x01)
#define RTC_ALARM_INT_ENABLE (0x01)
#define RTC_CARRY_INT_ENABLE (0x02)
#define RTC_PERIOD_INT_ENABLE (0x04)
#define RTC_PERIODIC_INT_PERIOD_1 (0xe0)
#define _04_FOUR_READ_COUNT (0x04)
#define RTC_1_64_SEC_CYCLE (0x0005b8d9)
#define _0F_RTC_PRIORITY_LEVEL15 (0x0f)
#define RTC_RCR1_CUP (0x02)
#define RX65N_SUBCLKOSC_SOSCCR (0x00080033)
#define SUBCLKOSC_SOSCCR_SOSTP (0x01)
#define RX65N_SUBCLKOSC_SOSCWTCR (0x0008c293)
#define RTC_SOSCWTCR_VALUE (0x21)
#define RTC_DUMMY_READ (3)
#define _00_RTC_PRIORITY_LEVEL0 (0)
#define _04_RTC_PERIOD_INT_ENABLE (0x04)
#define RTC_RTC_CARRYDIS (0xe5)
#define RTC_RTC_PERDIS (0xe3)
#define RTC_RADJ_INITVALUE (0x0)
#define RTC_RCR2_AADJE (0x10)
#define RTC_RCR2_AADJP (0x20)
#if defined(CONFIG_RTC) || defined(CONFIG_RTC_DRIVER)
#define HAVE_RTC_DRIVER 1
#endif
#define RX65N_RTC_WAIT_PERIOD 184
#define RTC_RCR2_HR24 (0x40)
#define RTC_PERIODIC_INTERRUPT_2_SEC (0xf)
/****************************************************************************
* Public Types
***************************************************************************/
****************************************************************************/
/****************************************************************************
* Public Data
***************************************************************************/
****************************************************************************/
#ifndef __ASSEMBLER__
/* Serial Communications interface (SCI) */

View file

@ -1,37 +1,22 @@
/****************************************************************************
* arch/renesas/src/rx65n/rx65n_icu.h
*
* Copyright (C) 2008-2019 Gregory Nutt. All rights reserved. Gregory Nutt.
* Author: Anjana <anjana@tataelxsi.co.in>
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership. The
* ASF licenses this file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the
* License. You may obtain a copy of the License at
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* http://www.apache.org/licenses/LICENSE-2.0
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* 3. Neither the name NuttX nor the names of its contributors may be
* used to endorse or promote products derived from this software
* without specific prior written permission.
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
***************************************************************************/
****************************************************************************/
#ifndef __ARCH_RENESAS_SRC_RX65N_RX65N_ICU_H
#define __ARCH_RENESAS_SRC_RX65N_RX65N_ICU_H
@ -250,7 +235,7 @@
/****************************************************************************
* Public Function Prototypes
***************************************************************************/
****************************************************************************/
/****************************************************************************
* Name: r_icu_create
@ -478,4 +463,4 @@ void r_icu_irqsetfallingedge(const uint8_t irq_no, const uint8_t set_f_edge);
void r_icu_irqsetrisingedge(const uint8_t irq_no, const uint8_t set_r_edge);
#endif /* __ARCH_RENESAS_SRC_RX65N_RX65N_ICU_H *.
#endif /* __ARCH_RENESAS_SRC_RX65N_RX65N_ICU_H */

View file

@ -1,36 +1,20 @@
/****************************************************************************
* arch/renesas/src/rx65n/rx65n_irq.c
*
* Copyright (C) 2008-2019 Gregory Nutt. All rights reserved.
* Author: Anjana <anjana@tataelxsi.co.in>
* Surya <surya.prakash@tataelxsi.co.in>
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership. The
* ASF licenses this file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the
* License. You may obtain a copy of the License at
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* http://www.apache.org/licenses/LICENSE-2.0
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* 3. Neither the name NuttX nor the names of its contributors may be
* used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
****************************************************************************/
@ -174,6 +158,7 @@ void up_disable_irq(int irq)
ICU.GENBL0.BIT.EN4 = 0;
}
#endif
#ifdef CONFIG_RX65N_SCI3
if (irq == RX65N_RXI3_IRQ)
{
@ -245,6 +230,7 @@ void up_disable_irq(int irq)
ICU.GENBL0.BIT.EN10 = 0;
}
#endif
#ifdef CONFIG_RX65N_SCI6
if (irq == RX65N_RXI6_IRQ)
{
@ -420,6 +406,26 @@ void up_disable_irq(int irq)
ICU.GENAL1.BIT.EN4 = 0;
}
#endif
#ifdef CONFIG_RX65N_RTC
if (irq == RX65N_ALM_IRQ)
{
ICU.IER[0x0b].BIT.IEN4 = 0;
}
if (irq == RX65N_PRD_IRQ)
{
ICU.IER[0x0b].BIT.IEN5 = 0;
}
#ifdef CONFIG_RX65N_PERIB
if (irq == RX65N_INTB176_IRQ)
{
ICU.IER[16].BIT.IEN0 = 0;
}
#endif
#endif
}
/****************************************************************************
@ -511,6 +517,7 @@ void up_enable_irq(int irq)
ICU.GENBL0.BIT.EN4 = 1;
}
#endif
#ifdef CONFIG_RX65N_SCI3
if (irq == RX65N_RXI3_IRQ)
{
@ -582,6 +589,7 @@ void up_enable_irq(int irq)
ICU.GENBL0.BIT.EN10 = 1;
}
#endif
#ifdef CONFIG_RX65N_SCI6
if (irq == RX65N_RXI6_IRQ)
{
@ -757,4 +765,24 @@ void up_enable_irq(int irq)
ICU.GENAL1.BIT.EN4 = 1;
}
#endif
#ifdef CONFIG_RX65N_RTC
if (irq == RX65N_ALM_IRQ)
{
ICU.IER[0x0b].BIT.IEN4 = 1;
}
if (irq == RX65N_PRD_IRQ)
{
ICU.IER[0x0b].BIT.IEN5 = 1;
}
#ifdef CONFIG_RX65N_PERIB
if (irq == RX65N_INTB176_IRQ)
{
ICU.IER[16].BIT.IEN0 = 1;
}
#endif
#endif
}

View file

@ -1,36 +1,20 @@
/****************************************************************************
* arch/renesas/src/rx65n/rx65n_port.c
*
* Copyright (C) 2008-2019 Gregory Nutt. All rights reserved.
* Author: Anjana <anjana@tataelxsi.co.in>
* Surya <surya.prakash@tataelxsi.co.in>
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership. The
* ASF licenses this file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the
* License. You may obtain a copy of the License at
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* http://www.apache.org/licenses/LICENSE-2.0
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* 3. Neither the name NuttX nor the names of its contributors may be
* used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
****************************************************************************/
@ -137,6 +121,7 @@ void r_port_create(void)
# error "No Selection for PORT definition in rx65n_port.c"
#endif
}
#ifdef CONFIG_RX65N_EMAC0
void r_ether_port_configuration(void)
{

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,246 @@
/****************************************************************************
* arch/renesas/src/rx65n/rx65n_rtc.h
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership. The
* ASF licenses this file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the
* License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
****************************************************************************/
/****************************************************************************
* Included Files
****************************************************************************/
#ifndef __ARCH_RENESAS_SRC_RX65N_RTC_H
#define __ARCH_RENESAS_SRC_RX65N_RTC_H
#include <nuttx/config.h>
#include "chip.h"
#include "rx65n_definitions.h"
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
/****************************************************************************
* Public Types
****************************************************************************/
#ifndef __ASSEMBLY__
#ifdef CONFIG_RTC_ALARM
/* The form of an alarm callback */
typedef CODE void (*alm_callback_t)(FAR void *arg, unsigned int alarmid);
/* Structure used to pass parameters to set an alarm */
struct alm_setalarm_s
{
int as_id; /* enum alm_id_e */
struct tm as_time; /* Alarm expiration time */
alm_callback_t as_cb; /* Callback (if non-NULL) */
FAR void *as_arg; /* Argument for callback */
};
/* Structure used to pass parameters to query an alarm */
struct alm_rdalarm_s
{
int ar_id; /* enum alm_id_e */
FAR struct rtc_time *ar_time; /* Argument for storing ALARM RTC time */
};
#endif /* CONFIG_RTC_ALARM */
#ifdef CONFIG_RTC_PERIODIC
typedef CODE int (*periodiccb_t)(FAR void *arg, unsigned int alarmid);
#endif
#ifdef CONFIG_RX65N_CARRY
typedef void (*carrycb_t)(void);
#endif
/****************************************************************************
* Public Data
****************************************************************************/
#undef EXTERN
#if defined(__cplusplus)
#define EXTERN extern "C"
extern "C"
{
#else
#define EXTERN extern
#endif
/****************************************************************************
* Public Function Prototypes
****************************************************************************/
/****************************************************************************
* Name: rx65n_rtc_setdatetime
*
* Description:
* Set the RTC to the provided time. RTC implementations which provide
* up_rtc_getdatetime() (CONFIG_RTC_DATETIME is selected) should provide
* this function.
*
* Input Parameters:
* tp - the time to use
*
* Returned Value:
* Zero (OK) on success; a negated errno on failure
*
****************************************************************************/
#ifdef CONFIG_RTC_DATETIME
struct tm;
int rx65n_rtc_setdatetime(FAR const struct tm *tp);
#endif
/****************************************************************************
* Name: rx65n_rtc_havesettime
*
* Description:
* Check if RTC time has been set.
*
* Returned Value:
* Returns true if RTC date-time have been previously set.
*
****************************************************************************/
bool rx65n_rtc_havesettime(void);
#ifdef CONFIG_RTC_ALARM
/****************************************************************************
* Name: rx65n_rtc_setalarm
*
* Description:
* Set an alarm to an absolute time using associated hardware.
*
* Input Parameters:
* alminfo - Information about the alarm configuration.
*
* Returned Value:
* Zero (OK) on success; a negated errno on failure
*
****************************************************************************/
int rx65n_rtc_setalarm(FAR struct alm_setalarm_s *alminfo);
/****************************************************************************
* Name: rx65n_rtc_rdalarm
*
* Description:
* Query an alarm configured in hardware.
*
* Input Parameters:
* alminfo - Information about the alarm configuration.
*
* Returned Value:
* Zero (OK) on success; a negated errno on failure
*
****************************************************************************/
int rx65n_rtc_rdalarm(FAR struct alm_rdalarm_s *alminfo);
/****************************************************************************
* Name: rx65n_rtc_cancelalarm
*
* Description:
* Cancel an alarm.
*
* Input Parameters:
* alarmid - Identifies the alarm to be cancelled
*
* Returned Value:
* Zero (OK) on success; a negated errno on failure
*
****************************************************************************/
int rx65n_rtc_cancelalarm(void);
#endif /* CONFIG_RTC_ALARM */
#ifdef CONFIG_RTC_PERIODIC
/****************************************************************************
* Name: rx65n_rtc_setperiodic
*
* Description:
* Set a periodic RTC wakeup
*
* Input Parameters:
* period - Time to sleep between wakeups
* callback - Function to call when the period expires.
*
* Returned Value:
* Zero (OK) on success; a negated errno on failure
*
****************************************************************************/
int rx65n_rtc_setperiodic(FAR const struct timespec *period,
periodiccb_t callback);
/****************************************************************************
* Name: rx65n_rtc_cancelperiodic
*
* Description:
* Cancel a periodic wakeup
*
* Input Parameters:
*
* Returned Value:
* Zero (OK) on success; a negated errno on failure
*
****************************************************************************/
int rx65n_rtc_cancelperiodic(void);
#endif /* CONFIG_RTC_PERIODIC */
/****************************************************************************
* Name: rx65n_rtc_lowerhalf
*
* Description:
* Instantiate the RTC lower half driver for the rx65n. General usage:
*
* #include <nuttx/timers/rtc.h>
* #include "rx65n_rtc.h>
*
* struct rtc_lowerhalf_s *lower;
* lower = rx65n_rtc_lowerhalf();
* rtc_initialize(0, lower);
*
* Input Parameters:
* None
*
* Returned Value:
* On success, a non-NULL RTC lower interface is returned. NULL is
* returned on any failure.
*
****************************************************************************/
#ifdef CONFIG_RTC_DRIVER
struct rtc_lowerhalf_s;
FAR struct rtc_lowerhalf_s *rx65n_rtc_lowerhalf(void);
#endif
#undef EXTERN
#if defined(__cplusplus)
}
#endif
#endif /* __ASSEMBLY__ */
#endif /* __ARCH_RENESAS_SRC_RX65N_RTC_H */

View file

@ -0,0 +1,736 @@
/****************************************************************************
* arch/renesas/src/rx65n/rx65n_rtc_lowerhalf.c
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership. The
* ASF licenses this file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the
* License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
****************************************************************************/
/****************************************************************************
* Included Files
****************************************************************************/
#include <nuttx/config.h>
#include <sys/types.h>
#include <stdbool.h>
#include <string.h>
#include <errno.h>
#include <nuttx/arch.h>
#include <nuttx/timers/rtc.h>
#include "chip.h"
#include <rx65n_rtc.h>
#include "up_arch.h"
#ifdef CONFIG_RTC_DRIVER
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
# define rx65n_getreg(addr) getreg8(addr)
# define rx65n_putreg(val,addr) putreg8(val,addr)
# define RX65N_NALARMS 1
/* Configuration ************************************************************/
#if defined(CONFIG_RTC_ALARM) && !defined(CONFIG_SCHED_WORKQUEUE)
# error CONFIG_RTC_ALARM requires CONFIG_SCHED_WORKQUEUE
#endif
/****************************************************************************
* Private Types
****************************************************************************/
#ifdef CONFIG_RTC_ALARM
struct rx65n_cbinfo_s
{
volatile rtc_alarm_callback_t cb; /* Callback when the alarm expires */
volatile FAR void *priv; /* Private argument to accompany callback */
uint8_t id; /* Identifies the alarm */
};
#endif
/* This is the private type for the RTC state. It must be cast compatible
* with struct rtc_lowerhalf_s.
*/
struct rx65n_lowerhalf_s
{
/* This is the contained reference to the read-only, lower-half
* operations vtable (which may lie in FLASH or ROM)
*/
FAR const struct rtc_ops_s *ops;
/* Data following is private to this driver and not visible outside of
* this file.
*/
sem_t devsem; /* Threads can only exclusively access the RTC */
#ifdef CONFIG_RTC_ALARM
/* Alarm callback information */
struct rx65n_cbinfo_s cbinfo[RX65N_NALARMS];
#endif
#ifdef CONFIG_RTC_PERIODIC
/* Periodic wakeup information */
struct lower_setperiodic_s periodic;
#endif
};
/****************************************************************************
* Private Function Prototypes
****************************************************************************/
/* Prototypes for static methods in struct rtc_ops_s */
static int rx65n_rdtime(FAR struct rtc_lowerhalf_s *lower,
FAR struct rtc_time *rtctime);
static int rx65n_settime(FAR struct rtc_lowerhalf_s *lower,
FAR const struct rtc_time *rtctime);
static bool rx65n_havesettime(FAR struct rtc_lowerhalf_s *lower);
#ifdef CONFIG_RTC_ALARM
static int rx65n_setalarm(FAR struct rtc_lowerhalf_s *lower,
FAR const struct lower_setalarm_s *alarminfo);
static int rx65n_setrelative(FAR struct rtc_lowerhalf_s *lower,
FAR const struct lower_setrelative_s
*alarminfo);
static int rx65n_cancelalarm(FAR struct rtc_lowerhalf_s *lower,
int alarmid);
static int rx65n_rdalarm(FAR struct rtc_lowerhalf_s *lower,
FAR struct lower_rdalarm_s *alarminfo);
#endif
#ifdef CONFIG_RTC_PERIODIC
static int rx65n_setperiodic(FAR struct rtc_lowerhalf_s *lower,
FAR const struct lower_setperiodic_s
*alarminfo);
static int rx65n_cancelperiodic(FAR struct rtc_lowerhalf_s *lower, int id);
#endif
/****************************************************************************
* Private Data
****************************************************************************/
/* RX65N RTC driver operations */
static const struct rtc_ops_s g_rtc_ops =
{
.rdtime = rx65n_rdtime,
.settime = rx65n_settime,
.havesettime = rx65n_havesettime,
#ifdef CONFIG_RTC_ALARM
.setalarm = rx65n_setalarm,
.setrelative = rx65n_setrelative,
.cancelalarm = rx65n_cancelalarm,
.rdalarm = rx65n_rdalarm,
#endif
#ifdef CONFIG_RTC_PERIODIC
.setperiodic = rx65n_setperiodic,
.cancelperiodic = rx65n_cancelperiodic,
#endif
#ifdef CONFIG_RTC_IOCTL
.ioctl = NULL,
#endif
#ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS
.destroy = NULL,
#endif
};
/* RX65N RTC device state */
static struct rx65n_lowerhalf_s g_rtc_lowerhalf =
{
.ops = &g_rtc_ops,
};
/****************************************************************************
* Private Functions
****************************************************************************/
/****************************************************************************
* Name: rx65n_alarm_callback
*
* Description:
* This is the function that is called from the RTC driver when the alarm
* goes off. It just invokes the upper half drivers callback.
*
* Input Parameters:
* None
*
* Returned Value:
* None
*
****************************************************************************/
#ifdef CONFIG_RTC_ALARM
static void rx65n_alarm_callback(FAR void *arg, unsigned int alarmid)
{
FAR struct rx65n_lowerhalf_s *lower;
FAR struct rx65n_cbinfo_s *cbinfo;
rtc_alarm_callback_t cb;
FAR void *priv;
DEBUGASSERT(arg != NULL);
lower = (struct rx65n_lowerhalf_s *)arg;
cbinfo = &lower->cbinfo[alarmid];
/* Sample and clear the callback information to minimize the window in
* time in which race conditions can occur.
*/
cb = (rtc_alarm_callback_t)cbinfo->cb;
priv = (FAR void *)cbinfo->priv;
cbinfo->cb = NULL;
cbinfo->priv = NULL;
/* Perform the callback */
if (cb != NULL)
{
cb(priv, alarmid);
}
}
#endif /* CONFIG_RTC_ALARM */
/****************************************************************************
* Name: rx65n_rdtime
*
* Description:
* Implements the rdtime() method of the RTC driver interface
*
* Input Parameters:
* lower - A reference to RTC lower half driver state structure
* rtctime - The location in which to return the current RTC time.
*
* Returned Value:
* Zero (OK) is returned on success; a negated errno value is returned
* on any failure.
*
****************************************************************************/
static int rx65n_rdtime(FAR struct rtc_lowerhalf_s *lower,
FAR struct rtc_time *rtctime)
{
#if defined(CONFIG_RTC_DATETIME)
/* This operation depends on the fact that struct rtc_time is cast
* compatible with struct tm.
*/
return up_rtc_getdatetime((FAR struct tm *)rtctime);
#elif defined(CONFIG_RTC_HIRES)
FAR struct timespec ts;
int ret;
/* Get the higher resolution time */
ret = up_rtc_gettime(&ts);
if (ret < 0)
{
goto errout_with_errno;
}
/* Convert the one second epoch time to a struct tm. This operation
* depends on the fact that struct rtc_time and struct tm are cast
* compatible.
*/
if (!gmtime_r(&ts.tv_sec, (FAR struct tm *)rtctime))
{
goto errout_with_errno;
}
return OK;
errout_with_errno:
ret = get_errno();
DEBUGASSERT(ret > 0);
return -ret;
}
/****************************************************************************
* Name: rx65n_settime
*
* Description:
* Implements the settime() method of the RTC driver interface
*
* Input Parameters:
* lower - A reference to RTC lower half driver state structure
* rcttime - The new time to set
*
* Returned Value:
* Zero (OK) is returned on success; a negated errno value is returned
* on any failure.
*
****************************************************************************/
static int rx65n_settime(FAR struct rtc_lowerhalf_s *lower,
FAR const struct rtc_time *rtctime)
{
#ifdef CONFIG_RTC_DATETIME
/* This operation depends on the fact that struct rtc_time is cast
* compatible with struct tm.
*/
return rx65n_rtc_setdatetime((FAR const struct tm *)rtctime);
#else
struct timespec ts;
/* Convert the struct rtc_time to a time_t. Here we assume that struct
* rtc_time is cast compatible with struct tm.
*/
ts.tv_sec = mktime((FAR struct tm *)rtctime);
ts.tv_nsec = 0;
/* Now set the time (to one second accuracy) */
return up_rtc_settime(&ts);
#endif
}
/****************************************************************************
* Name: rx65n_havesettime
*
* Description:
* Implements the havesettime() method of the RTC driver interface
*
* Input Parameters:
* lower - A reference to RTC lower half driver state structure
*
* Returned Value:
* Returns true if RTC date-time have been previously set.
*
****************************************************************************/
static bool rx65n_havesettime(FAR struct rtc_lowerhalf_s *lower)
{
return true ;
}
/****************************************************************************
* Name: rx65n_setalarm
*
* Description:
* Set a new alarm. This function implements the setalarm() method of the
* RTC driver interface
*
* Input Parameters:
* lower - A reference to RTC lower half driver state structure
* alarminfo - Provided information needed to set the alarm
*
* Returned Value:
* Zero (OK) is returned on success; a negated errno value is returned
* on any failure.
*
****************************************************************************/
#ifdef CONFIG_RTC_ALARM
static int rx65n_setalarm(FAR struct rtc_lowerhalf_s *lower,
FAR const struct lower_setalarm_s *alarminfo)
{
FAR struct rx65n_lowerhalf_s *priv;
FAR struct rx65n_cbinfo_s *cbinfo;
struct alm_setalarm_s lowerinfo;
int ret;
DEBUGASSERT(lower != NULL && alarminfo != NULL && alarminfo->id == 0);
priv = (FAR struct rx65n_lowerhalf_s *)lower;
ret = nxsem_wait(&priv->devsem);
if (ret < 0)
{
return ret;
}
ret = -EINVAL;
if (alarminfo->id == 0)
{
cbinfo = &priv->cbinfo[0];
cbinfo->cb = alarminfo->cb;
cbinfo->priv = alarminfo->priv;
cbinfo->id = alarminfo->id;
/* Set the alarm */
lowerinfo.as_id = alarminfo->id;
lowerinfo.as_cb = rx65n_alarm_callback;
lowerinfo.as_arg = priv;
memcpy(&lowerinfo.as_time, &alarminfo->time, sizeof(struct tm));
/* And set the alarm */
ret = rx65n_rtc_setalarm(&lowerinfo);
if (ret < 0)
{
cbinfo->cb = NULL;
cbinfo->priv = NULL;
}
}
nxsem_post(&priv->devsem);
return ret;
}
#endif
/****************************************************************************
* Name: rx65n_setrelative
*
* Description:
* Set a new alarm relative to the current time. This function implements
* the setrelative() method of the RTC driver interface
*
* Input Parameters:
* lower - A reference to RTC lower half driver state structure
* alarminfo - Provided information needed to set the alarm
*
* Returned Value:
* Zero (OK) is returned on success; a negated errno value is returned
* on any failure.
*
****************************************************************************/
#ifdef CONFIG_RTC_ALARM
static int rx65n_setrelative(FAR struct rtc_lowerhalf_s *lower,
FAR const struct lower_setrelative_s
*alarminfo)
{
struct lower_setalarm_s setalarm;
struct tm time;
struct timespec rtc_time;
time_t seconds;
int ret = -EINVAL;
DEBUGASSERT(lower != NULL && alarminfo != NULL);
if ((alarminfo->id >= 0) && alarminfo->reltime > 0)
{
/* Disable pre-emption while we do this so that we don't have to worry
* about being suspended and working on an old time.
*/
sched_lock();
#if defined(CONFIG_RTC_DATETIME)
/* Get the broken out time and convert to seconds */
ret = up_rtc_getdatetime(&time);
if (ret < 0)
{
sched_unlock();
return ret;
}
ts.tv_sec = mktime(&time);
ts.tv_nsec = 0;
#elif defined(CONFIG_RTC_HIRES)
/* Get the higher resolution time */
ret = up_rtc_gettime(&rtc_time);
if (ret >= 0)
{
/* Convert to seconds since the epoch */
seconds = mktime(&time);
/* Add the seconds offset. Add one to the number of seconds
* because we are unsure of the phase of the timer.
*/
seconds += (alarminfo->reltime + 1);
/* And convert the time back to broken out format */
(void)gmtime_r(&seconds, (FAR struct tm *)&setalarm.time);
/* The set the alarm using this absolute time */
setalarm.id = alarminfo->id;
setalarm.cb = alarminfo->cb;
setalarm.priv = alarminfo->priv;
ret = rx65n_setalarm(lower, &setalarm);
}
#else
/* The resolution of time is only 1 second */
ts.tv_sec = up_rtc_time();
ts.tv_nsec = 0;
#endif
/* Remember the callback information */
sched_unlock();
}
return ret;
}
#endif
/****************************************************************************
* Name: rx65n_cancelalarm
*
* Description:
* Cancel the current alarm. This function implements the cancelalarm()
* method of the RTC driver interface
*
* Input Parameters:
* lower - A reference to RTC lower half driver state structure
* alarminfo - Provided information needed to set the alarm
*
* Returned Value:
* Zero (OK) is returned on success; a negated errno value is returned
* on any failure.
*
****************************************************************************/
#ifdef CONFIG_RTC_ALARM
static int rx65n_cancelalarm(FAR struct rtc_lowerhalf_s *lower, int alarmid)
{
FAR struct rx65n_lowerhalf_s *priv;
FAR struct rx65n_cbinfo_s *cbinfo;
DEBUGASSERT(lower != NULL);
DEBUGASSERT(alarmid == 0);
priv = (FAR struct rx65n_lowerhalf_s *)lower;
/* Nullify callback information to reduce window for race conditions */
cbinfo = &priv->cbinfo[0];
cbinfo->cb = NULL;
cbinfo->priv = NULL;
/* Then cancel the alarm */
return rx65n_rtc_cancelalarm();
}
#endif
/****************************************************************************
* Name: rx65n_rdalarm
*
* Description:
* Query the RTC alarm.
*
* Input Parameters:
* lower - A reference to RTC lower half driver state structure
* alarminfo - Provided information needed to query the alarm
*
* Returned Value:
* Zero (OK) is returned on success; a negated errno value is returned
* on any failure.
*
****************************************************************************/
#ifdef CONFIG_RTC_ALARM
static int rx65n_rdalarm(FAR struct rtc_lowerhalf_s *lower,
FAR struct lower_rdalarm_s *alarminfo)
{
struct alm_rdalarm_s lowerinfo;
int ret = -EINVAL;
DEBUGASSERT(lower != NULL && alarminfo != NULL && alarminfo->time != NULL);
if (alarminfo->id >= 0)
{
/* Disable pre-emption while we do this so that we don't have to worry
* about being suspended and working on an old time.
*/
sched_lock();
lowerinfo.ar_id = alarminfo->id;
lowerinfo.ar_time = alarminfo->time;
ret = rx65n_rtc_rdalarm(&lowerinfo);
sched_unlock();
}
return ret;
}
#endif
/****************************************************************************
* Name: rx65n_periodic_callback
*
* Description:
* This is the function that is called from the RTC driver when the periodic
* wakeup goes off. It just invokes the upper half drivers callback.
*
* Input Parameters:
* None
*
* Returned Value:
* None
*
****************************************************************************/
#ifdef CONFIG_RTC_PERIODIC
static int rx65n_periodic_callback(void)
{
FAR struct rx65n_lowerhalf_s *lower;
struct lower_setperiodic_s *cbinfo;
periodiccb_t cb;
FAR void *priv;
lower = (FAR struct rx65n_lowerhalf_s *)&g_rtc_lowerhalf;
cbinfo = &lower->periodic;
cb = (periodiccb_t)cbinfo->cb;
priv = (FAR void *)cbinfo->priv;
/* Perform the callback */
if (cb != NULL)
{
cb(priv, 0);
}
return OK;
}
#endif /* CONFIG_RTC_PERIODIC */
/****************************************************************************
* Name: rx65n_setperiodic
*
* Description:
* Set a new periodic wakeup relative to the current time, with a given
* period. This function implements the setperiodic() method of the RTC
* driver interface
*
* Input Parameters:
* lower - A reference to RTC lower half driver state structure
* alarminfo - Provided information needed to set the wakeup activity
*
* Returned Value:
* Zero (OK) is returned on success; a negated errno value is returned
* on any failure.
*
****************************************************************************/
#ifdef CONFIG_RTC_PERIODIC
static int rx65n_setperiodic(FAR struct rtc_lowerhalf_s *lower,
FAR const struct lower_setperiodic_s
*alarminfo)
{
FAR struct rx65n_lowerhalf_s *priv;
int ret;
DEBUGASSERT(lower != NULL && alarminfo != NULL);
priv = (FAR struct rx65n_lowerhalf_s *)lower;
ret = nxsem_wait(&priv->devsem);
if (ret < 0)
{
return ret;
}
memcpy(&priv->periodic, alarminfo, sizeof(struct lower_setperiodic_s));
ret = rx65n_rtc_setperiodic(&alarminfo->period,
(periodiccb_t)rx65n_periodic_callback);
nxsem_post(&priv->devsem);
return ret;
}
#endif
/****************************************************************************
* Name: rx65n_cancelperiodic
*
* Description:
* Cancel the current periodic wakeup activity. This function implements
* the cancelperiodic() method of the RTC driver interface
*
* Input Parameters:
* lower - A reference to RTC lower half driver state structure
*
* Returned Value:
* Zero (OK) is returned on success; a negated errno value is returned
* on any failure.
*
****************************************************************************/
#ifdef CONFIG_RTC_PERIODIC
static int rx65n_cancelperiodic(FAR struct rtc_lowerhalf_s *lower, int id)
{
FAR struct rx65n_lowerhalf_s *priv;
int ret;
DEBUGASSERT(lower != NULL);
priv = (FAR struct rx65n_lowerhalf_s *)lower;
DEBUGASSERT(id == 0);
ret = nxsem_wait(&priv->devsem);
if (ret < 0)
{
return ret;
}
ret = rx65n_rtc_cancelperiodic();
nxsem_post(&priv->devsem);
return ret;
}
#endif
/****************************************************************************
* Public Functions
****************************************************************************/
/****************************************************************************
* Name: rx65n_rtc_lowerhalf
*
* Description:
* Instantiate the RTC lower half driver for the RX65N. General usage:
*
* #include <nuttx/timers/rtc.h>
* #include "rx65n_rtc.h>
*
* struct rtc_lowerhalf_s *lower;
* lower = rx65n_rtc_lowerhalf();
* rtc_initialize(0, lower);
*
* Input Parameters:
* None
*
* Returned Value:
* On success, a non-NULL RTC lower interface is returned. NULL is
* returned on any failure.
*
****************************************************************************/
FAR struct rtc_lowerhalf_s *rx65n_rtc_lowerhalf(void)
{
nxsem_init(&g_rtc_lowerhalf.devsem, 0, 1);
return (FAR struct rtc_lowerhalf_s *)&g_rtc_lowerhalf;
}
#endif /* CONFIG_RTC_DRIVER */
#endif

View file

@ -1,35 +1,20 @@
/****************************************************************************
* arch/renesas/src/rx65n/rx65n_schedulesigaction.c
*
* Copyright (C) 2008-2019 Gregory Nutt. All rights reserved.
* Author: Anjana <anjana@tataelxsi.co.in>
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership. The
* ASF licenses this file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the
* License. You may obtain a copy of the License at
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* http://www.apache.org/licenses/LICENSE-2.0
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* 3. Neither the name NuttX nor the names of its contributors may be
* used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
****************************************************************************/
@ -51,7 +36,7 @@
#include "up_arch.h"
/****************************************************************************
* Public Funictions
* Public Functions
****************************************************************************/
/****************************************************************************

View file

@ -1,35 +1,20 @@
/****************************************************************************
* arch/renesas/src/rx65n/rx65n_sci.c
*
* Copyright (C) 2008-2019 Gregory Nutt. All rights reserved.
* Author: Anjana <anjana@tataelxsi.co.in>
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership. The
* ASF licenses this file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the
* License. You may obtain a copy of the License at
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* http://www.apache.org/licenses/LICENSE-2.0
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* 3. Neither the name NuttX nor the names of its contributors may be
* used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
****************************************************************************/
@ -1529,6 +1514,7 @@ MD_STATUS r_sci5_serial_receive(uint8_t * const rx_buf, uint16_t rx_num)
SCI5.SCR.BIT.RE = 1u;
return OK;
}
/****************************************************************************
* Name: r_sci5_serial_send
*
@ -2177,6 +2163,7 @@ MD_STATUS r_sci10_serial_receive(uint8_t * const rx_buf, uint16_t rx_num)
SCI10.SCR.BIT.RE = 1u;
return OK;
}
/****************************************************************************
* Name: r_sci10_serial_send
*

View file

@ -1,37 +1,22 @@
/****************************************************************************
* arch/renesas/src/rx65n/rx65n_serial.c
*
* Copyright (C) 2008-2019 Gregory Nutt. All rights reserved.
* Author: Anjana <anjana@tataelxsi.co.in>
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership. The
* ASF licenses this file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the
* License. You may obtain a copy of the License at
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* http://www.apache.org/licenses/LICENSE-2.0
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* 3. Neither the name NuttX nor the names of its contributors may be
* used to endorse or promote products derived from this software
* without specific prior written permission.
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
***************************************************************************/
****************************************************************************/
/****************************************************************************
* Included Files
@ -306,7 +291,7 @@ static void up_txint(struct uart_dev_s *dev, bool enable);
static bool up_txready(struct uart_dev_s *dev);
/****************************************************************************
* Public Function Prototypes
* Public Functions
****************************************************************************/
void up_enable_irq(int irq);
@ -409,15 +394,17 @@ static struct up_dev_s g_sci0priv =
static uart_dev_t g_sci0port =
{
.recv =
{
.size = CONFIG_SCI0_RXBUFSIZE,
.buffer = g_sci0rxbuffer,
},
{
.size = CONFIG_SCI0_RXBUFSIZE,
.buffer = g_sci0rxbuffer,
},
.xmit =
{
.size = CONFIG_SCI0_TXBUFSIZE,
.buffer = g_sci0txbuffer,
},
{
.size = CONFIG_SCI0_TXBUFSIZE,
.buffer = g_sci0txbuffer,
},
.ops = &g_sci_ops,
.priv = &g_sci0priv,
};
@ -443,15 +430,17 @@ static struct up_dev_s g_sci1priv =
static uart_dev_t g_sci1port =
{
.recv =
{
.size = CONFIG_SCI1_RXBUFSIZE,
.buffer = g_sci1rxbuffer,
},
{
.size = CONFIG_SCI1_RXBUFSIZE,
.buffer = g_sci1rxbuffer,
},
.xmit =
{
.size = CONFIG_SCI1_TXBUFSIZE,
.buffer = g_sci1txbuffer,
},
{
.size = CONFIG_SCI1_TXBUFSIZE,
.buffer = g_sci1txbuffer,
},
.ops = &g_sci_ops,
.priv = &g_sci1priv,
};
@ -477,15 +466,17 @@ static struct up_dev_s g_sci2priv =
static uart_dev_t g_sci2port =
{
.recv =
{
.size = CONFIG_SCI2_RXBUFSIZE,
.buffer = g_sci2rxbuffer,
},
{
.size = CONFIG_SCI2_RXBUFSIZE,
.buffer = g_sci2rxbuffer,
},
.xmit =
{
.size = CONFIG_SCI2_TXBUFSIZE,
.buffer = g_sci2txbuffer,
},
{
.size = CONFIG_SCI2_TXBUFSIZE,
.buffer = g_sci2txbuffer,
},
.ops = &g_sci_ops,
.priv = &g_sci2priv,
};
@ -511,15 +502,17 @@ static struct up_dev_s g_sci3priv =
static uart_dev_t g_sci3port =
{
.recv =
{
.size = CONFIG_SCI3_RXBUFSIZE,
.buffer = g_sci3rxbuffer,
},
{
.size = CONFIG_SCI3_RXBUFSIZE,
.buffer = g_sci3rxbuffer,
},
.xmit =
{
.size = CONFIG_SCI3_TXBUFSIZE,
.buffer = g_sci3txbuffer,
},
{
.size = CONFIG_SCI3_TXBUFSIZE,
.buffer = g_sci3txbuffer,
},
.ops = &g_sci_ops,
.priv = &g_sci3priv,
};
@ -545,15 +538,17 @@ static struct up_dev_s g_sci4priv =
static uart_dev_t g_sci4port =
{
.recv =
{
.size = CONFIG_SCI4_RXBUFSIZE,
.buffer = g_sci4rxbuffer,
},
{
.size = CONFIG_SCI4_RXBUFSIZE,
.buffer = g_sci4rxbuffer,
},
.xmit =
{
.size = CONFIG_SCI4_TXBUFSIZE,
.buffer = g_sci4txbuffer,
},
{
.size = CONFIG_SCI4_TXBUFSIZE,
.buffer = g_sci4txbuffer,
},
.ops = &g_sci_ops,
.priv = &g_sci4priv,
};
@ -579,15 +574,17 @@ static struct up_dev_s g_sci5priv =
static uart_dev_t g_sci5port =
{
.recv =
{
.size = CONFIG_SCI5_RXBUFSIZE,
.buffer = g_sci5rxbuffer,
},
{
.size = CONFIG_SCI5_RXBUFSIZE,
.buffer = g_sci5rxbuffer,
},
.xmit =
{
.size = CONFIG_SCI5_TXBUFSIZE,
.buffer = g_sci5txbuffer,
},
{
.size = CONFIG_SCI5_TXBUFSIZE,
.buffer = g_sci5txbuffer,
},
.ops = &g_sci_ops,
.priv = &g_sci5priv,
};
@ -613,15 +610,17 @@ static struct up_dev_s g_sci6priv =
static uart_dev_t g_sci6port =
{
.recv =
{
.size = CONFIG_SCI6_RXBUFSIZE,
.buffer = g_sci6rxbuffer,
},
{
.size = CONFIG_SCI6_RXBUFSIZE,
.buffer = g_sci6rxbuffer,
},
.xmit =
{
.size = CONFIG_SCI6_TXBUFSIZE,
.buffer = g_sci6txbuffer,
},
{
.size = CONFIG_SCI6_TXBUFSIZE,
.buffer = g_sci6txbuffer,
},
.ops = &g_sci_ops,
.priv = &g_sci6priv,
};
@ -647,15 +646,17 @@ static struct up_dev_s g_sci7priv =
static uart_dev_t g_sci7port =
{
.recv =
{
.size = CONFIG_SCI7_RXBUFSIZE,
.buffer = g_sci7rxbuffer,
},
{
.size = CONFIG_SCI7_RXBUFSIZE,
.buffer = g_sci7rxbuffer,
},
.xmit =
{
.size = CONFIG_SCI7_TXBUFSIZE,
.buffer = g_sci7txbuffer,
},
{
.size = CONFIG_SCI7_TXBUFSIZE,
.buffer = g_sci7txbuffer,
},
.ops = &g_sci_ops,
.priv = &g_sci7priv,
};
@ -670,7 +671,7 @@ static struct up_dev_s g_sci8priv =
.xmitirq = RX65N_TXI8_IRQ,
.eriirq = RX65N_ERI8_IRQ,
.teiirq = RX65N_TEI8_IRQ,
.grpibase = RX65N_GRPBL6_ADDR,
.grpibase = RX65N_GRPBL1_ADDR,
.erimask = RX65N_GRPBL1_ERI8_MASK,
.teimask = RX65N_GRPBL1_TEI8_MASK,
.parity = CONFIG_SCI8_PARITY,
@ -681,15 +682,17 @@ static struct up_dev_s g_sci8priv =
static uart_dev_t g_sci8port =
{
.recv =
{
.size = CONFIG_SCI8_RXBUFSIZE,
.buffer = g_sci8rxbuffer,
},
{
.size = CONFIG_SCI8_RXBUFSIZE,
.buffer = g_sci8rxbuffer,
},
.xmit =
{
.size = CONFIG_SCI8_TXBUFSIZE,
.buffer = g_sci8txbuffer,
},
{
.size = CONFIG_SCI8_TXBUFSIZE,
.buffer = g_sci8txbuffer,
},
.ops = &g_sci_ops,
.priv = &g_sci8priv,
};
@ -715,15 +718,17 @@ static struct up_dev_s g_sci9priv =
static uart_dev_t g_sci9port =
{
.recv =
{
.size = CONFIG_SCI9_RXBUFSIZE,
.buffer = g_sci9rxbuffer,
},
{
.size = CONFIG_SCI9_RXBUFSIZE,
.buffer = g_sci9rxbuffer,
},
.xmit =
{
.size = CONFIG_SCI9_TXBUFSIZE,
.buffer = g_sci9txbuffer,
},
{
.size = CONFIG_SCI9_TXBUFSIZE,
.buffer = g_sci9txbuffer,
},
.ops = &g_sci_ops,
.priv = &g_sci9priv,
};
@ -749,15 +754,17 @@ static struct up_dev_s g_sci10priv =
static uart_dev_t g_sci10port =
{
.recv =
{
.size = CONFIG_SCI10_RXBUFSIZE,
.buffer = g_sci10rxbuffer,
},
{
.size = CONFIG_SCI10_RXBUFSIZE,
.buffer = g_sci10rxbuffer,
},
.xmit =
{
.size = CONFIG_SCI10_TXBUFSIZE,
.buffer = g_sci10txbuffer,
},
{
.size = CONFIG_SCI10_TXBUFSIZE,
.buffer = g_sci10txbuffer,
},
.ops = &g_sci_ops,
.priv = &g_sci10priv,
};
@ -783,15 +790,17 @@ static struct up_dev_s g_sci11priv =
static uart_dev_t g_sci11port =
{
.recv =
{
.size = CONFIG_SCI11_RXBUFSIZE,
.buffer = g_sci11rxbuffer,
},
{
.size = CONFIG_SCI11_RXBUFSIZE,
.buffer = g_sci11rxbuffer,
},
.xmit =
{
.size = CONFIG_SCI11_TXBUFSIZE,
.buffer = g_sci11txbuffer,
},
{
.size = CONFIG_SCI11_TXBUFSIZE,
.buffer = g_sci11txbuffer,
},
.ops = &g_sci_ops,
.priv = &g_sci11priv,
};
@ -817,15 +826,17 @@ static struct up_dev_s g_sci12priv =
static uart_dev_t g_sci12port =
{
.recv =
{
.size = CONFIG_SCI12_RXBUFSIZE,
.buffer = g_sci12rxbuffer,
},
{
.size = CONFIG_SCI12_RXBUFSIZE,
.buffer = g_sci12rxbuffer,
},
.xmit =
{
.size = CONFIG_SCI12_TXBUFSIZE,
.buffer = g_sci12txbuffer,
},
{
.size = CONFIG_SCI12_TXBUFSIZE,
.buffer = g_sci12txbuffer,
},
.ops = &g_sci_ops,
.priv = &g_sci12priv,
};
@ -1429,6 +1440,7 @@ static void up_txint(struct uart_dev_s *dev, bool enable)
* in this event, priv->scr should hold the correct value upon
* return from uuart_xmitchars().
*/
uart_xmitchars(dev);
}
}

View file

@ -1,37 +1,22 @@
/****************************************************************************
* arch/renesas/src/rx65n/rx65n_vector_table.c
*
* Copyright (C) 2008-2019 Gregory Nutt. All rights reserved.
* Author: Anjana <anjana@tataelxsi.co.in>
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership. The
* ASF licenses this file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the
* License. You may obtain a copy of the License at
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* http://www.apache.org/licenses/LICENSE-2.0
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* 3. Neither the name NuttX nor the names of its contributors may be
* used to endorse or promote products derived from this software
* without specific prior written permission.
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
***************************************************************************/
****************************************************************************/
/****************************************************************************
* Included Files
@ -181,6 +166,7 @@ void r_access_exception(void)
__asm("nop");
#endif
}
/****************************************************************************
* Name: r_floatingpoint_exception
*

View file

@ -11,6 +11,8 @@ Contents
- Serial Console
- LEDs
- Networking
- RTC
- Debugging
Board Features
@ -219,6 +221,22 @@ Configure UDP blaster application as mentioned below :
CONFIG_EXAMPLES_UDPBLASTER_HOSTIP=0x0a4b1801 (10.75.24.1) ------> Gateway IP
CONFIG_EXAMPLES_UDPBLASTER_NETMASK=0xfffffe00 (255.255.254.0) --------> Netmask
CONFIG_EXAMPLES_UDPBLASTER_TARGETIP=0x0a4b189b (10.75.24.155) ---------> Target IP
RTC
==========
NuttX Configurations
---------------
The configurations listed in Renesas_RX65N_NuttX_RTC_Design.doc need to be enabled.
RTC Testing
------------------
The test cases mentioned in Renesas_RX65N_RTC_Test_Cases.xls are to be executed
as part of RTC testing.
The following configurations are to be enabled as part of testing RTC examples.
CONFIG_EXAMPLES_ALARM
CONFIG_EXAMPLES_PERIODIC
CONFIG_EXAMPLES_CARRY
Debugging
==========
@ -252,3 +270,8 @@ endif
Select Motorola SREC format.
4. Download Renesas flash programmer tool from https://www.renesas.com/in/en/products/software-tools/tools/programmer/renesas-flash-programmer-programming-gui.html#downloads
5. Refer to the user manual document, for steps to flash NuttX binary using RFP tool.
Changes Made in NuttX 8.2 Code
================================
1. In wd_start.c file, in function wd_expiration(), typecasting is done when the signal handler nxsig_timeout() is invoked.
2. In rtc.c, (drivers/timers/rtc.c) file, in function rtc_periodic_callback(), alarminfo->active = false is commented.
The reason being, periodic interrupt should not be disabled. Uncommenting the above mentioned line (alarminfo->active = false), will make the periodic interrupt come only once.

View file

@ -5,58 +5,72 @@
# You can then do "make savedefconfig" to generate a new defconfig file that includes your
# modifications.
#
CONFIG_ARCH="renesas"
CONFIG_ARCH_BOARD="rx65n-grrose"
CONFIG_ARCH_BOARD_RX65N_GRROSE=y
CONFIG_ARCH_CHIP="rx65n"
CONFIG_ARCH_BOARD="rx65n-grrose"
CONFIG_ARCH_CHIP_R5F565NEHDFP=y
CONFIG_ARCH_INTERRUPTSTACK=1024
CONFIG_ARCH_RENESAS=y
CONFIG_ARCH_STACKDUMP=y
CONFIG_ARCH="renesas"
CONFIG_ARCH_CHIP="rx65n"
CONFIG_BOARD_LOOPSPERMSEC=15001
CONFIG_BUILTIN=y
CONFIG_DEBUG_FEATURES=y
CONFIG_EXAMPLES_SERIALBLASTER=y
CONFIG_EXAMPLES_SERIALRX=y
CONFIG_EXAMPLES_SERIALRX_PRINTSTR=y
CONFIG_EXAMPLES_SERIALRX_PRIORITY=75
CONFIG_FS_PROCFS=y
CONFIG_FS_PROCFS_REGISTER=y
CONFIG_MAX_TASKS=8
CONFIG_MOTOROLA_SREC=y
CONFIG_ENDIAN_LITTLE=y
CONFIG_SYSTEM_NSH=y
CONFIG_MAX_TASKS=8
CONFIG_DEBUG_FEATURES=y
CONFIG_ARCH_INTERRUPTSTACK=1024
CONFIG_BUILTIN=y
CONFIG_ETH0_PHY_LAN8720A=y
CONFIG_NET=y
CONFIG_NETDB_DNSCLIENT=y
CONFIG_NETDB_DNSSERVER_NOADDR=y
CONFIG_NETDEV_PHY_IOCTL=y
CONFIG_NETDEV_STATISTICS=y
CONFIG_NETINIT_DHCPC=y
CONFIG_NETUTILS_DHCPC=y
CONFIG_NETUTILS_DHCPD=y
CONFIG_NETUTILS_TFTPC=y
CONFIG_NETUTILS_WEBCLIENT=y
CONFIG_NET_ARP_SEND=y
CONFIG_NET_BROADCAST=y
CONFIG_NET_ICMP=y
CONFIG_NET_ICMP_SOCKET=y
CONFIG_NET_SOCKOPTS=y
CONFIG_NET_STATISTICS=y
CONFIG_NET_TCP=y
CONFIG_NET_TCPBACKLOG=y
CONFIG_NET_TCP_WRITE_BUFFERS=y
CONFIG_NET_UDP=y
CONFIG_NSH_BUILTIN_APPS=y
CONFIG_NFILE_DESCRIPTORS=8
CONFIG_NFILE_STREAMS=8
CONFIG_NSH_BUILTIN_APPS=y
CONFIG_NSH_FILEIOSIZE=512
CONFIG_NSH_LINELEN=64
CONFIG_NSH_READLINE=y
CONFIG_NUNGET_CHARS=0
CONFIG_PREALLOC_TIMERS=0
CONFIG_PTHREAD_STACK_DEFAULT=1024
CONFIG_RAM_SIZE=655360
CONFIG_RAM_SIZE=262144
CONFIG_RAM_START=0x00000000
CONFIG_RAW_BINARY=y
CONFIG_RX65N_SCI0=y
CONFIG_RX65N_SCI1=y
CONFIG_RX65N_SCI2=y
CONFIG_RX65N_SCI5=y
CONFIG_RX65N_SCI6=y
CONFIG_RX65N_SCI8=y
CONFIG_SCI0_SERIALDRIVER=y
CONFIG_SCI0_BAUD=115200
CONFIG_SCI1_SERIAL_CONSOLE=y
CONFIG_SCI1_SERIALDRIVER=y
CONFIG_SCI1_BAUD=115200
CONFIG_SCI2_SERIALDRIVER=y
CONFIG_SCI2_BAUD=115200
CONFIG_SCI5_SERIALDRIVER=y
CONFIG_SCI5_BAUD=921600
CONFIG_SCI6_SERIALDRIVER=y
CONFIG_SCI6_BAUD=115200
CONFIG_SCI8_SERIALDRIVER=y
CONFIG_SCI8_BAUD=115200
CONFIG_RX65N_EMAC=y
CONFIG_RX65N_EMAC0=y
CONFIG_RX65N_EMAC0_PHYADDR=0
CONFIG_RX65N_EMAC0_PHYSR=30
CONFIG_RX65N_EMAC0_PHYSR_100FD=0x18
CONFIG_RX65N_EMAC0_PHYSR_100HD=0x08
@ -65,16 +79,42 @@ CONFIG_RX65N_EMAC0_PHYSR_10HD=0x04
CONFIG_RX65N_EMAC0_PHYSR_ALTCONFIG=y
CONFIG_RX65N_EMAC0_PHYSR_ALTMODE=0x1c
CONFIG_RX65N_EMAC0_RMII=y
CONFIG_RX65N_SCI0=y
CONFIG_RX65N_EMAC0_PHYADDR=0
CONFIG_SCHED_WORKQUEUE=y
CONFIG_SCHED_HPWORK=y
CONFIG_SCHED_LPWORK=y
CONFIG_SCI1_SERIAL_CONSOLE=y
CONFIG_SCI5_BAUD=921600
CONFIG_SDCLONE_DISABLE=y
CONFIG_STDIO_DISABLE_BUFFERING=y
CONFIG_SYSTEM_NSH=y
CONFIG_SYSTEM_NSH_PRIORITY=50
CONFIG_SYSTEM_PING=y
CONFIG_ICU=y
CONFIG_STDIO_DISABLE_BUFFERING=y
CONFIG_TASK_NAME_SIZE=0
CONFIG_USERMAIN_STACKSIZE=1024
CONFIG_USER_ENTRYPOINT="nsh_main"
CONFIG_USERMAIN_STACKSIZE=1024
CONFIG_IDLETHREAD_STACKSIZE=1024
CONFIG_FS_PROCFS=y
CONFIG_FS_PROCFS_REGISTER=y
CONFIG_NET_ETH_PKTSIZE = 590
CONFIG_RX65N_CMTW0=y
CONFIG_RX65N_PERIB=y
CONFIG_NETUTILS_DHCPC=y
CONFIG_NETUTILS_DHCPD=y
CONFIG_NSH_DHCPC=y
CONFIG_NETINIT_DHCPC=y
CONFIG_SYSTEM_NSH_PRIORITY=50
CONFIG_EXAMPLES_SERIALBLASTER=y
CONFIG_EXAMPLES_SERIALBLASTER_STACKSIZE=2048
CONFIG_EXAMPLES_SERIALBLASTER_PRIORITY=50
CONFIG_EXAMPLES_SERIALBLASTER_DEVPATH="/dev/ttyS2"
CONFIG_EXAMPLES_SERIALRX=y
CONFIG_EXAMPLES_SERIALRX_STACKSIZE=2048
CONFIG_EXAMPLES_SERIALRX_PRIORITY=75
CONFIG_EXAMPLES_SERIALRX_BUFSIZE=11520
CONFIG_EXAMPLES_SERIALRX_DEVPATH="/dev/ttyS0"
CONFIG_EXAMPLES_SERIALRX_PRINTSTR=y
CONFIG_RTC=y
CONFIG_RTC_HIRES=y
CONFIG_RTC_ALARM=y
CONFIG_RX65N_RTC=y
CONFIG_RX65N_CARRY=y
CONFIG_RTC_DRIVER=y
CONFIG_NSH_ARCHINIT=y

View file

@ -5,22 +5,24 @@
# You can then do "make savedefconfig" to generate a new defconfig file that includes your
# modifications.
#
CONFIG_ARCH="renesas"
CONFIG_ARCH_BOARD="rx65n-grrose"
CONFIG_ARCH_BOARD_RX65N_GRROSE=y
CONFIG_ARCH_CHIP="rx65n"
CONFIG_ARCH_BOARD="rx65n-grrose"
CONFIG_ARCH_CHIP_R5F565NEHDFP=y
CONFIG_ARCH_INTERRUPTSTACK=1024
CONFIG_ARCH_RENESAS=y
CONFIG_ARCH_STACKDUMP=y
CONFIG_ARCH="renesas"
CONFIG_ARCH_CHIP="rx65n"
CONFIG_BOARD_LOOPSPERMSEC=15001
CONFIG_BUILTIN=y
CONFIG_DEBUG_FEATURES=y
CONFIG_MAX_TASKS=8
CONFIG_MOTOROLA_SREC=y
CONFIG_ENDIAN_LITTLE=y
CONFIG_SYSTEM_NSH=y
CONFIG_MAX_TASKS=8
CONFIG_DEBUG_FEATURES=y
CONFIG_ARCH_INTERRUPTSTACK=1024
CONFIG_BUILTIN=y
CONFIG_NSH_BUILTIN_APPS=y
CONFIG_NFILE_DESCRIPTORS=8
CONFIG_NFILE_STREAMS=8
CONFIG_NSH_BUILTIN_APPS=y
CONFIG_NSH_FILEIOSIZE=512
CONFIG_NSH_LINELEN=64
CONFIG_NSH_READLINE=y
@ -31,10 +33,29 @@ CONFIG_RAM_SIZE=655360
CONFIG_RAM_START=0x00000000
CONFIG_RAW_BINARY=y
CONFIG_RX65N_SCI0=y
CONFIG_RX65N_SCI1=y
CONFIG_RX65N_SCI2=y
CONFIG_RX65N_SCI5=y
CONFIG_RX65N_SCI6=y
CONFIG_RX65N_SCI8=y
CONFIG_SCI0_SERIALDRIVER=y
CONFIG_SCI0_BAUD=115200
CONFIG_SCI1_SERIAL_CONSOLE=y
CONFIG_SCI1_SERIALDRIVER=y
CONFIG_SCI1_BAUD=115200
CONFIG_SCI2_SERIALDRIVER=y
CONFIG_SCI2_BAUD=115200
CONFIG_SCI5_SERIALDRIVER=y
CONFIG_SCI5_BAUD=115200
CONFIG_SCI6_SERIALDRIVER=y
CONFIG_SCI6_BAUD=115200
CONFIG_SCI8_SERIALDRIVER=y
CONFIG_SCI8_BAUD=115200
CONFIG_SDCLONE_DISABLE=y
CONFIG_ICU=y
CONFIG_STDIO_DISABLE_BUFFERING=y
CONFIG_SYSTEM_NSH=y
CONFIG_TASK_NAME_SIZE=0
CONFIG_USERMAIN_STACKSIZE=1024
CONFIG_USER_ENTRYPOINT="nsh_main"
CONFIG_USERMAIN_STACKSIZE=1024
CONFIG_IDLETHREAD_STACKSIZE=1024

View file

@ -0,0 +1,89 @@
README
======
Overview
--------
This directory contains logic to support a custom ROMFS start-up script.
This startup script is used by by the NSH when it starts provided that
CONFIG_NSH_ARCHROMFS=y. The script provides a ROMFS volume that will be
mounted at /etc and will look like this at run-time:
NuttShell (NSH) NuttX-8.2
nsh> ls -l /etc
/etc:
dr-xr-xr-x 0 .
-r--r--r-- 20 group
dr-xr-xr-x 0 init.d/
-r--r--r-- 35 passwd
/etc/init.d:
dr-xr-xr-x 0 ..
-r--r--r-- 110 rcS
nsh>
/etc/init.d/rcS is the start-up script; /etc/passwd is a the password
file. It supports a single user:
USERNAME: admin
PASSWORD: Adminstrator
nsh> cat /etc/passwd
admin:8Tv+Hbmr3pLddSjtzL0kwC:0:0:/
The encrypted passwords in the provided passwd file are only valid if the
TEA key is set to: 012345678 9abcdef0 012345678 9abcdef0. Changes to either
the key or the password word will require regeneration of the nsh_romfimg.h
header file.
The format of the password file is:
user:x:uid:gid:home
Where:
user: User name
x: Encrypted password
uid: User ID (0 for now)
gid: Group ID (0 for now)
home: Login directory (/ for now)
/etc/group is a group file. It is not currently used.
nsh> cat /etc/group
root:*:0:root,admin
The format of the group file is:
group:x:gid:users
Where:
group: The group name
x: Group password
gid: Group ID
users: A comma separated list of members of the group
/etc/init.d/rcS should have the following contents :
vi rcS
echo "This is NuttX"
Updating the ROMFS File System
------------------------------
The content on the nsh_romfsimg.h header file is generated from a sample
directory structure. That directory structure is contained in the etc/ directory and can be modified per the following steps:
1. Change directory to etc/:
cd etc/
2. Make modifications as desired.
3. Create the new ROMFS image.
genromfs -f romfs_img -d etc -V SimEtcVol
4. Convert the ROMFS image to a C header file
xxd -i romfs_img >nsh_romfsimg.h
5. Edit nsh_romfsimg.h, mark both data definitions as 'const' so that
that will be stored in FLASH.

View file

@ -1,44 +1,29 @@
/***************************************************************************
/****************************************************************************
* boards/renesas/rx65n/rx65n-grrose/include/board.h
*
* Copyright (C) 2008-2019 Gregory Nutt. All rights reserved.
* Author: Anjana <anjana@tataelxsi.co.in>
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership. The
* ASF licenses this file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the
* License. You may obtain a copy of the License at
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* http://www.apache.org/licenses/LICENSE-2.0
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* 3. Neither the name NuttX nor the names of its contributors may be
* used to endorse or promote products derived from this software
* without specific prior written permission.
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
***************************************************************************/
****************************************************************************/
#ifndef __BOARDS_RENESAS_RX65N_RX65N_GRROSE_INCLUDE_BOARD_H
#define __BOARDS_RENESAS_RX65N_RX65N_GRROSE_INCLUDE_BOARD_H
/***************************************************************************
/****************************************************************************
* Included Files
***************************************************************************/
****************************************************************************/
#ifndef __ASSEMBLY__
# include <stdint.h>
@ -46,9 +31,9 @@
/****************************************************************************
* Pre-processor Definitions
***************************************************************************/
****************************************************************************/
/* Clocking ****************************************************************/
/* Clocking *****************************************************************/
#define RX_CLK_1MHz (1000UL * 1000UL)
#define RX_FCLK ( 60 * RX_CLK_1MHz)
@ -137,10 +122,6 @@ extern "C"
#define EXTERN extern
#endif
/****************************************************************************
* Public Functions
****************************************************************************/
#undef EXTERN
#ifdef __cplusplus
}

View file

@ -26,10 +26,10 @@ SECTIONS
} > ROM
/* RSK-RX65N-1MB */
.text 0xFFF00000: AT(0xFFF00000)
/* .text 0xFFF00000: AT(0xFFF00000) */
/* RSK-RX65N-2MB | GR-ROSE */
/*.text 0xFFE00000: AT(0xFFE00000) */
.text 0xFFE00000: AT(0xFFE00000)
{
*(.text)
. = ALIGN(4);

View file

@ -1,35 +1,20 @@
############################################################################
# configs/rx65n-grrose/src/Makefile
#
# Copyright (C) 2008-2019 Gregory Nutt. All rights reserved.
# Author: Anjana <anjana@tataelxsi.co.in>
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership. The
# ASF licenses this file to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance with the
# License. You may obtain a copy of the License at
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# http://www.apache.org/licenses/LICENSE-2.0
#
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in
# the documentation and/or other materials provided with the
# distribution.
# 3. Neither the name NuttX nor the names of its contributors may be
# used to endorse or promote products derived from this software
# without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
############################################################################
@ -41,7 +26,7 @@ CFLAGS += -I=$(ARCH_SRCDIR)/chip
ASRCS =
AOBJS = $(ASRCS:.asm=$(OBJEXT))
CSRCS = rx65n_main.c
CSRCS = rx65n_appinit.c rx65n_bringup.c
COBJS = $(CSRCS:.c=$(OBJEXT))
SRCS = $(ASRCS) $(CSRCS)

View file

@ -0,0 +1,81 @@
/****************************************************************************
* boards/renesas/rx65n/rx65n-grrose/src/rx65n_appinit.c
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership. The
* ASF licenses this file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the
* License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
****************************************************************************/
/****************************************************************************
* Included Files
****************************************************************************/
#include <nuttx/config.h>
#include <sys/types.h>
#include <stdint.h>
#include <nuttx/board.h>
#ifdef CONFIG_LIB_BOARDCTL
/****************************************************************************
* Public Functions
****************************************************************************/
/****************************************************************************
* Name: board_app_initialize
*
* Description:
* Perform application specific initialization. This function is never
* called directly from application code, but only indirectly via the
* (non-standard) boardctl() interface using the command BOARDIOC_INIT.
*
* CONFIG_LIB_BOARDCTL=y :
* Called from the NSH library
*
* CONFIG_BOARD_LATE_INITIALIZE=y, CONFIG_NSH_LIBRARY=y, &&
* CONFIG_LIB_BOARDCTL=n :
* Called from board_late_initialize().
*
* Input Parameters:
* arg - The boardctl() argument is passed to the board_app_initialize()
* implementation without modification. The argument has no
* meaning to NuttX; the meaning of the argument is a contract
* between the board-specific initialization logic and the
* matching application logic. The value cold be such things as a
* mode enumeration value, a set of DIP switch switch settings, a
* pointer to configuration data read from a file or serial FLASH,
* or whatever you would like to do with it. Every implementation
* should accept zero/NULL as a default configuration.
*
* Returned Value:
* Zero (OK) is returned on success; a negated errno value is returned on
* any failure to indicate the nature of the failure.
*
****************************************************************************/
int board_app_initialize(uintptr_t arg)
{
/* Did we already initialize via board_late_initialize()? */
#ifndef CONFIG_BOARD_LATE_INITIALIZE
return rx65n_bringup();
#else
return OK;
#endif
}
#endif /* CONFIG_LIB_BOARDCTL */

View file

@ -0,0 +1,216 @@
/****************************************************************************
* boards/renesas/rx65n/rx65n-grrose/src/rx65n_bringup.c
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership. The
* ASF licenses this file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the
* License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
****************************************************************************/
/****************************************************************************
* Included Files
****************************************************************************/
#include <nuttx/config.h>
#include <nuttx/config.h>
#include <sys/types.h>
#include <sys/mount.h>
#include <syslog.h>
#include <errno.h>
#include <debug.h>
#include <nuttx/board.h>
#include <rx65n_definitions.h>
#ifdef CONFIG_LIB_BOARDCTL
#ifdef HAVE_RTC_DRIVER
# include <nuttx/timers/rtc.h>
# include "rx65n_rtc.h"
#endif
/****************************************************************************
* Public Functions
****************************************************************************/
/****************************************************************************
* Name: rtc_driver_initialize
*
* Description:
* Initialize and register the RTC driver.
*
****************************************************************************/
#ifdef HAVE_RTC_DRIVER
static int rtc_driver_initialize(void)
{
FAR struct rtc_lowerhalf_s *lower;
int ret;
/* Instantiate the rx65n lower-half RTC driver */
lower = rx65n_rtc_lowerhalf();
if (lower == NULL)
{
serr("ERROR: Failed to instantiate the RTC lower-half driver\n");
ret = -ENOMEM;
}
else
{
/* Bind the lower half driver and register the combined RTC driver
* as /dev/rtc0
*/
ret = rtc_initialize(0, lower);
if (ret < 0)
{
serr("ERROR: Failed to bind/register the RTC driver: %d\n", ret);
}
}
return ret;
}
#endif
/****************************************************************************
* Name: rx65n_bringup
*
* Description:
* Perform architecture-specific initialization
*
* CONFIG_BOARD_LATE_INITIALIZE=y :
* Called from board_late_initialize().
*
* CONFIG_BOARD_LATE_INITIALIZE=n && CONFIG_LIB_BOARDCTL=y :
* Called from the NSH library
*
****************************************************************************/
int rx65n_bringup(void)
{
int ret;
#ifdef HAVE_RTC_DRIVER
ret = rtc_driver_initialize();
if (ret < 0)
{
syslog(LOG_ERR, "ERROR: rtc_driver_initialize failed: %d\n", ret);
}
#endif
#ifdef CONFIG_FS_PROCFS
/* Mount the procfs file system */
ret = mount(NULL, "/proc", "procfs", 0, NULL);
if (ret < 0)
{
syslog(LOG_ERR,
"ERROR: Failed to mount the PROC filesystem: %d (%d)\n",
ret, errno);
}
#endif
return OK;
}
#if defined (CONFIG_ARCH_HAVE_LEDS) && (CONFIG_ARCH_LEDS)
/****************************************************************************
* Public Functions
****************************************************************************/
/****************************************************************************
* Name: board_autoled1_on
*
* Description:
* Turns on LED 0
*
****************************************************************************/
void board_autoled1_on(int led)
{
LED0 = LED_ON;
}
/****************************************************************************
* Name: board_autoled2_on
*
* Description:
* Turns on LED 1
*
****************************************************************************/
void board_autoled2_on(int led)
{
LED1 = LED_ON;
}
/****************************************************************************
* Name: board_autoled_on
*
* Description:
* Turns on LED 0 & LED 1
*
****************************************************************************/
void board_autoled_on(int led)
{
LED0 = LED_ON;
LED1 = LED_ON;
}
/****************************************************************************
* Name: board_autoled1_off
*
* Description:
* Turns off LED 0
*
****************************************************************************/
void board_autoled1_off(int led)
{
LED0 = LED_OFF;
}
/****************************************************************************
* Name: board_autoled2_off
*
* Description:
* Turns off LED 1
*
****************************************************************************/
void board_autoled2_off(int led)
{
LED1 = LED_OFF;
}
/****************************************************************************
* Name: board_autoled_off
*
* Description:
* Turns off LED 0 & LED 1
*
****************************************************************************/
void board_autoled_off(int led)
{
LED0 = LED_OFF;
LED1 = LED_OFF;
}
#endif
#endif

View file

@ -1,126 +0,0 @@
/****************************************************************************
* configs/rx65n-grrose/src/rx65n.main.c
*
* Copyright (C) 2008-2019 Gregory Nutt. All rights reserved.
* Author: Anjana <anjana@tataelxsi.co.in>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* 3. Neither the name NuttX nor the names of its contributors may be
* used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
****************************************************************************/
/****************************************************************************
*Included files
***************************************************************************/
#include "rx65n_macrodriver.h"
#include "arch/board/board.h"
#include "rx65n_definitions.h"
/****************************************************************************
* Public Functions
****************************************************************************/
/****************************************************************************
* Name: board_autoled1_on
*
* Description:
* Turns on LED 0
*
****************************************************************************/
void board_autoled1_on(int led)
{
LED0 = LED_ON;
}
/****************************************************************************
* Name: board_autoled2_on
*
* Description:
* Turns on LED 1
*
****************************************************************************/
void board_autoled2_on(int led)
{
LED1 = LED_ON;
}
/****************************************************************************
* Name: board_autoled_on
*
* Description:
* Turns on LED 0 & LED 1
*
****************************************************************************/
void board_autoled_on(int led)
{
LED0 = LED_ON;
LED1 = LED_ON;
}
/****************************************************************************
* Name: board_autoled1_off
*
* Description:
* Turns off LED 0
*
****************************************************************************/
void board_autoled1_off(int led)
{
LED0 = LED_OFF;
}
/****************************************************************************
* Name: board_autoled2_off
*
* Description:
* Turns off LED 1
*
****************************************************************************/
void board_autoled2_off(int led)
{
LED1 = LED_OFF;
}
/****************************************************************************
* Name: board_autoled_off
*
* Description:
* Turns off LED 0 & LED 1
*
****************************************************************************/
void board_autoled_off(int led)
{
LED0 = LED_OFF;
LED1 = LED_OFF;
}

View file

@ -11,6 +11,7 @@ Contents
- Serial Console
- LEDs
- Networking
- RTC
- Debugging
Board Features
@ -177,6 +178,22 @@ Configure UDP blaster application as mentioned below :
CONFIG_EXAMPLES_UDPBLASTER_HOSTIP=0x0a4b1801 (10.75.24.1) ------> Gateway IP
CONFIG_EXAMPLES_UDPBLASTER_NETMASK=0xfffffe00 (255.255.254.0) --------> Netmask
CONFIG_EXAMPLES_UDPBLASTER_TARGETIP=0x0a4b189b (10.75.24.155) ---------> Target IP
RTC
==========
NuttX Configurations
---------------
The configurations listed in Renesas_RX65N_NuttX_RTC_Design.doc need to be enabled.
RTC Testing
------------------
The test cases mentioned in Renesas_RX65N_RTC_Test_Cases.xls are to be executed
as part of RTC testing.
The following configurations are to be enabled as part of testing RTC examples.
CONFIG_EXAMPLES_ALARM
CONFIG_EXAMPLES_PERIODIC
CONFIG_EXAMPLES_CARRY
Debugging
==========
@ -210,3 +227,8 @@ endif
Select Motorola SREC format.
4. Download Renesas flash programmer tool from https://www.renesas.com/in/en/products/software-tools/tools/programmer/renesas-flash-programmer-programming-gui.html#downloads
5. Refer to the user manual document, for steps to flash NuttX binary using RFP tool.
Changes Made in NuttX 8.2 Code
================================
1. In wd_start.c file, in function wd_expiration(), typecasting is done when the signal handler nxsig_timeout() is invoked.
2. In rtc.c, (drivers/timers/rtc.c) file, in function rtc_periodic_callback(), alarminfo->active = false is commented.
The reason being, periodic interrupt should not be disabled. Uncommenting the above mentioned line (alarminfo->active = false), will make the periodic interrupt come only once.

View file

@ -5,58 +5,60 @@
# You can then do "make savedefconfig" to generate a new defconfig file that includes your
# modifications.
#
CONFIG_ARCH="renesas"
CONFIG_ARCH_BOARD="rx65n-rsk2mb"
CONFIG_ARCH_BOARD_RX65N_RSK2MB=y
CONFIG_ARCH_CHIP="rx65n"
CONFIG_ARCH_BOARD="rx65n"
CONFIG_ARCH_CHIP_R5F565NEHDFC=y
CONFIG_ARCH_INTERRUPTSTACK=1024
CONFIG_ARCH_RENESAS=y
CONFIG_ARCH_STACKDUMP=y
CONFIG_ARCH="renesas"
CONFIG_ARCH_CHIP="rx65n"
CONFIG_BOARD_LOOPSPERMSEC=15001
CONFIG_BUILTIN=y
CONFIG_DEBUG_FEATURES=y
CONFIG_EXAMPLES_SERIALBLASTER=y
CONFIG_EXAMPLES_SERIALRX=y
CONFIG_EXAMPLES_SERIALRX_PRINTSTR=y
CONFIG_EXAMPLES_SERIALRX_PRIORITY=75
CONFIG_FS_PROCFS=y
CONFIG_FS_PROCFS_REGISTER=y
CONFIG_MAX_TASKS=8
CONFIG_MOTOROLA_SREC=y
CONFIG_ENDIAN_LITTLE=y
CONFIG_SYSTEM_NSH=y
CONFIG_MAX_TASKS=8
CONFIG_DEBUG_FEATURES=y
CONFIG_ARCH_INTERRUPTSTACK=1024
CONFIG_BUILTIN=y
CONFIG_ETH0_PHY_DP83620=y
CONFIG_NET=y
CONFIG_NETDB_DNSCLIENT=y
CONFIG_NETDB_DNSSERVER_NOADDR=y
CONFIG_NETDEV_PHY_IOCTL=y
CONFIG_NETDEV_STATISTICS=y
CONFIG_NETINIT_DHCPC=y
CONFIG_NETUTILS_DHCPC=y
CONFIG_NETUTILS_DHCPD=y
CONFIG_NETUTILS_TFTPC=y
CONFIG_NETUTILS_WEBCLIENT=y
CONFIG_NET_ARP_SEND=y
CONFIG_NET_BROADCAST=y
CONFIG_NET_ICMP=y
CONFIG_NET_ICMP_SOCKET=y
CONFIG_NET_SOCKOPTS=y
CONFIG_NET_STATISTICS=y
CONFIG_NET_TCP=y
CONFIG_NET_TCPBACKLOG=y
CONFIG_NET_TCP_WRITE_BUFFERS=y
CONFIG_NET_UDP=y
CONFIG_NSH_BUILTIN_APPS=y
CONFIG_NFILE_DESCRIPTORS=8
CONFIG_NFILE_STREAMS=8
CONFIG_NSH_BUILTIN_APPS=y
CONFIG_NSH_FILEIOSIZE=512
CONFIG_NSH_LINELEN=64
CONFIG_NSH_READLINE=y
CONFIG_NUNGET_CHARS=0
CONFIG_PREALLOC_TIMERS=0
CONFIG_PTHREAD_STACK_DEFAULT=1024
CONFIG_RAM_SIZE=655360
CONFIG_RAM_SIZE=262144
CONFIG_RAM_START=0x00000000
CONFIG_RAMDISK_SIZE=393216
CONFIG_RAMDISK_START=0x00800000
CONFIG_RAW_BINARY=y
CONFIG_SCI2_SERIALDRIVER=y
CONFIG_RX65N_SCI2=y
CONFIG_SCI8_SERIALDRIVER=y
CONFIG_SCI8_SERIAL_CONSOLE=y
CONFIG_RX65N_SCI8=y
CONFIG_RX65N_EMAC=y
CONFIG_RX65N_EMAC0=y
CONFIG_RX65N_EMAC0_PHYADDR=30
CONFIG_RX65N_EMAC0_PHYSR=30
CONFIG_RX65N_EMAC0_PHYSR_100FD=0x4
CONFIG_RX65N_EMAC0_PHYSR_100HD=0x0
@ -64,16 +66,42 @@ CONFIG_RX65N_EMAC0_PHYSR_10FD=0x6
CONFIG_RX65N_EMAC0_PHYSR_10HD=0x2
CONFIG_RX65N_EMAC0_PHYSR_ALTCONFIG=y
CONFIG_RX65N_EMAC0_PHYSR_ALTMODE=0x6
CONFIG_RX65N_SCI2=y
CONFIG_RX65N_SCI8=y
CONFIG_RX65N_EMAC0_MII=y
CONFIG_RX65N_EMAC0_PHYADDR=30
CONFIG_SCHED_WORKQUEUE=y
CONFIG_SCHED_HPWORK=y
CONFIG_SCHED_LPWORK=y
CONFIG_SCI8_SERIAL_CONSOLE=y
CONFIG_SDCLONE_DISABLE=y
CONFIG_STDIO_DISABLE_BUFFERING=y
CONFIG_SYSTEM_NSH=y
CONFIG_SYSTEM_NSH_PRIORITY=50
CONFIG_SYSTEM_PING=y
CONFIG_ICU=y
CONFIG_STDIO_DISABLE_BUFFERING=y
CONFIG_TASK_NAME_SIZE=0
CONFIG_USERMAIN_STACKSIZE=1024
CONFIG_USER_ENTRYPOINT="nsh_main"
CONFIG_USERMAIN_STACKSIZE=1024
CONFIG_FS_PROCFS=y
CONFIG_FS_PROCFS_REGISTER=y
CONFIG_NET_ETH_PKTSIZE = 590
CONFIG_RX65N_CMTW0=y
CONFIG_RX65N_PERIB=y
CONFIG_NETUTILS_DHCPC=y
CONFIG_NETUTILS_DHCPD=y
CONFIG_NSH_DHCPC=y
CONFIG_NETINIT_DHCPC=y
CONFIG_SYSTEM_NSH_PRIORITY=50
CONFIG_EXAMPLES_SERIALBLASTER=y
CONFIG_EXAMPLES_SERIALBLASTER_STACKSIZE=2048
CONFIG_EXAMPLES_SERIALBLASTER_PRIORITY=50
CONFIG_EXAMPLES_SERIALBLASTER_DEVPATH="/dev/ttyS2"
CONFIG_EXAMPLES_SERIALRX=y
CONFIG_EXAMPLES_SERIALRX_STACKSIZE=2048
CONFIG_EXAMPLES_SERIALRX_PRIORITY=75
CONFIG_EXAMPLES_SERIALRX_BUFSIZE=11520
CONFIG_EXAMPLES_SERIALRX_DEVPATH="/dev/ttyS0"
CONFIG_EXAMPLES_SERIALRX_PRINTSTR=y
CONFIG_RTC=y
CONFIG_RTC_HIRES=y
CONFIG_RTC_ALARM=y
CONFIG_RX65N_RTC=y
CONFIG_RX65N_CARRY=y
CONFIG_RTC_DRIVER=y
CONFIG_NSH_ARCHINIT=y

View file

@ -7,21 +7,30 @@
#
# CONFIG_NSH_DISABLE_IFCONFIG is not set
# CONFIG_NSH_DISABLE_PS is not set
CONFIG_ARCH="renesas"
CONFIG_ARCH_BOARD="rx65n-rsk2mb"
CONFIG_ARCH_BOARD_RX65N_RSK2MB=y
CONFIG_ARCH_CHIP="rx65n"
CONFIG_ARCH_BOARD="rx65n"
CONFIG_ARCH_CHIP_R5F565NEHDFC=y
CONFIG_ARCH_INTERRUPTSTACK=1024
CONFIG_ARCH_RENESAS=y
CONFIG_ARCH_STACKDUMP=y
CONFIG_BUILTIN=y
CONFIG_DEBUG_FEATURES=y
CONFIG_MAX_TASKS=8
CONFIG_ARCH="renesas"
#CONFIG_BOARD_LOOPSPERMSEC=572
#CONFIG_DISABLE_MOUNTPOINT=y
#CONFIG_DISABLE_MQUEUE=y
#CONFIG_DISABLE_POLL=y
#CONFIG_DISABLE_POSIX_TIMERS=y
#CONFIG_DISABLE_PTHREAD=y
#CONFIG_DISABLE_SIGNALS=y
CONFIG_MOTOROLA_SREC=y
CONFIG_ENDIAN_LITTLE=y
CONFIG_SYSTEM_NSH=y
CONFIG_MAX_TASKS=8
CONFIG_DEBUG_FEATURES=y
CONFIG_ARCH_INTERRUPTSTACK=1024
CONFIG_BUILTIN=y
CONFIG_NSH_BUILTIN_APPS=y
CONFIG_NFILE_DESCRIPTORS=8
CONFIG_NFILE_STREAMS=8
CONFIG_NSH_BUILTIN_APPS=y
#CONFIG_NSH_CONSOLE_LOGIN=y
CONFIG_NSH_FILEIOSIZE=512
CONFIG_NSH_LINELEN=64
CONFIG_NSH_READLINE=y
@ -31,12 +40,22 @@ CONFIG_PTHREAD_STACK_DEFAULT=1024
CONFIG_RAM_SIZE=655360
CONFIG_RAM_START=0x00000000
CONFIG_RAW_BINARY=y
CONFIG_RX65N_SCI2=y
CONFIG_RX65N_SCI8=y
#CONFIG_SCI0_SERIALDRIVER=y
#CONFIG_SCI0_SERIAL_CONSOLE=y
#CONFIG_RX65N_SCI0=y
#CONFIG_SCI1_SERIALDRIVER=y
#CONFIG_SCI1_SERIAL_CONSOLE=y
#CONFIG_RX65N_SCI1=y
CONFIG_SCI2_SERIALDRIVER=y
CONFIG_SCI2_SERIAL_CONSOLE=y
CONFIG_RX65N_SCI2=y
CONFIG_SCI8_SERIALDRIVER=y
#CONFIG_SCI8_SERIAL_CONSOLE=y
CONFIG_RX65N_SCI8=y
CONFIG_SDCLONE_DISABLE=y
CONFIG_ICU=y
CONFIG_STDIO_DISABLE_BUFFERING=y
CONFIG_SYSTEM_NSH=y
CONFIG_TASK_NAME_SIZE=0
CONFIG_USERMAIN_STACKSIZE=1024
CONFIG_USER_ENTRYPOINT="nsh_main"
CONFIG_USERMAIN_STACKSIZE=1024

View file

@ -0,0 +1,85 @@
README
======
Overview
--------
This directory contains logic to support a custom ROMFS start-up script.
This startup script is used by by the NSH when it starts provided that
CONFIG_NSH_ARCHROMFS=y. The script provides a ROMFS volume that will be
mounted at /etc and will look like this at run-time:
NuttShell (NSH) NuttX-8.2
nsh> ls -l /etc
/etc:
dr-xr-xr-x 0 .
-r--r--r-- 20 group
dr-xr-xr-x 0 init.d/
-r--r--r-- 35 passwd
/etc/init.d:
dr-xr-xr-x 0 ..
-r--r--r-- 110 rcS
nsh>
/etc/init.d/rcS is the start-up script; /etc/passwd is a the password
file. It supports a single user:
USERNAME: admin
PASSWORD: Adminstrator
nsh> cat /etc/passwd
admin:8Tv+Hbmr3pLddSjtzL0kwC:0:0:/
The encrypted passwords in the provided passwd file are only valid if the
TEA key is set to: 012345678 9abcdef0 012345678 9abcdef0. Changes to either
the key or the password word will require regeneration of the nsh_romfimg.h
header file.
The format of the password file is:
user:x:uid:gid:home
Where:
user: User name
x: Encrypted password
uid: User ID (0 for now)
gid: Group ID (0 for now)
home: Login directory (/ for now)
/etc/group is a group file. It is not currently used.
nsh> cat /etc/group
root:*:0:root,admin
The format of the group file is:
group:x:gid:users
Where:
group: The group name
x: Group password
gid: Group ID
users: A comma separated list of members of the group
Updating the ROMFS File System
------------------------------
The content on the nsh_romfsimg.h header file is generated from a sample
directory structure. That directory structure is contained in the etc/ directory and can be modified per the following steps:
1. Change directory to etc/:
cd etc/
2. Make modifications as desired.
3. Create the new ROMFS image.
genromfs -f romfs_img -d etc -V SimEtcVol
4. Convert the ROMFS image to a C header file
xxd -i romfs_img >nsh_romfsimg.h
5. Edit nsh_romfsimg.h, mark both data definitions as 'const' so that
that will be stored in FLASH.

View file

@ -1,44 +1,29 @@
/***************************************************************************
/****************************************************************************
* boards/renesas/rx65n/rx65n-rsk2mb/include/board.h
*
* Copyright (C) 2008-2019 Gregory Nutt. All rights reserved.
* Author: Anjana <anjana@tataelxsi.co.in>
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership. The
* ASF licenses this file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the
* License. You may obtain a copy of the License at
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* http://www.apache.org/licenses/LICENSE-2.0
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* 3. Neither the name NuttX nor the names of its contributors may be
* used to endorse or promote products derived from this software
* without specific prior written permission.
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
***************************************************************************/
****************************************************************************/
#ifndef __BOARDS_RENESAS_RX65N_RX65N_RSK2MB_INCLUDE_BOARD_H
#define __BOARDS_RENESAS_RX65N_RX65N_RSK2MB_INCLUDE_BOARD_H
/***************************************************************************
/****************************************************************************
* Included Files
***************************************************************************/
****************************************************************************/
#ifndef __ASSEMBLY__
# include <stdint.h>
@ -46,9 +31,9 @@
/****************************************************************************
* Pre-processor Definitions
***************************************************************************/
****************************************************************************/
/* Clocking ****************************************************************/
/* Clocking *****************************************************************/
#define RX_CLK_1MHz (1000UL * 1000UL)
#define RX_FCLK ( 60 * RX_CLK_1MHz)
@ -137,10 +122,6 @@ extern "C"
#define EXTERN extern
#endif
/****************************************************************************
* Public Functions
****************************************************************************/
#undef EXTERN
#ifdef __cplusplus
}

View file

@ -1,36 +1,21 @@
############################################################################
# configs/rx65n-rsk2mb/src/Makefile
#
# Copyright (C) 2008-2019 Gregory Nutt. All rights reserved.
# Author: Anjana <anjana@tataelxsi.co.in>
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in
# the documentation and/or other materials provided with the
# distribution.
# 3. Neither the name NuttX nor the names of its contributors may be
# used to endorse or promote products derived from this software
# without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership. The
# ASF licenses this file to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance with the
# License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
############################################################################
-include $(TOPDIR)/Make.defs
@ -41,13 +26,14 @@ CFLAGS += -I=$(ARCH_SRCDIR)/chip
ASRCS =
AOBJS = $(ASRCS:.asm=$(OBJEXT))
CSRCS = rx65n_main.c
CSRCS = rx65n_appinit.c rx65n_bringup.c
COBJS = $(CSRCS:.c=$(OBJEXT))
SRCS = $(ASRCS) $(CSRCS)
OBJS = $(AOBJS) $(COBJS)
CFLAGS += -I=$(TOPDIR)/arch/$(CONFIG_ARCH)/src
CFLAGS += -I=$(TOPDIR)/arch/$(CONFIG_ARCH)/include
all: libboard$(LIBEXT)

View file

@ -0,0 +1,81 @@
/****************************************************************************
* boards/renesas/rx65n/rx65n-rsk2mb/src/rx65n_appinit.c
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership. The
* ASF licenses this file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the
* License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
****************************************************************************/
/****************************************************************************
* Included Files
****************************************************************************/
#include <nuttx/config.h>
#include <sys/types.h>
#include <stdint.h>
#include <nuttx/board.h>
#ifdef CONFIG_LIB_BOARDCTL
/****************************************************************************
* Public Functions
****************************************************************************/
/****************************************************************************
* Name: board_app_initialize
*
* Description:
* Perform application specific initialization. This function is never
* called directly from application code, but only indirectly via the
* (non-standard) boardctl() interface using the command BOARDIOC_INIT.
*
* CONFIG_LIB_BOARDCTL=y :
* Called from the NSH library
*
* CONFIG_BOARD_LATE_INITIALIZE=y, CONFIG_NSH_LIBRARY=y, &&
* CONFIG_LIB_BOARDCTL=n :
* Called from board_late_initialize().
*
* Input Parameters:
* arg - The boardctl() argument is passed to the board_app_initialize()
* implementation without modification. The argument has no
* meaning to NuttX; the meaning of the argument is a contract
* between the board-specific initialization logic and the
* matching application logic. The value cold be such things as a
* mode enumeration value, a set of DIP switch switch settings, a
* pointer to configuration data read from a file or serial FLASH,
* or whatever you would like to do with it. Every implementation
* should accept zero/NULL as a default configuration.
*
* Returned Value:
* Zero (OK) is returned on success; a negated errno value is returned on
* any failure to indicate the nature of the failure.
*
****************************************************************************/
int board_app_initialize(uintptr_t arg)
{
/* Did we already initialize via board_late_initialize()? */
#ifndef CONFIG_BOARD_LATE_INITIALIZE
return rx65n_bringup();
#else
return OK;
#endif
}
#endif /* CONFIG_LIB_BOARDCTL */

View file

@ -0,0 +1,216 @@
/****************************************************************************
* boards/renesas/rx65n/rx65n-rsk2mb/src/rx65n.bringup.c
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership. The
* ASF licenses this file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the
* License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
****************************************************************************/
/****************************************************************************
* Included Files
****************************************************************************/
#include <nuttx/config.h>
#include <nuttx/config.h>
#include <sys/types.h>
#include <sys/mount.h>
#include <syslog.h>
#include <errno.h>
#include <debug.h>
#include <nuttx/board.h>
#include <rx65n_definitions.h>
#ifdef CONFIG_LIB_BOARDCTL
#ifdef HAVE_RTC_DRIVER
# include <nuttx/timers/rtc.h>
# include "rx65n_rtc.h"
#endif
/****************************************************************************
* Public Functions
****************************************************************************/
/****************************************************************************
* Name: rtc_driver_initialize
*
* Description:
* Initialize and register the RTC driver.
*
****************************************************************************/
#ifdef HAVE_RTC_DRIVER
static int rtc_driver_initialize(void)
{
FAR struct rtc_lowerhalf_s *lower;
int ret;
/* Instantiate the rx65n lower-half RTC driver */
lower = rx65n_rtc_lowerhalf();
if (lower == NULL)
{
serr("ERROR: Failed to instantiate the RTC lower-half driver\n");
ret = -ENOMEM;
}
else
{
/* Bind the lower half driver and register the combined RTC driver
* as /dev/rtc0
*/
ret = rtc_initialize(0, lower);
if (ret < 0)
{
serr("ERROR: Failed to bind/register the RTC driver: %d\n", ret);
}
}
return ret;
}
#endif
/****************************************************************************
* Name: rx65n_bringup
*
* Description:
* Perform architecture-specific initialization
*
* CONFIG_BOARD_LATE_INITIALIZE=y :
* Called from board_late_initialize().
*
* CONFIG_BOARD_LATE_INITIALIZE=n && CONFIG_LIB_BOARDCTL=y :
* Called from the NSH library
*
****************************************************************************/
int rx65n_bringup(void)
{
int ret;
#ifdef HAVE_RTC_DRIVER
ret = rtc_driver_initialize();
if (ret < 0)
{
syslog(LOG_ERR, "ERROR: rtc_driver_initialize failed: %d\n", ret);
}
#endif
#ifdef CONFIG_FS_PROCFS
/* Mount the procfs file system */
ret = mount(NULL, "/proc", "procfs", 0, NULL);
if (ret < 0)
{
syslog(LOG_ERR,
"ERROR: Failed to mount the PROC filesystem: %d (%d)\n",
ret, errno);
}
#endif
return OK;
}
#if defined (CONFIG_ARCH_HAVE_LEDS) && (CONFIG_ARCH_LEDS)
/****************************************************************************
* Public Functions
****************************************************************************/
/****************************************************************************
* Name: board_autoled1_on
*
* Description:
* Turns on LED 0
*
****************************************************************************/
void board_autoled1_on(int led)
{
LED0 = LED_ON;
}
/****************************************************************************
* Name: board_autoled2_on
*
* Description:
* Turns on LED 1
*
****************************************************************************/
void board_autoled2_on(int led)
{
LED1 = LED_ON;
}
/****************************************************************************
* Name: board_autoled_on
*
* Description:
* Turns on LED 0 & LED 1
*
****************************************************************************/
void board_autoled_on(int led)
{
LED0 = LED_ON;
LED1 = LED_ON;
}
/****************************************************************************
* Name: board_autoled1_off
*
* Description:
* Turns off LED 0
*
****************************************************************************/
void board_autoled1_off(int led)
{
LED0 = LED_OFF;
}
/****************************************************************************
* Name: board_autoled2_off
*
* Description:
* Turns off LED 1
*
****************************************************************************/
void board_autoled2_off(int led)
{
LED1 = LED_OFF;
}
/****************************************************************************
* Name: board_autoled_off
*
* Description:
* Turns off LED 0 & LED 1
*
****************************************************************************/
void board_autoled_off(int led)
{
LED0 = LED_OFF;
LED1 = LED_OFF;
}
#endif
#endif

View file

@ -1,126 +0,0 @@
/****************************************************************************
* configs/rx65n-grrose/src/rx65n.main.c
*
* Copyright (C) 2008-2019 Gregory Nutt. All rights reserved.
* Author: Anjana <anjana@tataelxsi.co.in>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* 3. Neither the name NuttX nor the names of its contributors may be
* used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
****************************************************************************/
/****************************************************************************
*Included files
***************************************************************************/
#include "rx65n_macrodriver.h"
#include "arch/board/board.h"
#include "rx65n_definitions.h"
/****************************************************************************
* Public Functions
****************************************************************************/
/****************************************************************************
* Name: board_autoled1_on
*
* Description:
* Turns on LED 0
*
****************************************************************************/
void board_autoled1_on(int led)
{
LED0 = LED_ON;
}
/****************************************************************************
* Name: board_autoled2_on
*
* Description:
* Turns on LED 1
*
****************************************************************************/
void board_autoled2_on(int led)
{
LED1 = LED_ON;
}
/****************************************************************************
* Name: board_autoled_on
*
* Description:
* Turns on LED 0 & LED 1
*
****************************************************************************/
void board_autoled_on(int led)
{
LED0 = LED_ON;
LED1 = LED_ON;
}
/****************************************************************************
* Name: board_autoled1_off
*
* Description:
* Turns off LED 0
*
****************************************************************************/
void board_autoled1_off(int led)
{
LED0 = LED_OFF;
}
/****************************************************************************
* Name: board_autoled2_off
*
* Description:
* Turns off LED 1
*
****************************************************************************/
void board_autoled2_off(int led)
{
LED1 = LED_OFF;
}
/****************************************************************************
* Name: board_autoled_off
*
* Description:
* Turns off LED 0 & LED 1
*
****************************************************************************/
void board_autoled_off(int led)
{
LED0 = LED_OFF;
LED1 = LED_OFF;
}

View file

@ -5,22 +5,23 @@
# You can then do "make savedefconfig" to generate a new defconfig file that includes your
# modifications.
#
CONFIG_ARCH="renesas"
CONFIG_ARCH_BOARD="rx65n"
CONFIG_ARCH_BOARD_RX65N=y
CONFIG_ARCH_CHIP="rx65n"
CONFIG_ARCH_BOARD="rx65n"
CONFIG_ARCH_CHIP_R5F565NEDDFC=y
CONFIG_ARCH_INTERRUPTSTACK=1024
CONFIG_ARCH_RENESAS=y
CONFIG_ARCH_STACKDUMP=y
CONFIG_BUILTIN=y
CONFIG_ARCH="renesas"
CONFIG_MOTOROLA_SREC=y
CONFIG_ENDIAN_LITTLE=y
CONFIG_SYSTEM_NSH=y
CONFIG_MAX_TASKS=8
CONFIG_DEBUG_FEATURES=y
CONFIG_DEBUG_SYMBOLS=y
CONFIG_MAX_TASKS=8
CONFIG_MOTOROLA_SREC=y
CONFIG_ARCH_INTERRUPTSTACK=1024
CONFIG_BUILTIN=y
CONFIG_NSH_BUILTIN_APPS=y
CONFIG_NFILE_DESCRIPTORS=8
CONFIG_NFILE_STREAMS=8
CONFIG_NSH_BUILTIN_APPS=y
CONFIG_NSH_FILEIOSIZE=512
CONFIG_NSH_LINELEN=64
CONFIG_NSH_READLINE=y
@ -30,11 +31,13 @@ CONFIG_PTHREAD_STACK_DEFAULT=1024
CONFIG_RAM_SIZE=262144
CONFIG_RAM_START=0x00000000
CONFIG_RAW_BINARY=y
CONFIG_RX65N_SCI2=y
CONFIG_SCI2_SERIALDRIVER=y
CONFIG_SCI2_SERIAL_CONSOLE=y
CONFIG_RX65N_SCI2=y
CONFIG_SDCLONE_DISABLE=y
CONFIG_ICU=y
CONFIG_STDIO_DISABLE_BUFFERING=y
CONFIG_SYSTEM_NSH=y
CONFIG_TASK_NAME_SIZE=0
CONFIG_USERMAIN_STACKSIZE=1024
CONFIG_USER_ENTRYPOINT="nsh_main"
CONFIG_USERMAIN_STACKSIZE=1024