Graphics framework for GR-PEACH. When you use this program, we judge you have agreed to the following contents. https://developer.mbed.org/teams/Renesas/wiki/About-LICENSE

Dependents:   ImageZoomInout_Sample ImageRotaion_Sample ImageScroll_Sample GR-PEACH_LCD_4_3inch_Save_to_USB ... more

License

When you use this library, we judge you have agreed to the following contents.

https://developer.mbed.org/teams/Renesas/wiki/About-LICENSE

Note

If you import the GraphicsFramework library, please import GR-PEACH_video library and R_BSP library together.



JPEG Converter

The JPEG Converter driver implements encode and decode functionality which uses the JCU of the RZ/A Series.

Hello World!

Import programJCU_HelloWorld

Hello World for JCU(JPEG Codec Unit). JCU is JPEG codec unit of RZ/A1. When you use this program, we judge you have agreed to the following contents. https://developer.mbed.org/teams/Renesas/wiki/About-LICENSE

API

Import library

Data Structures

struct bitmap_buff_info_t
Bitmap data setting struct. More...
struct encode_options_t
Encode option setting. More...

Public Types

enum jpeg_conv_error_t {
JPEG_CONV_OK = 0, JPEG_CONV_JCU_ERR = -1, JPEG_CONV_FORMA_ERR = -2, JPEG_CONV_PARAM_ERR = -3,
JPEG_CONV_BUSY = -4, JPEG_CONV_PARAM_RANGE_ERR = -7
}

Error codes.

More...
enum wr_rd_swa_t {
WR_RD_WRSWA_NON = 0, WR_RD_WRSWA_8BIT = 1, WR_RD_WRSWA_16BIT = 2, WR_RD_WRSWA_16_8BIT = 3,
WR_RD_WRSWA_32BIT = 4, WR_RD_WRSWA_32_8BIT = 5, WR_RD_WRSWA_32_16BIT = 6, WR_RD_WRSWA_32_16_8BIT = 7
}

Write/Read image pixcel frame buffer swap setting.

More...
enum wr_rd_format_t { WR_RD_YCbCr422 = 0x00, WR_RD_ARGB8888 = 0x01, WR_RD_RGB565 = 0x02 }

Write/Read image pixcel format selects.

More...
enum sub_sampling_t { SUB_SAMPLING_1_1 = 0x00, SUB_SAMPLING_1_2 = 0x01, SUB_SAMPLING_1_4 = 0x02, SUB_SAMPLING_1_8 = 0x03 }

Thinning output image selects.

More...
enum cbcr_offset_t { CBCR_OFFSET_0 = 0x00, CBCR_OFFSET_128 = 0x01 }

Cb/Cr range selects for decode.

More...

Public Member Functions

JPEG_Converter ()
Constructor method of JPEG converter(encode/decode)
virtual ~JPEG_Converter ()
Destructor method of JPEG converter(encode/decode)
JPEG_Converter::jpeg_conv_error_t decode (void *pJpegBuff, bitmap_buff_info_t *psOutputBuff)
Decode JPEG to rinear data.
JPEG_Converter::jpeg_conv_error_t decode (void *pJpegBuff, bitmap_buff_info_t *psOutputBuff, decode_options_t *pOptions)
JPEG data decode to bitmap.
JPEG_Converter::jpeg_conv_error_t encode ( bitmap_buff_info_t *psInputBuff, void *pJpegBuff, size_t *pEncodeSize)
Encode rinear data to JPEG.
JPEG_Converter::jpeg_conv_error_t encode ( bitmap_buff_info_t *psInputBuff, void *pJpegBuff, size_t *pEncodeSize, encode_options_t *pOptions)
Bitmap data encode to JPEG.
JPEG_Converter::jpeg_conv_error_t SetQuality (const uint8_t qual)
Set encode quality.

Correspondence file

A correspondence file of JPEG Converter is as the following table.

JPEGCorrespondence
Width>0(greater than 0)
Height>0(greater than 0)
Color formatYCbCr444, YCbCr422, YCbCr420, YCbCr411
BitmapCorrespondence
Width>0(greater than 0)
Height>0(greater than 0)
Color formatYCbCr422

Notice

You run JPEG converter once destruction each time.

You set whether these JPEG files aren't input, or it check error setting decode(set in "flag" = true). The JPEG file which becomes correspondence outside will be the following condition.

  • File besides the above-mentioned correspondence file.
  • As information in the JPEG file, WIDTH or HEIGHT is larger than output buffer setting.

Buffer area is used encode/decode, set 8 bytes align and non-cash memory area. The output buffer when decoding, is made beyond the size decided in the size of the JPEG file, the format, setting of thinning out. You make output buffer for decode/encode to enough big size in order to stock this result. JPEG Converter, if you do not particularly perform specified, does not check size against the output data at the time of encoding and decoding. You set the output buffer so that there is no effect of corruption by the output data.

Color format

Color format in case to be converted from Bitmap to JPEG is either ARGB8888 or RGB555, YCbCr422. Color format of the If you want to convert from JPEG file to Bitmap file is YCbCr422. You correct "alpha(member of decode_options_t)" of setting and "output_cb_cr_offset(member of decode_options_t)" according to color format when decoding.

  • example
    decode to ARGB8888(WR_RD_ARGB8888 set in format member of bitmap_buff_info_t)
    alpha = 0x01-0xFF
    output_cb_cr_offset = CBCR_OFFSET_0

    decode to YCbCr422(WR_RD_YCbCr422 set in format member of bitmap_buff_info_t)
    alpha = 0
    output_cb_cr_offset = CBCR_OFFSET_0 or CBCR_OFFSET_128

    decode to RGB565(WR_RD_RGB565 set in format member of bitmap_buff_info_t)
    alpha = 0
    output_cb_cr_offset = CBCR_OFFSET_0

Decode/encode settings are optional

If omitted encode/decode settings, it will work with the following settings.
[Decode option setting (member of decode_options_t)]

  • Vertical sub sampling is thinning output image to 1/1.
  • Horizontal sub sampling is thinning output image to 1/1.
  • Output data of Cb/Cr range is -128 to 127.
  • Output data of swap in 8-bit units: 2-1-4-3-6-5-8-7.
  • Alpha value of 0.
  • JPEG format correspondence outside error check.
  • It decode in a synchronous function.

[Encode option setting (member of encode_options_t)]

  • DRI value is 0.
  • Encoding JPEG file start width offset is 0.
  • Encoding JPEG file start height offset is 0.
  • Input data of Cb/Cr range of input data is -128 to 127.
  • Input data swap in 8-bit units: 2-1-4-3-6-5-8-7.
  • It don't check encode size.
  • Quantization Y use default table(Quality75).
  • Quantization C use default table(Quality75).
  • Huffman Y DC use default table.
  • Huffman C DC use default table.
  • Huffman Y AC use default table.
  • Huffman C AC use default table.
  • It encode in a synchronous function.

Synchronous/asynchronous switching

Decoding and encoding setting to operate asynchronously by setting a callback function(decode_options_t and encode_options_t).

Quality

Quality changes are possible. If you want to change the Quality, please specify the table made of Quality you want to change the address of the setting. If you do not want to change the Quality, it will operate at Quality75.

RGA

The RGA library implements fast drawing functionality which uses the RGA of the RZ/A Series.
Supporting compiler is ARMCC, GCC ARM and IAR.

Hello World!

Import programRGA_HelloWorld

Hello World for RGA(Renesas Graphics Architecture). RGA is the Graphics Library of RZ/A1. When you use this program, we judge you have agreed to the following contents. https://developer.mbed.org/teams/Renesas/wiki/About-LICENSE

Committer:
dkato
Date:
Mon Apr 24 08:16:23 2017 +0000
Revision:
13:1ee2176ef13f
Parent:
0:37e1e6a45ced
Add "SetQuality()" to JCU.
; Bug fixes.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
dkato 0:37e1e6a45ced 1 /*******************************************************************************
dkato 0:37e1e6a45ced 2 * DISCLAIMER
dkato 0:37e1e6a45ced 3 * This software is supplied by Renesas Electronics Corporation and is only
dkato 0:37e1e6a45ced 4 * intended for use with Renesas products. No other uses are authorized. This
dkato 0:37e1e6a45ced 5 * software is owned by Renesas Electronics Corporation and is protected under
dkato 0:37e1e6a45ced 6 * all applicable laws, including copyright laws.
dkato 0:37e1e6a45ced 7 * THIS SOFTWARE IS PROVIDED "AS IS" AND RENESAS MAKES NO WARRANTIES REGARDING
dkato 0:37e1e6a45ced 8 * THIS SOFTWARE, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING BUT NOT
dkato 0:37e1e6a45ced 9 * LIMITED TO WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE
dkato 0:37e1e6a45ced 10 * AND NON-INFRINGEMENT. ALL SUCH WARRANTIES ARE EXPRESSLY DISCLAIMED.
dkato 0:37e1e6a45ced 11 * TO THE MAXIMUM EXTENT PERMITTED NOT PROHIBITED BY LAW, NEITHER RENESAS
dkato 0:37e1e6a45ced 12 * ELECTRONICS CORPORATION NOR ANY OF ITS AFFILIATED COMPANIES SHALL BE LIABLE
dkato 0:37e1e6a45ced 13 * FOR ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES FOR
dkato 0:37e1e6a45ced 14 * ANY REASON RELATED TO THIS SOFTWARE, EVEN IF RENESAS OR ITS AFFILIATES HAVE
dkato 0:37e1e6a45ced 15 * BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
dkato 0:37e1e6a45ced 16 * Renesas reserves the right, without notice, to make changes to this software
dkato 0:37e1e6a45ced 17 * and to discontinue the availability of this software. By using this software,
dkato 0:37e1e6a45ced 18 * you agree to the additional terms and conditions found by accessing the
dkato 0:37e1e6a45ced 19 * following link:
dkato 0:37e1e6a45ced 20 * http://www.renesas.com/disclaimer
dkato 0:37e1e6a45ced 21 * Copyright (C) 2012 - 2015 Renesas Electronics Corporation. All rights reserved.
dkato 0:37e1e6a45ced 22 *******************************************************************************/
dkato 0:37e1e6a45ced 23 /**
dkato 0:37e1e6a45ced 24 * @file r_multi_compiler_typedef.h
dkato 0:37e1e6a45ced 25 * @brief Compiler Porting Layer. Data types.
dkato 0:37e1e6a45ced 26 *
dkato 0:37e1e6a45ced 27 * $Module: OSPL $ $PublicVersion: 0.90 $ (=R_OSPL_VERSION)
dkato 0:37e1e6a45ced 28 * $Rev: 42 $
dkato 0:37e1e6a45ced 29 * $Date:: 2014-06-03 16:54:02 +0900#$
dkato 0:37e1e6a45ced 30 */
dkato 0:37e1e6a45ced 31
dkato 0:37e1e6a45ced 32 #ifndef R_MULTI_COMPILER_TYPEDEF_H
dkato 0:37e1e6a45ced 33 #define R_MULTI_COMPILER_TYPEDEF_H
dkato 0:37e1e6a45ced 34
dkato 0:37e1e6a45ced 35
dkato 0:37e1e6a45ced 36 /******************************************************************************
dkato 0:37e1e6a45ced 37 Includes <System Includes> , "Project Includes"
dkato 0:37e1e6a45ced 38 ******************************************************************************/
dkato 0:37e1e6a45ced 39 #ifdef __cplusplus
dkato 0:37e1e6a45ced 40 extern "C" {
dkato 0:37e1e6a45ced 41 #endif /* __cplusplus */
dkato 0:37e1e6a45ced 42
dkato 0:37e1e6a45ced 43
dkato 0:37e1e6a45ced 44 /******************************************************************************
dkato 0:37e1e6a45ced 45 Typedef definitions
dkato 0:37e1e6a45ced 46 ******************************************************************************/
dkato 0:37e1e6a45ced 47
dkato 0:37e1e6a45ced 48 /******************************************************************************
dkato 0:37e1e6a45ced 49 Macro definitions
dkato 0:37e1e6a45ced 50 ******************************************************************************/
dkato 0:37e1e6a45ced 51
dkato 0:37e1e6a45ced 52 /**
dkato 0:37e1e6a45ced 53 * @def R_OSPL_SECTION_INLINE_VERSION
dkato 0:37e1e6a45ced 54 * @brief R_OSPL_SECTION_INLINE_VERSION
dkato 0:37e1e6a45ced 55 * @par Parameters
dkato 0:37e1e6a45ced 56 * None
dkato 0:37e1e6a45ced 57 * @return None.
dkato 0:37e1e6a45ced 58 */
dkato 0:37e1e6a45ced 59 #define R_OSPL_SECTION_INLINE_VERSION 4
dkato 0:37e1e6a45ced 60
dkato 0:37e1e6a45ced 61
dkato 0:37e1e6a45ced 62 /**
dkato 0:37e1e6a45ced 63 * @def R_OSPL_LIST_UP_INLINE_BODY
dkato 0:37e1e6a45ced 64 * @brief Define or not define
dkato 0:37e1e6a45ced 65 * @par Parameters
dkato 0:37e1e6a45ced 66 * None
dkato 0:37e1e6a45ced 67 * @return None.
dkato 0:37e1e6a45ced 68 */
dkato 0:37e1e6a45ced 69 /* #define R_OSPL_LIST_UP_INLINE_BODY */
dkato 0:37e1e6a45ced 70
dkato 0:37e1e6a45ced 71
dkato 0:37e1e6a45ced 72 /**
dkato 0:37e1e6a45ced 73 * @def R_OSPL_MAKE_INLINE_BODY
dkato 0:37e1e6a45ced 74 * @brief Define or not define
dkato 0:37e1e6a45ced 75 * @par Parameters
dkato 0:37e1e6a45ced 76 * None
dkato 0:37e1e6a45ced 77 * @return None.
dkato 0:37e1e6a45ced 78 */
dkato 0:37e1e6a45ced 79 /* #define R_OSPL_MAKE_INLINE_BODY */
dkato 0:37e1e6a45ced 80
dkato 0:37e1e6a45ced 81
dkato 0:37e1e6a45ced 82 /**
dkato 0:37e1e6a45ced 83 * @def INLINE
dkato 0:37e1e6a45ced 84 * @brief Inline function
dkato 0:37e1e6a45ced 85 * @par Parameters
dkato 0:37e1e6a45ced 86 * None
dkato 0:37e1e6a45ced 87 * @return None.
dkato 0:37e1e6a45ced 88 *
dkato 0:37e1e6a45ced 89 * @par Description
dkato 0:37e1e6a45ced 90 * "__INLINE" is reserved by compiler.
dkato 0:37e1e6a45ced 91 */
dkato 0:37e1e6a45ced 92 /* ->QAC 1252 : QAC considers that && is not short-circuit evaluation */
dkato 0:37e1e6a45ced 93 #if defined( __STDC_VERSION__ ) && __STDC_VERSION__ >= 199901L && ! defined( __ICCARM__ ) /* For C99 */ \
dkato 0:37e1e6a45ced 94 && ! IS_MBED_USED || defined( __cplusplus )
dkato 0:37e1e6a45ced 95 /* <-QAC 1252 */
dkato 0:37e1e6a45ced 96 #if defined( R_OSPL_MAKE_INLINE_BODY ) && ! defined( R_OSPL_LIST_UP_INLINE_BODY )
dkato 0:37e1e6a45ced 97 #define INLINE extern inline
dkato 0:37e1e6a45ced 98 #else
dkato 0:37e1e6a45ced 99 #define INLINE inline
dkato 0:37e1e6a45ced 100 #endif
dkato 0:37e1e6a45ced 101
dkato 0:37e1e6a45ced 102 /* ->QAC 1252 : QAC considers that && is not short-circuit evaluation */
dkato 0:37e1e6a45ced 103 #elif defined( __STDC_VERSION__ ) && __STDC_VERSION__ >= 199901L && defined( __ICCARM__ ) /* For IAR C99 */
dkato 0:37e1e6a45ced 104 /* <-QAC 1252 */
dkato 0:37e1e6a45ced 105 #if defined( R_OSPL_MAKE_INLINE_BODY )
dkato 0:37e1e6a45ced 106 #define INLINE
dkato 0:37e1e6a45ced 107 /* "extern inline" raises a error, if with "@" operator */
dkato 0:37e1e6a45ced 108 #else
dkato 0:37e1e6a45ced 109 #define INLINE inline /* Special inline */
dkato 0:37e1e6a45ced 110 #endif
dkato 0:37e1e6a45ced 111
dkato 0:37e1e6a45ced 112 #elif defined( __CC_ARM ) && ! defined( __GNUC__ ) /* For ARMCC not C99, not -gnu */
dkato 0:37e1e6a45ced 113 #if defined( R_OSPL_MAKE_INLINE_BODY ) && ! defined( R_OSPL_LIST_UP_INLINE_BODY )
dkato 0:37e1e6a45ced 114 #if R_OSPL_LIBRARY_MAKING
dkato 0:37e1e6a45ced 115 #define INLINE static __inline
dkato 0:37e1e6a45ced 116 #else
dkato 0:37e1e6a45ced 117 #define INLINE extern __inline /* Special inline */
dkato 0:37e1e6a45ced 118 #endif
dkato 0:37e1e6a45ced 119 #else
dkato 0:37e1e6a45ced 120 #if R_OSPL_LIBRARY_MAKING
dkato 0:37e1e6a45ced 121 #define INLINE static __inline
dkato 0:37e1e6a45ced 122 #else
dkato 0:37e1e6a45ced 123 #define INLINE extern __inline /* Special inline */
dkato 0:37e1e6a45ced 124 #endif
dkato 0:37e1e6a45ced 125 #endif
dkato 0:37e1e6a45ced 126 /* Function bodys are in shared "i.<FunctionName>" section */
dkato 0:37e1e6a45ced 127
dkato 0:37e1e6a45ced 128 #elif defined( __GNUC__ ) /* For gcc */
dkato 0:37e1e6a45ced 129 #if IS_MBED_USED
dkato 0:37e1e6a45ced 130 #define INLINE static __inline
dkato 0:37e1e6a45ced 131 #else
dkato 0:37e1e6a45ced 132 #if defined( R_OSPL_MAKE_INLINE_BODY ) && ! defined( R_OSPL_LIST_UP_INLINE_BODY )
dkato 0:37e1e6a45ced 133 #define INLINE __inline__ /* extern inline of C99 */
dkato 0:37e1e6a45ced 134 #else
dkato 0:37e1e6a45ced 135 #define INLINE extern __inline__ /* inline of C99 */
dkato 0:37e1e6a45ced 136 #endif
dkato 0:37e1e6a45ced 137 #endif
dkato 0:37e1e6a45ced 138
dkato 0:37e1e6a45ced 139 #elif defined( _SH ) /* For SH compiler */
dkato 0:37e1e6a45ced 140 #if defined( R_OSPL_MAKE_INLINE_BODY ) && ! defined( R_OSPL_LIST_UP_INLINE_BODY )
dkato 0:37e1e6a45ced 141 #define INLINE
dkato 0:37e1e6a45ced 142 #else
dkato 0:37e1e6a45ced 143 #define INLINE static
dkato 0:37e1e6a45ced 144 /* "extern" is ignored, if 'C1400 (W) Function "..." in #pragma inline is not expanded' */
dkato 0:37e1e6a45ced 145 #endif
dkato 0:37e1e6a45ced 146 /* No inline qualifier */
dkato 0:37e1e6a45ced 147 /* #ifdef _SH */
dkato 0:37e1e6a45ced 148 /* #pragma inline <function_name> */
dkato 0:37e1e6a45ced 149 /* #endif */
dkato 0:37e1e6a45ced 150
dkato 0:37e1e6a45ced 151 #else
dkato 0:37e1e6a45ced 152 #error
dkato 0:37e1e6a45ced 153 #endif
dkato 0:37e1e6a45ced 154
dkato 0:37e1e6a45ced 155
dkato 0:37e1e6a45ced 156 /**
dkato 0:37e1e6a45ced 157 * @def STATIC_INLINE
dkato 0:37e1e6a45ced 158 * @brief Static inline in C source file
dkato 0:37e1e6a45ced 159 * @par Parameters
dkato 0:37e1e6a45ced 160 * None
dkato 0:37e1e6a45ced 161 * @return None.
dkato 0:37e1e6a45ced 162 *
dkato 0:37e1e6a45ced 163 * @par Description
dkato 0:37e1e6a45ced 164 * "__STATIC_INLINE" is reserved by compiler.
dkato 0:37e1e6a45ced 165 */
dkato 0:37e1e6a45ced 166
dkato 0:37e1e6a45ced 167 #ifndef __cplusplus
dkato 0:37e1e6a45ced 168
dkato 0:37e1e6a45ced 169 #ifdef __CC_ARM
dkato 0:37e1e6a45ced 170 #define STATIC_INLINE static __inline
dkato 0:37e1e6a45ced 171 #endif
dkato 0:37e1e6a45ced 172
dkato 0:37e1e6a45ced 173 #ifdef __ICCARM__
dkato 0:37e1e6a45ced 174 #define STATIC_INLINE static inline
dkato 0:37e1e6a45ced 175 #endif
dkato 0:37e1e6a45ced 176
dkato 0:37e1e6a45ced 177 #if defined( __GNUC__ ) && ! defined( __CC_ARM )
dkato 0:37e1e6a45ced 178 #define STATIC_INLINE static inline
dkato 0:37e1e6a45ced 179 #endif
dkato 0:37e1e6a45ced 180
dkato 0:37e1e6a45ced 181 #else
dkato 0:37e1e6a45ced 182
dkato 0:37e1e6a45ced 183 #define STATIC_INLINE static inline
dkato 0:37e1e6a45ced 184
dkato 0:37e1e6a45ced 185 #endif /* __cplusplus */
dkato 0:37e1e6a45ced 186
dkato 0:37e1e6a45ced 187
dkato 0:37e1e6a45ced 188 /**
dkato 0:37e1e6a45ced 189 * @def R_OSPL_SECTION
dkato 0:37e1e6a45ced 190 * @brief Names section name to function or varaible
dkato 0:37e1e6a45ced 191 * @par Parameters
dkato 0:37e1e6a45ced 192 * None
dkato 0:37e1e6a45ced 193 * @return None.
dkato 0:37e1e6a45ced 194 */
dkato 0:37e1e6a45ced 195 /**
dkato 0:37e1e6a45ced 196 * @def R_OSPL_SECTION_FOR_ZERO_INIT
dkato 0:37e1e6a45ced 197 * @brief Names section name to zero initialized varaible
dkato 0:37e1e6a45ced 198 * @par Parameters
dkato 0:37e1e6a45ced 199 * None
dkato 0:37e1e6a45ced 200 * @return None.
dkato 0:37e1e6a45ced 201 */
dkato 0:37e1e6a45ced 202 /* ->MISRA 19.10 : Cannot ( ) */ /* ->MISRA 19.7 : Cannot function */ /* ->SEC M5.1.3 */
dkato 0:37e1e6a45ced 203 #if defined( __CC_ARM )
dkato 0:37e1e6a45ced 204 #define R_OSPL_SECTION( SectionName, Declaration ) \
dkato 0:37e1e6a45ced 205 __attribute__ ((section (SectionName))) Declaration
dkato 0:37e1e6a45ced 206
dkato 0:37e1e6a45ced 207 #define R_OSPL_SECTION_FOR_ZERO_INIT( SectionName, Declaration ) \
dkato 0:37e1e6a45ced 208 __attribute__ ((section (SectionName), zero_init)) Declaration
dkato 0:37e1e6a45ced 209
dkato 0:37e1e6a45ced 210 #elif defined( __GNUC__ ) && ! defined( __CC_ARM )
dkato 0:37e1e6a45ced 211 #define R_OSPL_SECTION( SectionName, Declaration ) \
dkato 0:37e1e6a45ced 212 __attribute__ ((section (SectionName))) Declaration
dkato 0:37e1e6a45ced 213
dkato 0:37e1e6a45ced 214 #define R_OSPL_SECTION_FOR_ZERO_INIT( SectionName, Declaration ) \
dkato 0:37e1e6a45ced 215 __attribute__ ((section (SectionName))) Declaration
dkato 0:37e1e6a45ced 216
dkato 0:37e1e6a45ced 217 #elif defined( __ICCARM__ )
dkato 0:37e1e6a45ced 218 #define R_OSPL_SECTION( SectionName, Declaration ) \
dkato 0:37e1e6a45ced 219 Declaration @ SectionName
dkato 0:37e1e6a45ced 220
dkato 0:37e1e6a45ced 221 #define R_OSPL_SECTION_FOR_ZERO_INIT( SectionName, Declaration ) \
dkato 0:37e1e6a45ced 222 Declaration @ SectionName
dkato 0:37e1e6a45ced 223
dkato 0:37e1e6a45ced 224 #elif defined( _SH ) /* For SH compiler */
dkato 0:37e1e6a45ced 225 #define R_OSPL_SECTION( SectionName, Declaration ) \
dkato 0:37e1e6a45ced 226 Declaration
dkato 0:37e1e6a45ced 227 /* No section qualifier */
dkato 0:37e1e6a45ced 228 /* #ifdef _SH */
dkato 0:37e1e6a45ced 229 /* #pragma section <section_name> */
dkato 0:37e1e6a45ced 230 /* #endif */
dkato 0:37e1e6a45ced 231 /* : */
dkato 0:37e1e6a45ced 232 /* <Not extern code> */
dkato 0:37e1e6a45ced 233 /* : */
dkato 0:37e1e6a45ced 234 /* #ifdef _SH */
dkato 0:37e1e6a45ced 235 /* #pragma section */
dkato 0:37e1e6a45ced 236 /* #endif */
dkato 0:37e1e6a45ced 237
dkato 0:37e1e6a45ced 238 #define R_OSPL_SECTION_FOR_ZERO_INIT( SectionName, Declaration ) \
dkato 0:37e1e6a45ced 239 Declaration
dkato 0:37e1e6a45ced 240
dkato 0:37e1e6a45ced 241 #else
dkato 0:37e1e6a45ced 242 #error
dkato 0:37e1e6a45ced 243 #endif
dkato 0:37e1e6a45ced 244 /* <-MISRA 19.10 */ /* <-MISRA 19.7 */ /* <-SEC M5.1.3 */
dkato 0:37e1e6a45ced 245
dkato 0:37e1e6a45ced 246
dkato 0:37e1e6a45ced 247 /**
dkato 0:37e1e6a45ced 248 * @def R_OSPL_SECTION_FOR_INLINE
dkato 0:37e1e6a45ced 249 * @brief Names section name to inline function
dkato 0:37e1e6a45ced 250 * @par Parameters
dkato 0:37e1e6a45ced 251 * None
dkato 0:37e1e6a45ced 252 * @return None.
dkato 0:37e1e6a45ced 253 */
dkato 0:37e1e6a45ced 254 /* ->MISRA 19.10 : Cannot ( ) */ /* ->MISRA 19.7 : Cannot function */ /* ->SEC M5.1.3 */
dkato 0:37e1e6a45ced 255 #if defined( __CC_ARM ) || defined( __GNUC__ )
dkato 0:37e1e6a45ced 256 #if defined( R_OSPL_LIST_UP_INLINE_BODY )
dkato 0:37e1e6a45ced 257 #define R_OSPL_SECTION_FOR_INLINE( SectionName, Declaration ) \
dkato 0:37e1e6a45ced 258 __attribute__ ((section ("INLINE_BODY"))) Declaration
dkato 0:37e1e6a45ced 259 #else
dkato 0:37e1e6a45ced 260 #define R_OSPL_SECTION_FOR_INLINE( SectionName, Declaration ) \
dkato 0:37e1e6a45ced 261 __attribute__ ((section (SectionName))) Declaration
dkato 0:37e1e6a45ced 262 #endif
dkato 0:37e1e6a45ced 263
dkato 0:37e1e6a45ced 264 #elif defined( __ICCARM__ )
dkato 0:37e1e6a45ced 265 #if defined( R_OSPL_MAKE_INLINE_BODY )
dkato 0:37e1e6a45ced 266 #if defined( R_OSPL_LIST_UP_INLINE_BODY )
dkato 0:37e1e6a45ced 267 #define R_OSPL_SECTION_FOR_INLINE( SectionName, Declaration ) \
dkato 0:37e1e6a45ced 268 Declaration @ "INLINE_BODY"
dkato 0:37e1e6a45ced 269 #else
dkato 0:37e1e6a45ced 270 #define R_OSPL_SECTION_FOR_INLINE( SectionName, Declaration ) \
dkato 0:37e1e6a45ced 271 Declaration @ SectionName
dkato 0:37e1e6a45ced 272 #endif
dkato 0:37e1e6a45ced 273 #else
dkato 0:37e1e6a45ced 274 #define R_OSPL_SECTION_FOR_INLINE( SectionName, Declaration ) \
dkato 0:37e1e6a45ced 275 Declaration
dkato 0:37e1e6a45ced 276 #endif
dkato 0:37e1e6a45ced 277
dkato 0:37e1e6a45ced 278 #elif defined( _SH ) /* For SH compiler */
dkato 0:37e1e6a45ced 279 #define R_OSPL_SECTION_FOR_INLINE( SectionName, Declaration ) \
dkato 0:37e1e6a45ced 280 Declaration
dkato 0:37e1e6a45ced 281 /* No section qualifier */
dkato 0:37e1e6a45ced 282 /* #ifdef _SH */
dkato 0:37e1e6a45ced 283 /* #pragma section <section_name> */
dkato 0:37e1e6a45ced 284 /* #endif */
dkato 0:37e1e6a45ced 285 /* : */
dkato 0:37e1e6a45ced 286 /* <Not extern code> */
dkato 0:37e1e6a45ced 287 /* : */
dkato 0:37e1e6a45ced 288 /* #ifdef _SH */
dkato 0:37e1e6a45ced 289 /* #pragma section */
dkato 0:37e1e6a45ced 290 /* #endif */
dkato 0:37e1e6a45ced 291
dkato 0:37e1e6a45ced 292 #else
dkato 0:37e1e6a45ced 293 #error
dkato 0:37e1e6a45ced 294 #endif
dkato 0:37e1e6a45ced 295 /* <-MISRA 19.10 */ /* <-MISRA 19.7 */ /* <-SEC M5.1.3 */
dkato 0:37e1e6a45ced 296
dkato 0:37e1e6a45ced 297
dkato 0:37e1e6a45ced 298 /**
dkato 0:37e1e6a45ced 299 * @def R_OSPL_ALIGNMENT
dkato 0:37e1e6a45ced 300 * @brief Alignments first addres of global variable
dkato 0:37e1e6a45ced 301 * @param ByteCount Value of alignment
dkato 0:37e1e6a45ced 302 * @param Declaration_with_Semicolon Declaration of the variable
dkato 0:37e1e6a45ced 303 * @return None.
dkato 0:37e1e6a45ced 304 */
dkato 0:37e1e6a45ced 305 /* ->MISRA 19.10 : Cannot ( ) */ /* ->MISRA 19.7 : Cannot function */ /* ->SEC M5.1.3 */
dkato 0:37e1e6a45ced 306 #if defined( __CC_ARM )
dkato 0:37e1e6a45ced 307 #define R_OSPL_ALIGNMENT( ByteCount, Declaration_with_Semicolon ) \
dkato 0:37e1e6a45ced 308 __align( ByteCount ) Declaration_with_Semicolon
dkato 0:37e1e6a45ced 309
dkato 0:37e1e6a45ced 310 #elif defined( __GNUC__ ) && ! defined( __CC_ARM )
dkato 0:37e1e6a45ced 311 #define R_OSPL_ALIGNMENT( ByteCount, Declaration_with_Semicolon ) \
dkato 0:37e1e6a45ced 312 __attribute__((aligned( ByteCount ))) Declaration_with_Semicolon
dkato 0:37e1e6a45ced 313
dkato 0:37e1e6a45ced 314 #elif defined( __ICCARM__ )
dkato 0:37e1e6a45ced 315 #define R_OSPL_ALIGNMENT( ByteCount, Declaration_with_Semicolon ) \
dkato 0:37e1e6a45ced 316 R_OSPL_ALIGNMENT_SUB( ByteCount, Declaration_with_Semicolon )
dkato 0:37e1e6a45ced 317 #define R_OSPL_ALIGNMENT_SUB( ByteCount, Declaration_with_Semicolon ) \
dkato 0:37e1e6a45ced 318 _Pragma( "diag_suppress=Pe606" ) \
dkato 0:37e1e6a45ced 319 _Pragma( "diag_suppress=Pa060" ) \
dkato 0:37e1e6a45ced 320 _Pragma( "diag_suppress=Pe609" ) \
dkato 0:37e1e6a45ced 321 R_OSPL_ALIGNMENT_##ByteCount() \
dkato 0:37e1e6a45ced 322 Declaration_with_Semicolon \
dkato 0:37e1e6a45ced 323 R_OSPL_ALIGNMENT_##0x4()
dkato 0:37e1e6a45ced 324 /* align 0x4 must be written after ";" */
dkato 0:37e1e6a45ced 325
dkato 0:37e1e6a45ced 326 #define R_OSPL_ALIGNMENT_0x4() _Pragma( "data_alignment=0x4" )
dkato 0:37e1e6a45ced 327 #define R_OSPL_ALIGNMENT_0x8() _Pragma( "data_alignment=0x8" )
dkato 0:37e1e6a45ced 328 #define R_OSPL_ALIGNMENT_0x10() _Pragma( "data_alignment=0x10" )
dkato 0:37e1e6a45ced 329 #define R_OSPL_ALIGNMENT_0x20() _Pragma( "data_alignment=0x20" )
dkato 0:37e1e6a45ced 330 #define R_OSPL_ALIGNMENT_0x40() _Pragma( "data_alignment=0x40" )
dkato 0:37e1e6a45ced 331 #define R_OSPL_ALIGNMENT_0x80() _Pragma( "data_alignment=0x80" )
dkato 0:37e1e6a45ced 332 #define R_OSPL_ALIGNMENT_0x100() _Pragma( "data_alignment=0x100" )
dkato 0:37e1e6a45ced 333 #define R_OSPL_ALIGNMENT_0x200() _Pragma( "data_alignment=0x200" )
dkato 0:37e1e6a45ced 334 #define R_OSPL_ALIGNMENT_0x400() _Pragma( "data_alignment=0x400" )
dkato 0:37e1e6a45ced 335 #define R_OSPL_ALIGNMENT_0x800() _Pragma( "data_alignment=0x800" )
dkato 0:37e1e6a45ced 336 #define R_OSPL_ALIGNMENT_0x1000() _Pragma( "data_alignment=0x1000" )
dkato 0:37e1e6a45ced 337 #define R_OSPL_ALIGNMENT_0x2000() _Pragma( "data_alignment=0x2000" )
dkato 0:37e1e6a45ced 338 #define R_OSPL_ALIGNMENT_0x4000() _Pragma( "data_alignment=0x4000" )
dkato 0:37e1e6a45ced 339 #define R_OSPL_ALIGNMENT_0x8000() _Pragma( "data_alignment=0x8000" )
dkato 0:37e1e6a45ced 340 #define R_OSPL_ALIGNMENT_0x10000() _Pragma( "data_alignment=0x10000" )
dkato 0:37e1e6a45ced 341 #define R_OSPL_ALIGNMENT_0x20000() _Pragma( "data_alignment=0x20000" )
dkato 0:37e1e6a45ced 342 #define R_OSPL_ALIGNMENT_0x40000() _Pragma( "data_alignment=0x40000" )
dkato 0:37e1e6a45ced 343 #define R_OSPL_ALIGNMENT_0x80000() _Pragma( "data_alignment=0x80000" )
dkato 0:37e1e6a45ced 344 #define R_OSPL_ALIGNMENT_0x100000() _Pragma( "data_alignment=0x100000" )
dkato 0:37e1e6a45ced 345
dkato 0:37e1e6a45ced 346 #define R_OSPL_ALIGNMENT_4() _Pragma( "data_alignment=4" )
dkato 0:37e1e6a45ced 347 #define R_OSPL_ALIGNMENT_8() _Pragma( "data_alignment=8" )
dkato 0:37e1e6a45ced 348 #define R_OSPL_ALIGNMENT_16() _Pragma( "data_alignment=16" )
dkato 0:37e1e6a45ced 349 #define R_OSPL_ALIGNMENT_32() _Pragma( "data_alignment=32" )
dkato 0:37e1e6a45ced 350 #define R_OSPL_ALIGNMENT_64() _Pragma( "data_alignment=64" )
dkato 0:37e1e6a45ced 351 #define R_OSPL_ALIGNMENT_128() _Pragma( "data_alignment=128" )
dkato 0:37e1e6a45ced 352 #define R_OSPL_ALIGNMENT_256() _Pragma( "data_alignment=256" )
dkato 0:37e1e6a45ced 353 #define R_OSPL_ALIGNMENT_512() _Pragma( "data_alignment=512" )
dkato 0:37e1e6a45ced 354 #define R_OSPL_ALIGNMENT_1024() _Pragma( "data_alignment=1024" )
dkato 0:37e1e6a45ced 355 #define R_OSPL_ALIGNMENT_2048() _Pragma( "data_alignment=2048" )
dkato 0:37e1e6a45ced 356 #define R_OSPL_ALIGNMENT_4096() _Pragma( "data_alignment=4096" )
dkato 0:37e1e6a45ced 357 #define R_OSPL_ALIGNMENT_8192() _Pragma( "data_alignment=8192" )
dkato 0:37e1e6a45ced 358 #define R_OSPL_ALIGNMENT_16384() _Pragma( "data_alignment=16384" )
dkato 0:37e1e6a45ced 359 #define R_OSPL_ALIGNMENT_32768() _Pragma( "data_alignment=32768" )
dkato 0:37e1e6a45ced 360 #define R_OSPL_ALIGNMENT_65536() _Pragma( "data_alignment=65536" )
dkato 0:37e1e6a45ced 361
dkato 0:37e1e6a45ced 362 #elif defined( _SH )
dkato 0:37e1e6a45ced 363 #define R_OSPL_ALIGNMENT( ByteCount, Declaration_with_Semicolon ) \
dkato 0:37e1e6a45ced 364 Declaration_with_Semicolon
dkato 0:37e1e6a45ced 365 /* No alignment qualifier */
dkato 0:37e1e6a45ced 366 /* Set aligned address by "Map section information" */
dkato 0:37e1e6a45ced 367
dkato 0:37e1e6a45ced 368 #else
dkato 0:37e1e6a45ced 369 #error
dkato 0:37e1e6a45ced 370 #endif
dkato 0:37e1e6a45ced 371 /* <-MISRA 19.10 */ /* <-MISRA 19.7 */ /* <-SEC M5.1.3 */
dkato 0:37e1e6a45ced 372
dkato 0:37e1e6a45ced 373
dkato 0:37e1e6a45ced 374 /* Form: C Language Header */
dkato 0:37e1e6a45ced 375 /******************************************************************************
dkato 0:37e1e6a45ced 376 Variable Externs
dkato 0:37e1e6a45ced 377 ******************************************************************************/
dkato 0:37e1e6a45ced 378
dkato 0:37e1e6a45ced 379 /******************************************************************************
dkato 0:37e1e6a45ced 380 Functions Prototypes
dkato 0:37e1e6a45ced 381 ******************************************************************************/
dkato 0:37e1e6a45ced 382 /* In "r_multi_compiler.h" */
dkato 0:37e1e6a45ced 383
dkato 0:37e1e6a45ced 384 /***********************************************************************
dkato 0:37e1e6a45ced 385 * End of File:
dkato 0:37e1e6a45ced 386 ************************************************************************/
dkato 0:37e1e6a45ced 387 #ifdef __cplusplus
dkato 0:37e1e6a45ced 388 } /* End of extern "C" */
dkato 0:37e1e6a45ced 389 #endif /* __cplusplus */
dkato 0:37e1e6a45ced 390
dkato 0:37e1e6a45ced 391 #endif /* R_MULTI_COMPILER_TYPEDEF_H */