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_static_an_tag.h
dkato 0:37e1e6a45ced 25 * @brief Reviewed tag for warnings of static code analysis.
dkato 0:37e1e6a45ced 26 *
dkato 0:37e1e6a45ced 27 * $Module: OSPL $ $PublicVersion: 0.90 $ (=R_OSPL_VERSION)
dkato 0:37e1e6a45ced 28 * $Rev: 35 $
dkato 0:37e1e6a45ced 29 * $Date:: 2014-04-15 21:38:18 +0900#$
dkato 0:37e1e6a45ced 30 */
dkato 0:37e1e6a45ced 31
dkato 0:37e1e6a45ced 32 #ifndef R_STATIC_AN_TAG_H
dkato 0:37e1e6a45ced 33 #define R_STATIC_AN_TAG_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 #include "Project_Config.h"
dkato 0:37e1e6a45ced 40 #include "r_typedefs.h"
dkato 0:37e1e6a45ced 41 #include "r_multi_compiler.h"
dkato 0:37e1e6a45ced 42
dkato 0:37e1e6a45ced 43 #ifdef __cplusplus
dkato 0:37e1e6a45ced 44 extern "C" {
dkato 0:37e1e6a45ced 45 #endif /* __cplusplus */
dkato 0:37e1e6a45ced 46
dkato 0:37e1e6a45ced 47
dkato 0:37e1e6a45ced 48 /******************************************************************************
dkato 0:37e1e6a45ced 49 Typedef definitions
dkato 0:37e1e6a45ced 50 ******************************************************************************/
dkato 0:37e1e6a45ced 51
dkato 0:37e1e6a45ced 52 /******************************************************************************
dkato 0:37e1e6a45ced 53 Macro definitions
dkato 0:37e1e6a45ced 54 ******************************************************************************/
dkato 0:37e1e6a45ced 55
dkato 0:37e1e6a45ced 56 /******************************************************************************
dkato 0:37e1e6a45ced 57 Variable Externs
dkato 0:37e1e6a45ced 58 ******************************************************************************/
dkato 0:37e1e6a45ced 59
dkato 0:37e1e6a45ced 60 /******************************************************************************
dkato 0:37e1e6a45ced 61 Functions Prototypes
dkato 0:37e1e6a45ced 62 ******************************************************************************/
dkato 0:37e1e6a45ced 63
dkato 0:37e1e6a45ced 64 /***********************************************************************
dkato 0:37e1e6a45ced 65 * Macros: IS
dkato 0:37e1e6a45ced 66 * Changes the code accepted with MISRA 13.2 to readable
dkato 0:37e1e6a45ced 67 *
dkato 0:37e1e6a45ced 68 * Arguments:
dkato 0:37e1e6a45ced 69 * bool_value - The expression that evaluated result becomes boolean type
dkato 0:37e1e6a45ced 70 *
dkato 0:37e1e6a45ced 71 * Return Value:
dkato 0:37e1e6a45ced 72 * Evaluate result of "bool_value != 0".
dkato 0:37e1e6a45ced 73 *
dkato 0:37e1e6a45ced 74 * Description:
dkato 0:37e1e6a45ced 75 * Avoid "not 0" as double negation.
dkato 0:37e1e6a45ced 76 * "IS" macro corresponds to cast to boolean type specified in the language.
dkato 0:37e1e6a45ced 77 *
dkato 0:37e1e6a45ced 78 * This is for QAC warning : MISRA 13.2 Advice : Tests of a value against
dkato 0:37e1e6a45ced 79 * zero should be made explicit, unless the operand is effectively Boolean.
dkato 0:37e1e6a45ced 80 *
dkato 0:37e1e6a45ced 81 * Write this macro after being warned by static code analyzer.
dkato 0:37e1e6a45ced 82 *
dkato 0:37e1e6a45ced 83 * Example:
dkato 0:37e1e6a45ced 84 * > if ( IS( bool_value ) ) {...}
dkato 0:37e1e6a45ced 85 * > if ( IS( bool_value ) && IS( bool_value2 ) && ! bool_value3 ) {...}
dkato 0:37e1e6a45ced 86 * > if ( IS( unsigned_bitfield ) ) {...}
dkato 0:37e1e6a45ced 87 * > bool_t is_flag = (bool_t) unsigned_bitfield; ("IS" is not used)
dkato 0:37e1e6a45ced 88 ************************************************************************/
dkato 0:37e1e6a45ced 89 /* ->MISRA 19.7 : For return _Bool type */ /* ->SEC M5.1.3 */
dkato 0:37e1e6a45ced 90 #if ! R_BOOL_IS_SIGNED
dkato 0:37e1e6a45ced 91 #define IS( bool_value ) ( (bool_t)( bool_value ) != 0u )
dkato 0:37e1e6a45ced 92 #else
dkato 0:37e1e6a45ced 93 #define IS( bool_value ) ( (bool_t)( bool_value ) != 0 )
dkato 0:37e1e6a45ced 94 #endif
dkato 0:37e1e6a45ced 95 /* <-MISRA 19.7 */ /* <-SEC M5.1.3 */
dkato 0:37e1e6a45ced 96
dkato 0:37e1e6a45ced 97 #if 0
dkato 0:37e1e6a45ced 98 /* Comment out because if checking type function(this) was called, raises SEC R3.6.2(QAC 3441) */
dkato 0:37e1e6a45ced 99 #define IS( bool_value ) ( IS_Sub( bool_value ) != 0 )
dkato 0:37e1e6a45ced 100 INLINE bool_t IS_Sub( bool_t const value ) /* Check type only */
dkato 0:37e1e6a45ced 101 {
dkato 0:37e1e6a45ced 102 return value;
dkato 0:37e1e6a45ced 103 }
dkato 0:37e1e6a45ced 104 #endif
dkato 0:37e1e6a45ced 105
dkato 0:37e1e6a45ced 106
dkato 0:37e1e6a45ced 107 /***********************************************************************
dkato 0:37e1e6a45ced 108 * Macros: IF_DQ
dkato 0:37e1e6a45ced 109 * Error check on DEBUG and QAC version for faster
dkato 0:37e1e6a45ced 110 ************************************************************************/
dkato 0:37e1e6a45ced 111 /* ->MISRA 19.4 : Compliant with C language syntax. */ /* ->SEC M1.8.2 */
dkato 0:37e1e6a45ced 112 #if defined(__QAC_ARM_H__)
dkato 0:37e1e6a45ced 113 #define IF_DQ if
dkato 0:37e1e6a45ced 114 #else
dkato 0:37e1e6a45ced 115 #define IF_DQ IF_D
dkato 0:37e1e6a45ced 116 #endif
dkato 0:37e1e6a45ced 117 /* <-MISRA 19.4 */ /* <-SEC M1.8.2 */
dkato 0:37e1e6a45ced 118
dkato 0:37e1e6a45ced 119
dkato 0:37e1e6a45ced 120 /***********************************************************************
dkato 0:37e1e6a45ced 121 * Macros: IF_DS
dkato 0:37e1e6a45ced 122 * Error check on DEBUG and QAC version for always false
dkato 0:37e1e6a45ced 123 *
dkato 0:37e1e6a45ced 124 * Description:
dkato 0:37e1e6a45ced 125 * QAC assist tool founds IF_DS keyword.
dkato 0:37e1e6a45ced 126 * Sentence using this expects IPA SEC O4.1, O1.1.
dkato 0:37e1e6a45ced 127 ************************************************************************/
dkato 0:37e1e6a45ced 128 #define IF_DS IF_DQ
dkato 0:37e1e6a45ced 129
dkato 0:37e1e6a45ced 130
dkato 0:37e1e6a45ced 131 /***********************************************************************
dkato 0:37e1e6a45ced 132 * Macros: IF_S
dkato 0:37e1e6a45ced 133 * Error check on QAC version for always false
dkato 0:37e1e6a45ced 134 *
dkato 0:37e1e6a45ced 135 * Description:
dkato 0:37e1e6a45ced 136 * QAC assist tool founds IF_S keyword.
dkato 0:37e1e6a45ced 137 * Compiler always does not check it.
dkato 0:37e1e6a45ced 138 ************************************************************************/
dkato 0:37e1e6a45ced 139 /* ->MISRA 19.4 : Compliant with C language syntax. */ /* ->SEC M1.8.2 */
dkato 0:37e1e6a45ced 140 #if defined(__QAC_ARM_H__)
dkato 0:37e1e6a45ced 141 #define IF_S if
dkato 0:37e1e6a45ced 142 #else
dkato 0:37e1e6a45ced 143 #define IF_S( Condition ) if ( false )
dkato 0:37e1e6a45ced 144 #endif
dkato 0:37e1e6a45ced 145 /* <-MISRA 19.4 */ /* <-SEC M1.8.2 */
dkato 0:37e1e6a45ced 146
dkato 0:37e1e6a45ced 147
dkato 0:37e1e6a45ced 148 /**
dkato 0:37e1e6a45ced 149 * @def R_CUT_IF_ALWAYS
dkato 0:37e1e6a45ced 150 * @brief Whether a expression always true/false was cut or not.
dkato 0:37e1e6a45ced 151 * @par Parameters
dkato 0:37e1e6a45ced 152 * None
dkato 0:37e1e6a45ced 153 * @return None.
dkato 0:37e1e6a45ced 154 *
dkato 0:37e1e6a45ced 155 * @par Description
dkato 0:37e1e6a45ced 156 * The value is 0 or 1.
dkato 0:37e1e6a45ced 157 * This macro is for @ref R_CUT_IF_ALWAYS_TRUE and @ref R_CUT_IF_ALWAYS_FALSE.
dkato 0:37e1e6a45ced 158 */
dkato 0:37e1e6a45ced 159 #ifndef R_CUT_IF_ALWAYS
dkato 0:37e1e6a45ced 160 #if defined(__QAC_ARM_H__)
dkato 0:37e1e6a45ced 161 #define R_CUT_IF_ALWAYS 0
dkato 0:37e1e6a45ced 162 #else
dkato 0:37e1e6a45ced 163 #define R_CUT_IF_ALWAYS 1
dkato 0:37e1e6a45ced 164 #endif
dkato 0:37e1e6a45ced 165 #endif
dkato 0:37e1e6a45ced 166
dkato 0:37e1e6a45ced 167
dkato 0:37e1e6a45ced 168 /**
dkato 0:37e1e6a45ced 169 * @def R_CUT_IF_ALWAYS_TRUE
dkato 0:37e1e6a45ced 170 * @brief Assertion that the expression is always true
dkato 0:37e1e6a45ced 171 * @par Parameters
dkato 0:37e1e6a45ced 172 * None
dkato 0:37e1e6a45ced 173 * @return None.
dkato 0:37e1e6a45ced 174 */
dkato 0:37e1e6a45ced 175 #if R_CUT_IF_ALWAYS
dkato 0:37e1e6a45ced 176 #define R_CUT_IF_ALWAYS_TRUE( expression_and )
dkato 0:37e1e6a45ced 177 #else
dkato 0:37e1e6a45ced 178 /* ->MISRA 19.10 : Can not in ( ). e.g. expression_and = " a >= 0 &&" */
dkato 0:37e1e6a45ced 179 #define R_CUT_IF_ALWAYS_TRUE( expression_and ) expression_and
dkato 0:37e1e6a45ced 180 /* <-MISRA 19.10 */
dkato 0:37e1e6a45ced 181 #endif
dkato 0:37e1e6a45ced 182
dkato 0:37e1e6a45ced 183
dkato 0:37e1e6a45ced 184 /**
dkato 0:37e1e6a45ced 185 * @def R_CUT_IF_ALWAYS_FALSE
dkato 0:37e1e6a45ced 186 * @brief Assertion that the expression is always false
dkato 0:37e1e6a45ced 187 * @par Parameters
dkato 0:37e1e6a45ced 188 * None
dkato 0:37e1e6a45ced 189 * @return None.
dkato 0:37e1e6a45ced 190 */
dkato 0:37e1e6a45ced 191 #if R_CUT_IF_ALWAYS
dkato 0:37e1e6a45ced 192 #define R_CUT_IF_ALWAYS_FALSE( expression_or )
dkato 0:37e1e6a45ced 193 #else
dkato 0:37e1e6a45ced 194 /* ->MISRA 19.10 : Can not in ( ). e.g. expression_and = " a >= 0 &&" */
dkato 0:37e1e6a45ced 195 #define R_CUT_IF_ALWAYS_FALSE( expression_or ) expression_or
dkato 0:37e1e6a45ced 196 /* <-MISRA 19.10 */
dkato 0:37e1e6a45ced 197 #endif
dkato 0:37e1e6a45ced 198
dkato 0:37e1e6a45ced 199
dkato 0:37e1e6a45ced 200 /**
dkato 0:37e1e6a45ced 201 * @def R_UNREFERENCED_VARIABLE
dkato 0:37e1e6a45ced 202 * @brief Assertion that specified variable is not referenced
dkato 0:37e1e6a45ced 203 * @par Parameters
dkato 0:37e1e6a45ced 204 * None
dkato 0:37e1e6a45ced 205 * @return None.
dkato 0:37e1e6a45ced 206 *
dkato 0:37e1e6a45ced 207 * @par Description
dkato 0:37e1e6a45ced 208 * This avoids warning of "set but never used".
dkato 0:37e1e6a45ced 209 */
dkato 0:37e1e6a45ced 210 /* ->MISRA 19.7 : Argument must be any type */ /* ->SEC M5.1.3 */
dkato 0:37e1e6a45ced 211 #define R_UNREFERENCED_VARIABLE( a1 ) R_UNREFERENCED_VARIABLE_Sub( &(a1) )
dkato 0:37e1e6a45ced 212 /* <-MISRA 19.7 */ /* <-SEC M5.1.3 */
dkato 0:37e1e6a45ced 213 /* ->QAC 3206 : Not used argument */
dkato 0:37e1e6a45ced 214 INLINE void R_UNREFERENCED_VARIABLE_Sub( volatile const void *a1 ) { }
dkato 0:37e1e6a45ced 215 /* <-QAC 3206 */
dkato 0:37e1e6a45ced 216
dkato 0:37e1e6a45ced 217
dkato 0:37e1e6a45ced 218 /**
dkato 0:37e1e6a45ced 219 * @def R_UNREFERENCED_VARIABLE_2
dkato 0:37e1e6a45ced 220 * @brief Assertion that specified variable is not referenced
dkato 0:37e1e6a45ced 221 * @par Parameters
dkato 0:37e1e6a45ced 222 * None
dkato 0:37e1e6a45ced 223 * @return None.
dkato 0:37e1e6a45ced 224 *
dkato 0:37e1e6a45ced 225 * @par Description
dkato 0:37e1e6a45ced 226 * This avoids warning of "set but never used".
dkato 0:37e1e6a45ced 227 */
dkato 0:37e1e6a45ced 228 /* ->MISRA 19.7 : Argument must be any type */ /* ->SEC M5.1.3 */
dkato 0:37e1e6a45ced 229 #define R_UNREFERENCED_VARIABLE_2( a1,a2 ) R_UNREFERENCED_VARIABLE_2_Sub( &(a1), &(a2) )
dkato 0:37e1e6a45ced 230 /* <-MISRA 19.7 */ /* <-SEC M5.1.3 */
dkato 0:37e1e6a45ced 231 /* ->QAC 3206 : Not used argument */
dkato 0:37e1e6a45ced 232 INLINE void R_UNREFERENCED_VARIABLE_2_Sub( volatile const void *a1, volatile const void *a2 ) { }
dkato 0:37e1e6a45ced 233 /* <-QAC 3206 */
dkato 0:37e1e6a45ced 234
dkato 0:37e1e6a45ced 235
dkato 0:37e1e6a45ced 236 /**
dkato 0:37e1e6a45ced 237 * @def R_UNREFERENCED_VARIABLE_3
dkato 0:37e1e6a45ced 238 * @brief Assertion that specified variable is not referenced
dkato 0:37e1e6a45ced 239 * @par Parameters
dkato 0:37e1e6a45ced 240 * None
dkato 0:37e1e6a45ced 241 * @return None.
dkato 0:37e1e6a45ced 242 *
dkato 0:37e1e6a45ced 243 * @par Description
dkato 0:37e1e6a45ced 244 * This avoids warning of "set but never used".
dkato 0:37e1e6a45ced 245 */
dkato 0:37e1e6a45ced 246 /* ->MISRA 19.7 : Argument must be any type */ /* ->SEC M5.1.3 */
dkato 0:37e1e6a45ced 247 #define R_UNREFERENCED_VARIABLE_3( a1,a2,a3 ) R_UNREFERENCED_VARIABLE_3_Sub( &(a1), &(a2), &(a3) )
dkato 0:37e1e6a45ced 248 /* <-MISRA 19.7 */ /* <-SEC M5.1.3 */
dkato 0:37e1e6a45ced 249 /* ->QAC 3206 : Not used argument */
dkato 0:37e1e6a45ced 250 INLINE void R_UNREFERENCED_VARIABLE_3_Sub( volatile const void *a1, volatile const void *a2,
dkato 0:37e1e6a45ced 251 volatile const void *a3 ) { }
dkato 0:37e1e6a45ced 252 /* <-QAC 3206 */
dkato 0:37e1e6a45ced 253
dkato 0:37e1e6a45ced 254
dkato 0:37e1e6a45ced 255 /**
dkato 0:37e1e6a45ced 256 * @def R_UNREFERENCED_VARIABLE_4
dkato 0:37e1e6a45ced 257 * @brief Assertion that specified variable is not referenced
dkato 0:37e1e6a45ced 258 * @par Parameters
dkato 0:37e1e6a45ced 259 * None
dkato 0:37e1e6a45ced 260 * @return None.
dkato 0:37e1e6a45ced 261 *
dkato 0:37e1e6a45ced 262 * @par Description
dkato 0:37e1e6a45ced 263 * This avoids warning of "set but never used".
dkato 0:37e1e6a45ced 264 */
dkato 0:37e1e6a45ced 265 /* ->MISRA 19.7 : Argument must be any type */ /* ->SEC M5.1.3 */
dkato 0:37e1e6a45ced 266 #define R_UNREFERENCED_VARIABLE_4( a1,a2,a3,a4 ) R_UNREFERENCED_VARIABLE_4_Sub( &(a1), &(a2), &(a3), &(a4) )
dkato 0:37e1e6a45ced 267 /* <-MISRA 19.7 */ /* <-SEC M5.1.3 */
dkato 0:37e1e6a45ced 268 /* ->QAC 3206 : Not used argument */
dkato 0:37e1e6a45ced 269 INLINE void R_UNREFERENCED_VARIABLE_4_Sub( volatile const void *a1, volatile const void *a2,
dkato 0:37e1e6a45ced 270 volatile const void *a3, volatile const void *a4 ) { }
dkato 0:37e1e6a45ced 271 /* <-QAC 3206 */
dkato 0:37e1e6a45ced 272
dkato 0:37e1e6a45ced 273
dkato 0:37e1e6a45ced 274 /**
dkato 0:37e1e6a45ced 275 * @def R_IT_WILL_BE_NOT_CONST
dkato 0:37e1e6a45ced 276 * @brief variable WILL_BE_NOT_CONST
dkato 0:37e1e6a45ced 277 * @par Parameters
dkato 0:37e1e6a45ced 278 * None
dkato 0:37e1e6a45ced 279 * @return None.
dkato 0:37e1e6a45ced 280 *
dkato 0:37e1e6a45ced 281 * @par Description
dkato 0:37e1e6a45ced 282 * This avoids MISRA 16.7 advisory and SEC M1.11.1 for not modified API argument
dkato 0:37e1e6a45ced 283 * will be not const future.
dkato 0:37e1e6a45ced 284 */
dkato 0:37e1e6a45ced 285 /* ->MISRA 16.7 */ /* ->SEC M1.11.1 : Tell to QAC/compiler that "*Pointer" was changed */
dkato 0:37e1e6a45ced 286 INLINE void R_IT_WILL_BE_NOT_CONST( void *Pointer ); /* MISRA 8.1 Advice */
dkato 0:37e1e6a45ced 287 INLINE void R_IT_WILL_BE_NOT_CONST( void *Pointer )
dkato 0:37e1e6a45ced 288 {
dkato 0:37e1e6a45ced 289 R_UNREFERENCED_VARIABLE( Pointer );
dkato 0:37e1e6a45ced 290 }
dkato 0:37e1e6a45ced 291 /* <-MISRA 16.7 */ /* <-SEC M1.11.1 */
dkato 0:37e1e6a45ced 292
dkato 0:37e1e6a45ced 293
dkato 0:37e1e6a45ced 294 /**
dkato 0:37e1e6a45ced 295 * @def R_AVOID_UNSAFE_ALWAYS_WARNING
dkato 0:37e1e6a45ced 296 * @brief Specifies the code cannot be cut.
dkato 0:37e1e6a45ced 297 * @par Parameters
dkato 0:37e1e6a45ced 298 * None
dkato 0:37e1e6a45ced 299 * @return None.
dkato 0:37e1e6a45ced 300 *
dkato 0:37e1e6a45ced 301 * @par Description
dkato 0:37e1e6a45ced 302 * This avoid MISRA 13.7 require always true/false condition.
dkato 0:37e1e6a45ced 303 * This tells to QAC/compiler that "Variable" was changed.
dkato 0:37e1e6a45ced 304 */
dkato 0:37e1e6a45ced 305 /* ->MISRA 19.7 : Argument must be any type */ /* ->SEC M5.1.3 */
dkato 0:37e1e6a45ced 306 #define R_AVOID_UNSAFE_ALWAYS_WARNING( Variable ) \
dkato 0:37e1e6a45ced 307 R_AVOID_UNSAFE_ALWAYS_WARNING_SUB( &(Variable) )
dkato 0:37e1e6a45ced 308 /* <-MISRA 19.7 */ /* <-SEC M5.1.3 */
dkato 0:37e1e6a45ced 309 /* ->MISRA 16.7 : Tell to QAC/compiler that "Variable" was changed */ /* ->SEC M1.11.1 */
dkato 0:37e1e6a45ced 310 INLINE void R_AVOID_UNSAFE_ALWAYS_WARNING_SUB( void *Pointer ); /* MISRA 8.1 Advice */
dkato 0:37e1e6a45ced 311 INLINE void R_AVOID_UNSAFE_ALWAYS_WARNING_SUB( void *Pointer )
dkato 0:37e1e6a45ced 312 /* <-MISRA 16.7 */ /* <-SEC M1.11.1 */
dkato 0:37e1e6a45ced 313 {
dkato 0:37e1e6a45ced 314 R_UNREFERENCED_VARIABLE( Pointer );
dkato 0:37e1e6a45ced 315 }
dkato 0:37e1e6a45ced 316
dkato 0:37e1e6a45ced 317
dkato 0:37e1e6a45ced 318 /**
dkato 0:37e1e6a45ced 319 * @def TO_UNSIGNED
dkato 0:37e1e6a45ced 320 * @brief Cast to unsigned type constant value
dkato 0:37e1e6a45ced 321 * @par Parameters
dkato 0:37e1e6a45ced 322 * None
dkato 0:37e1e6a45ced 323 * @return None.
dkato 0:37e1e6a45ced 324 */
dkato 0:37e1e6a45ced 325 /* ->MISRA 19.7 : It is not able to replace to function because this expands macro's parameter */
dkato 0:37e1e6a45ced 326 /* ->SEC M5.1.3 */
dkato 0:37e1e6a45ced 327 #define TO_UNSIGNED(x) TO_UNSIGNED_AGAIN(x) /* Expand "x" */
dkato 0:37e1e6a45ced 328 /* <-MISRA 19.7 */
dkato 0:37e1e6a45ced 329 /* <-SEC M5.1.3 */
dkato 0:37e1e6a45ced 330
dkato 0:37e1e6a45ced 331 /* ->MISRA 19.13 */ /* ->SEC M5.1.2 (1) */
dkato 0:37e1e6a45ced 332 #define TO_UNSIGNED_AGAIN(x) (x##u)
dkato 0:37e1e6a45ced 333 /* <-MISRA 19.13 */ /* <-SEC M5.1.2 (1) */
dkato 0:37e1e6a45ced 334
dkato 0:37e1e6a45ced 335
dkato 0:37e1e6a45ced 336 /**
dkato 0:37e1e6a45ced 337 * @brief Cast to unsigned type constant value
dkato 0:37e1e6a45ced 338 *
dkato 0:37e1e6a45ced 339 * @par Parameters
dkato 0:37e1e6a45ced 340 * None
dkato 0:37e1e6a45ced 341 * @return None.
dkato 0:37e1e6a45ced 342 *
dkato 0:37e1e6a45ced 343 * @par Description
dkato 0:37e1e6a45ced 344 * This can not avoid QAC warning. This macro is for count reviewed code automatically.
dkato 0:37e1e6a45ced 345 */
dkato 0:37e1e6a45ced 346 INLINE uint32_t R_ToUnsigned( int32_t const ConstantInteger )
dkato 0:37e1e6a45ced 347 {
dkato 0:37e1e6a45ced 348 return (uint32_t) ConstantInteger;
dkato 0:37e1e6a45ced 349 }
dkato 0:37e1e6a45ced 350
dkato 0:37e1e6a45ced 351
dkato 0:37e1e6a45ced 352 /**
dkato 0:37e1e6a45ced 353 * @brief Cast to signed type constant value
dkato 0:37e1e6a45ced 354 *
dkato 0:37e1e6a45ced 355 * @par Parameters
dkato 0:37e1e6a45ced 356 * None
dkato 0:37e1e6a45ced 357 * @return None.
dkato 0:37e1e6a45ced 358 *
dkato 0:37e1e6a45ced 359 * @par Description
dkato 0:37e1e6a45ced 360 * This can not avoid QAC warning. This macro is for count reviewed code automatically.
dkato 0:37e1e6a45ced 361 */
dkato 0:37e1e6a45ced 362 INLINE int32_t R_ToSigned( uint32_t const ConstantInteger )
dkato 0:37e1e6a45ced 363 {
dkato 0:37e1e6a45ced 364 return (int32_t) ConstantInteger;
dkato 0:37e1e6a45ced 365 }
dkato 0:37e1e6a45ced 366
dkato 0:37e1e6a45ced 367
dkato 0:37e1e6a45ced 368 /***********************************************************************
dkato 0:37e1e6a45ced 369 * End of File:
dkato 0:37e1e6a45ced 370 ************************************************************************/
dkato 0:37e1e6a45ced 371 #ifdef __cplusplus
dkato 0:37e1e6a45ced 372 } /* extern "C" */
dkato 0:37e1e6a45ced 373 #endif /* __cplusplus */
dkato 0:37e1e6a45ced 374
dkato 0:37e1e6a45ced 375 #endif /* R_STATIC_AN_TAG_H */
dkato 0:37e1e6a45ced 376