Import Mbed OS hard-float snapshot

This commit is contained in:
Beslan
2026-06-01 20:15:04 +03:00
commit d3738e2f89
16278 changed files with 10628036 additions and 0 deletions

View File

@@ -0,0 +1,71 @@
/*******************************************************************************
* DISCLAIMER
* This software is supplied by Renesas Electronics Corporation and is only
* intended for use with Renesas products. No other uses are authorized. This
* software is owned by Renesas Electronics Corporation and is protected under
* all applicable laws, including copyright laws.
* THIS SOFTWARE IS PROVIDED "AS IS" AND RENESAS MAKES NO WARRANTIES REGARDING
* THIS SOFTWARE, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING BUT NOT
* LIMITED TO WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE
* AND NON-INFRINGEMENT. ALL SUCH WARRANTIES ARE EXPRESSLY DISCLAIMED.
* TO THE MAXIMUM EXTENT PERMITTED NOT PROHIBITED BY LAW, NEITHER RENESAS
* ELECTRONICS CORPORATION NOR ANY OF ITS AFFILIATED COMPANIES SHALL BE LIABLE
* FOR ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES FOR
* ANY REASON RELATED TO THIS SOFTWARE, EVEN IF RENESAS OR ITS AFFILIATES HAVE
* BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
* Renesas reserves the right, without notice, to make changes to this software
* and to discontinue the availability of this software. By using this software,
* you agree to the additional terms and conditions found by accessing the
* following link:
* http://www.renesas.com/disclaimer
* Copyright (C) 2012 - 2014 Renesas Electronics Corporation. All rights reserved.
*******************************************************************************/
/**************************************************************************//**
* @file RZ_A1_Init.h
* $Rev: 531 $
* $Date:: 2013-04-16 13:07:35 +0900#$
* @brief RZ_A1 Initialize
******************************************************************************/
#ifndef RZ_A1_INIT_H
#define RZ_A1_INIT_H
/******************************************************************************
Includes <System Includes> , "Project Includes"
******************************************************************************/
#include <stdio.h>
#include <stdbool.h>
#include "iodefine.h"
#ifdef __cplusplus
extern "C"
{
#endif /* __cplusplus */
/******************************************************************************
Typedef definitions
******************************************************************************/
/******************************************************************************
Macro definitions
******************************************************************************/
/******************************************************************************
Variable Externs
******************************************************************************/
/******************************************************************************
Functions Prototypes
******************************************************************************/
void RZ_A1_SetSramWriteEnable(void);
void RZ_A1_InitClock(void);
int RZ_A1_IsClockMode0(void);
void RZ_A1_InitBus(void);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* RZ_A1_INIT_H */

View File

@@ -0,0 +1,48 @@
/* mbed Microcontroller Library
* CMSIS-style functionality to support dynamic vectors
*******************************************************************************
* Copyright (c) 2015 ARM Limited. All rights reserved.
* All rights reserved.
*
* 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 of ARM Limited 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 HOLDER 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 MBED_CMSIS_NVIC_H
#define MBED_CMSIS_NVIC_H
#include "cmsis.h"
#ifdef __cplusplus
extern "C" {
#endif
void NVIC_SetVector(IRQn_Type IRQn, uint32_t vector);
uint32_t NVIC_GetVector(IRQn_Type IRQn);
#ifdef __cplusplus
}
#endif
#endif

View File

@@ -0,0 +1,85 @@
/*******************************************************************************
* DISCLAIMER
* This software is supplied by Renesas Electronics Corporation and is only
* intended for use with Renesas products. No other uses are authorized. This
* software is owned by Renesas Electronics Corporation and is protected under
* all applicable laws, including copyright laws.
* THIS SOFTWARE IS PROVIDED "AS IS" AND RENESAS MAKES NO WARRANTIES REGARDING
* THIS SOFTWARE, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING BUT NOT
* LIMITED TO WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE
* AND NON-INFRINGEMENT. ALL SUCH WARRANTIES ARE EXPRESSLY DISCLAIMED.
* TO THE MAXIMUM EXTENT PERMITTED NOT PROHIBITED BY LAW, NEITHER RENESAS
* ELECTRONICS CORPORATION NOR ANY OF ITS AFFILIATED COMPANIES SHALL BE LIABLE
* FOR ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES FOR
* ANY REASON RELATED TO THIS SOFTWARE, EVEN IF RENESAS OR ITS AFFILIATES HAVE
* BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
* Renesas reserves the right, without notice, to make changes to this software
* and to discontinue the availability of this software. By using this software,
* you agree to the additional terms and conditions found by accessing the
* following link:
* http://www.renesas.com/disclaimer
* Copyright (C) 2012 - 2014 Renesas Electronics Corporation. All rights reserved.
*******************************************************************************/
/******************************************************************************
* File Name : dev_drv.h
* $Rev: 809 $
* $Date:: 2014-04-09 15:06:36 +0900#$
* Description : Device driver header
******************************************************************************/
#ifndef DEV_DRV_H
#define DEV_DRV_H
/******************************************************************************
Includes <System Includes> , "Project Includes"
******************************************************************************/
/******************************************************************************
Typedef definitions
******************************************************************************/
/******************************************************************************
Macro definitions
******************************************************************************/
/* ==== Arguments, Return values ==== */
#define DEVDRV_SUCCESS (0) /* Success */
#define DEVDRV_ERROR (-1) /* Failure */
/* ==== Flags ==== */
#define DEVDRV_FLAG_OFF (0) /* Flag OFF */
#define DEVDRV_FLAG_ON (1) /* Flag ON */
/* ==== Channels ==== */
typedef enum devdrv_ch
{
DEVDRV_CH_0, /* Channel 0 */
DEVDRV_CH_1, /* Channel 1 */
DEVDRV_CH_2, /* Channel 2 */
DEVDRV_CH_3, /* Channel 3 */
DEVDRV_CH_4, /* Channel 4 */
DEVDRV_CH_5, /* Channel 5 */
DEVDRV_CH_6, /* Channel 6 */
DEVDRV_CH_7, /* Channel 7 */
DEVDRV_CH_8, /* Channel 8 */
DEVDRV_CH_9, /* Channel 9 */
DEVDRV_CH_10, /* Channel 10 */
DEVDRV_CH_11, /* Channel 11 */
DEVDRV_CH_12, /* Channel 12 */
DEVDRV_CH_13, /* Channel 13 */
DEVDRV_CH_14, /* Channel 14 */
DEVDRV_CH_15 /* Channel 15 */
} devdrv_ch_t;
/******************************************************************************
Variable Externs
******************************************************************************/
/******************************************************************************
Functions Prototypes
******************************************************************************/
#endif /* DEV_DRV_H */
/* End of File */

View File

@@ -0,0 +1,84 @@
/*******************************************************************************
* DISCLAIMER
* This software is supplied by Renesas Electronics Corporation and is only
* intended for use with Renesas products. No other uses are authorized. This
* software is owned by Renesas Electronics Corporation and is protected under
* all applicable laws, including copyright laws.
* THIS SOFTWARE IS PROVIDED "AS IS" AND RENESAS MAKES NO WARRANTIES REGARDING
* THIS SOFTWARE, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING BUT NOT
* LIMITED TO WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE
* AND NON-INFRINGEMENT. ALL SUCH WARRANTIES ARE EXPRESSLY DISCLAIMED.
* TO THE MAXIMUM EXTENT PERMITTED NOT PROHIBITED BY LAW, NEITHER RENESAS
* ELECTRONICS CORPORATION NOR ANY OF ITS AFFILIATED COMPANIES SHALL BE LIABLE
* FOR ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES FOR
* ANY REASON RELATED TO THIS SOFTWARE, EVEN IF RENESAS OR ITS AFFILIATES HAVE
* BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
* Renesas reserves the right, without notice, to make changes to this software
* and to discontinue the availability of this software. By using this software,
* you agree to the additional terms and conditions found by accessing the
* following link:
* http://www.renesas.com/disclaimer
* Copyright (C) 2012 - 2015 Renesas Electronics Corporation. All rights reserved.
*******************************************************************************/
/**************************************************************************//**
* @file nvic_wrapper.h
* $Rev: $
* $Date:: $
* @brief Wrapper between NVIC(for Cortex-M) and GIC(for Cortex-A9)
******************************************************************************/
#ifndef NVIC_WRAPPER_H
#define NVIC_WRAPPER_H
/******************************************************************************
Includes <System Includes> , "Project Includes"
******************************************************************************/
#ifdef __cplusplus
extern "C"
{
#endif /* __cplusplus */
/******************************************************************************
Typedef definitions
******************************************************************************/
/******************************************************************************
Macro definitions
******************************************************************************/
/******************************************************************************
Variable Externs
******************************************************************************/
/******************************************************************************
Functions Prototypes
******************************************************************************/
/* NVIC functions */
void NVIC_SetPriorityGrouping(uint32_t PriorityGroup);
uint32_t NVIC_GetPriorityGrouping(void);
void NVIC_EnableIRQ(IRQn_Type IRQn);
void NVIC_DisableIRQ(IRQn_Type IRQn);
uint32_t NVIC_GetPendingIRQ(IRQn_Type IRQn);
void NVIC_SetPendingIRQ(IRQn_Type IRQn);
void NVIC_ClearPendingIRQ(IRQn_Type IRQn);
uint32_t NVIC_GetActive(IRQn_Type IRQn);
void NVIC_SetPriority(IRQn_Type IRQn, uint32_t priority);
uint32_t NVIC_GetPriority(IRQn_Type IRQn);
uint32_t NVIC_EncodePriority (uint32_t PriorityGroup, uint32_t PreemptPriority, uint32_t SubPriority);
void NVIC_DecodePriority (uint32_t Priority, uint32_t PriorityGroup, uint32_t* pPreemptPriority, uint32_t* pSubPriority);
void NVIC_SystemReset(void);
/* SysTick function */
uint32_t SysTick_Config(uint32_t ticks);
/* Debug In/Output function */
uint32_t ITM_SendChar (uint32_t ch);
int32_t ITM_ReceiveChar (void);
int32_t ITM_CheckChar (void);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* NVIC_WRAPPER_H */

View File

@@ -0,0 +1,63 @@
/*******************************************************************************
* DISCLAIMER
* This software is supplied by Renesas Electronics Corporation and is only
* intended for use with Renesas products. No other uses are authorized. This
* software is owned by Renesas Electronics Corporation and is protected under
* all applicable laws, including copyright laws.
* THIS SOFTWARE IS PROVIDED "AS IS" AND RENESAS MAKES NO WARRANTIES REGARDING
* THIS SOFTWARE, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING BUT NOT
* LIMITED TO WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE
* AND NON-INFRINGEMENT. ALL SUCH WARRANTIES ARE EXPRESSLY DISCLAIMED.
* TO THE MAXIMUM EXTENT PERMITTED NOT PROHIBITED BY LAW, NEITHER RENESAS
* ELECTRONICS CORPORATION NOR ANY OF ITS AFFILIATED COMPANIES SHALL BE LIABLE
* FOR ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES FOR
* ANY REASON RELATED TO THIS SOFTWARE, EVEN IF RENESAS OR ITS AFFILIATES HAVE
* BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
* Renesas reserves the right, without notice, to make changes to this software
* and to discontinue the availability of this software. By using this software,
* you agree to the additional terms and conditions found by accessing the
* following link:
* http://www.renesas.com/disclaimer
* Copyright (C) 2012 - 2013 Renesas Electronics Corporation. All rights reserved.
*******************************************************************************/
/*******************************************************************************
* File Name : r_typedefs.h
* $Rev: 788 $
* $Date:: 2014-04-07 18:57:13 +0900#$
* Description : basic type definition
******************************************************************************/
#ifndef R_TYPEDEFS_H
#define R_TYPEDEFS_H
/******************************************************************************
Includes <System Includes> , "Project Includes"
******************************************************************************/
#include <stddef.h>
#include <stdbool.h>
#include <stdint.h>
#if defined(__ARM_NEON__)
#include <arm_neon.h>
#endif /* __ARM_NEON__ */
#ifndef float32_t
typedef float float32_t;
#endif
#ifndef float64_t
typedef double float64_t;
#endif
/******************************************************************************
Typedef definitions
******************************************************************************/
typedef char char_t;
#ifndef bool_t
typedef bool bool_t;
#endif
typedef int int_t;
typedef long double float128_t;
typedef signed long long_t;
typedef unsigned long ulong_t;
#endif /* R_TYPEDEFS_H */

View File

@@ -0,0 +1,200 @@
/*******************************************************************************
* DISCLAIMER
* This software is supplied by Renesas Electronics Corporation and is only
* intended for use with Renesas products. No other uses are authorized. This
* software is owned by Renesas Electronics Corporation and is protected under
* all applicable laws, including copyright laws.
* THIS SOFTWARE IS PROVIDED "AS IS" AND RENESAS MAKES NO WARRANTIES REGARDING
* THIS SOFTWARE, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING BUT NOT
* LIMITED TO WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE
* AND NON-INFRINGEMENT. ALL SUCH WARRANTIES ARE EXPRESSLY DISCLAIMED.
* TO THE MAXIMUM EXTENT PERMITTED NOT PROHIBITED BY LAW, NEITHER RENESAS
* ELECTRONICS CORPORATION NOR ANY OF ITS AFFILIATED COMPANIES SHALL BE LIABLE
* FOR ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES FOR
* ANY REASON RELATED TO THIS SOFTWARE, EVEN IF RENESAS OR ITS AFFILIATES HAVE
* BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
* Renesas reserves the right, without notice, to make changes to this software
* and to discontinue the availability of this software. By using this software,
* you agree to the additional terms and conditions found by accessing the
* following link:
* http://www.renesas.com/disclaimer
* Copyright (C) 2012 - 2014 Renesas Electronics Corporation. All rights reserved.
*******************************************************************************/
/*******************************************************************************
* File Name : rza_io_regrw.c
* $Rev: 1121 $
* $Date:: 2014-08-06 17:09:53 +0900#$
* Description : Low level register read/write
*******************************************************************************/
/******************************************************************************
Includes <System Includes> , "Project Includes"
******************************************************************************/
#include "r_typedefs.h"
#ifdef __CC_ARM
#pragma arm section code = "CODE_IO_REGRW"
#pragma arm section rodata = "CONST_IO_REGRW"
#pragma arm section rwdata = "DATA_IO_REGRW"
#pragma arm section zidata = "BSS_IO_REGRW"
#endif
/******************************************************************************
Typedef definitions
******************************************************************************/
/******************************************************************************
Macro definitions
******************************************************************************/
/******************************************************************************
Imported global variables and functions (from other files)
******************************************************************************/
/******************************************************************************
Exported global variables and functions (to be accessed by other files)
******************************************************************************/
/******************************************************************************
Private global variables and functions
******************************************************************************/
/******************************************************************************
* Function Name: RZA_IO_RegWrite_8
* Description : IO register 8-bit write
* Arguments : volatile uint8_t * ioreg : IO register for writing
* : : Use register definition name of the
* : : iodefine.h
* : uint8_t write_value : Write value for the IO register
* : uint8_t shift : The number of left shifts to the
* : : target bit
* : uint8_t mask : Mask value for the IO register
* : : (Target bit : "1")
* Return Value : None
******************************************************************************/
void RZA_IO_RegWrite_8(volatile uint8_t * ioreg, uint8_t write_value, uint8_t shift, uint8_t mask)
{
uint8_t reg_value;
reg_value = *ioreg; /* Read from register */
reg_value = (reg_value & (~mask)) | (write_value << shift); /* Modify value */
*ioreg = reg_value; /* Write to register */
}
/******************************************************************************
* Function Name: RZA_IO_RegWrite_16
* Description : IO register 16-bit write
* Arguments : volatile uint16_t * ioreg : IO register for writing
* : : Use register definition name of the
* : : iodefine.h
* : uint16_t write_value : Write value for the IO register
* : uint16_t shift : The number of left shifts to the
* : : target bit
* : uint16_t mask : Mask value for the IO register
* : : (Target bit : "1")
* Return Value : None
******************************************************************************/
void RZA_IO_RegWrite_16(volatile uint16_t * ioreg, uint16_t write_value, uint16_t shift, uint16_t mask)
{
uint16_t reg_value;
reg_value = *ioreg; /* Read from register */
reg_value = (reg_value & (~mask)) | (write_value << shift); /* Modify value */
*ioreg = reg_value; /* Write to register */
}
/******************************************************************************
* Function Name: RZA_IO_RegWrite_32
* Description : IO register 32-bit write
* Arguments : volatile uint32_t * ioreg : IO register for writing
* : : Use register definition name of the
* : : iodefine.h
* : uint32_t write_value : Write value for the IO register
* : uint32_t shift : The number of left shifts to the
* : : target bit
* : uint32_t mask : Mask value for the IO register
* : : (Target bit : "1")
* Return Value : None
******************************************************************************/
void RZA_IO_RegWrite_32(volatile uint32_t * ioreg, uint32_t write_value, uint32_t shift, uint32_t mask)
{
uint32_t reg_value;
reg_value = *ioreg; /* Read from register */
reg_value = (reg_value & (~mask)) | (write_value << shift); /* Modify value */
*ioreg = reg_value; /* Write to register */
}
/******************************************************************************
* Function Name: RZA_IO_RegRead_8
* Description : IO register 8-bit read
* Arguments : volatile uint8_t * ioreg : IO register for reading
* : : Use register definition name of the
* : : iodefine.h
* : uint8_t shift : The number of right shifts to the
* : : target bit
* : uint8_t mask : Mask bit for the IO register
* : : (Target bit: "1")
* Return Value : uint8_t : Value of the obtained target bit
******************************************************************************/
uint8_t RZA_IO_RegRead_8(volatile uint8_t * ioreg, uint8_t shift, uint8_t mask)
{
uint8_t reg_value;
reg_value = *ioreg; /* Read from register */
reg_value = (reg_value & mask) >> shift; /* Clear other bit and Bit shift */
return reg_value;
}
/******************************************************************************
* Function Name: RZA_IO_RegRead_16
* Description : IO register 16-bit read
* Arguments : volatile uint16_t * ioreg : IO register for reading
* : : Use register definition name of the
* : : iodefine.h
* : uint16_t shift : The number of right shifts to the
* : : target bit
* : uint16_t mask : Mask bit for the IO register
* : : (Target bit: "1")
* Return Value : uint16_t : Value of the obtained target bit
******************************************************************************/
uint16_t RZA_IO_RegRead_16(volatile uint16_t * ioreg, uint16_t shift, uint16_t mask)
{
uint16_t reg_value;
reg_value = *ioreg; /* Read from register */
reg_value = (reg_value & mask) >> shift; /* Clear other bit and Bit shift */
return reg_value;
}
/******************************************************************************
* Function Name: RZA_IO_RegRead_32
* Description : IO register 32-bit read
* Arguments : volatile uint32_t * ioreg : IO register for reading
* : : Use register definition name of the
* : : iodefine.h
* : uint32_t shift : The number of right shifts to the
* : : target bit
* : uint32_t mask : Mask bit for the IO register
* : : (Target bit: "1")
* Return Value : uint32_t : Value of the obtained target bit
******************************************************************************/
uint32_t RZA_IO_RegRead_32(volatile uint32_t * ioreg, uint32_t shift, uint32_t mask)
{
uint32_t reg_value;
reg_value = *ioreg; /* Read from register */
reg_value = (reg_value & mask) >> shift; /* Clear other bit and Bit shift */
return reg_value;
}
/* End of File */

View File

@@ -0,0 +1,83 @@
/*******************************************************************************
* DISCLAIMER
* This software is supplied by Renesas Electronics Corporation and is only
* intended for use with Renesas products. No other uses are authorized. This
* software is owned by Renesas Electronics Corporation and is protected under
* all applicable laws, including copyright laws.
* THIS SOFTWARE IS PROVIDED "AS IS" AND RENESAS MAKES NO WARRANTIES REGARDING
* THIS SOFTWARE, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING BUT NOT
* LIMITED TO WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE
* AND NON-INFRINGEMENT. ALL SUCH WARRANTIES ARE EXPRESSLY DISCLAIMED.
* TO THE MAXIMUM EXTENT PERMITTED NOT PROHIBITED BY LAW, NEITHER RENESAS
* ELECTRONICS CORPORATION NOR ANY OF ITS AFFILIATED COMPANIES SHALL BE LIABLE
* FOR ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES FOR
* ANY REASON RELATED TO THIS SOFTWARE, EVEN IF RENESAS OR ITS AFFILIATES HAVE
* BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
* Renesas reserves the right, without notice, to make changes to this software
* and to discontinue the availability of this software. By using this software,
* you agree to the additional terms and conditions found by accessing the
* following link:
* http://www.renesas.com/disclaimer
* Copyright (C) 2012 - 2014 Renesas Electronics Corporation. All rights reserved.
*******************************************************************************/
/*******************************************************************************
* File Name : rza_io_regrw.h
* $Rev: 1135 $
* $Date:: 2014-08-08 10:11:30 +0900#$
* Description : Low level register read/write header
*******************************************************************************/
#ifndef RZA_IO_REGRW_H
#define RZA_IO_REGRW_H
/******************************************************************************
Includes <System Includes> , "Project Includes"
******************************************************************************/
/* ==== includes each bit mask header ==== */
#include "cpg_iobitmask.h"
#include "intc_iobitmask.h"
#include "bsc_iobitmask.h"
#include "dmac_iobitmask.h"
#include "mtu2_iobitmask.h"
#include "ostm_iobitmask.h"
#include "scif_iobitmask.h"
#include "rspi_iobitmask.h"
#include "riic_iobitmask.h"
#include "usb_iobitmask.h"
#include "gpio_iobitmask.h"
#ifdef __cplusplus
extern "C" {
#endif
/******************************************************************************
Typedef definitions
******************************************************************************/
/******************************************************************************
Macro definitions
******************************************************************************/
/******************************************************************************
Variable Externs
******************************************************************************/
/******************************************************************************
Functions Prototypes
******************************************************************************/
void RZA_IO_RegWrite_8 (volatile uint8_t * ioreg, uint8_t write_value, uint8_t shift, uint8_t mask);
void RZA_IO_RegWrite_16(volatile uint16_t * ioreg, uint16_t write_value, uint16_t shift, uint16_t mask);
void RZA_IO_RegWrite_32(volatile uint32_t * ioreg, uint32_t write_value, uint32_t shift, uint32_t mask);
uint8_t RZA_IO_RegRead_8 (volatile uint8_t * ioreg, uint8_t shift, uint8_t mask);
uint16_t RZA_IO_RegRead_16 (volatile uint16_t * ioreg, uint16_t shift, uint16_t mask);
uint32_t RZA_IO_RegRead_32 (volatile uint32_t * ioreg, uint32_t shift, uint32_t mask);
#ifdef __cplusplus
}
#endif
#endif /* RZA_IO_REGRW_H */
/* End of File */

View File

@@ -0,0 +1,181 @@
/* Copyright (c) 2016 Renesas Electronics Corporation.
* SPDX-License-Identifier: Apache-2.0
*
* Licensed 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.
*/
#ifndef __VFP_NEON_PUSH_POP_H__
#define __VFP_NEON_PUSH_POP_H__
#if defined ( __CC_ARM ) /*------------------RealView Compiler -----------------*/
/* ARM armcc specific functions */
#pragma push
#pragma arm
static __asm void __vfp_neon_push(void) {
ARM
VMRS R2,FPSCR
STMDB SP!,{R2,R4} ; Push FPSCR, maintain 8-byte alignment
VSTMDB SP!,{D0-D15}
VSTMDB SP!,{D16-D31}
BX LR
}
#pragma pop
#pragma push
#pragma arm
static __asm void __vfp_neon_pop(void) {
ARM
VLDMIA SP!,{D16-D31}
VLDMIA SP!,{D0-D15}
LDR R2,[SP]
VMSR FPSCR,R2
ADD SP,SP,#8
BX LR
}
#pragma pop
#pragma push
#pragma arm
static __asm void __vfp_push(void) {
ARM
VMRS R2,FPSCR
STMDB SP!,{R2,R4} ; Push FPSCR, maintain 8-byte alignment
VSTMDB SP!,{D0-D15}
BX LR
}
#pragma pop
#pragma push
#pragma arm
static __asm void __vfp_pop(void) {
ARM
VLDMIA SP!,{D0-D15}
LDR R2,[SP]
VMSR FPSCR,R2
ADD SP,SP,#8
BX LR
}
#pragma pop
#elif (defined (__ICCARM__)) /*---------------- ICC Compiler ---------------------*/
__arm static inline void __vfp_neon_push(void) {
__asm(
"ARM \n"
"VMRS R2,FPSCR \n"
"STMDB SP!,{R2,R4} \n" // Push FPSCR, maintain 8-byte alignment
"VSTMDB SP!,{D0-D15} \n"
"VSTMDB SP!,{D16-D31} \n"
"BX lr \n" );
}
__arm static inline void __vfp_neon_pop(void) {
__asm(
"ARM \n"
"VLDMIA SP!,{D16-D31} \n"
"VLDMIA SP!,{D0-D15} \n"
"LDR R2,[SP] \n"
"VMSR FPSCR,R2 \n"
"ADD SP,SP,#8 \n"
"BX lr \n" );
}
__arm static inline void __vfp_push(void) {
__asm(
"ARM \n"
"VMRS R2,FPSCR \n"
"STMDB SP!,{R2,R4} \n" // Push FPSCR, maintain 8-byte alignment
"VSTMDB SP!,{D0-D15} \n"
"BX lr \n" );
}
__arm static inline void __vfp_pop(void) {
__asm(
"ARM \n"
"VLDMIA SP!,{D0-D15} \n"
"LDR R2,[SP] \n"
"VMSR FPSCR,R2 \n"
"ADD SP,SP,#8 \n"
"BX lr \n" );
}
#elif (defined (__GNUC__)) /*------------------ GNU Compiler ---------------------*/
__attribute__( ( always_inline ) ) __STATIC_INLINE void __vfp_neon_push(void)
{
__asm__ volatile (
".ARM;"
"VMRS R2,FPSCR;"
"STMDB SP!,{R2,R4};" // Push FPSCR, maintain 8-byte alignment
"VSTMDB SP!,{D0-D15};"
"VSTMDB SP!,{D16-D31};"
:
:
: );
return;
}
__attribute__( ( always_inline ) ) __STATIC_INLINE void __vfp_neon_pop(void)
{
__asm__ volatile (
".ARM;"
"VLDMIA SP!,{D16-D31};"
"VLDMIA SP!,{D0-D15};"
"LDR R2,[SP];"
"VMSR FPSCR,R2;"
"ADD SP,SP,#8;"
:
:
: );
return;
}
__attribute__( ( always_inline ) ) __STATIC_INLINE void __vfp_push(void)
{
__asm__ volatile (
".ARM;"
"VMRS R2,FPSCR;"
"STMDB SP!,{R2,R4};" // Push FPSCR, maintain 8-byte alignment
"VSTMDB SP!,{D0-D15};"
:
:
: );
return;
}
__attribute__( ( always_inline ) ) __STATIC_INLINE void __vfp_pop(void)
{
__asm__ volatile (
".ARM;"
"VLDMIA SP!,{D0-D15};"
"LDR R2,[SP];"
"VMSR FPSCR,R2;"
"ADD SP,SP,#8;"
:
:
: );
return;
}
#endif
#endif