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

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers r_jcu_local.h Source File

r_jcu_local.h

00001 /*******************************************************************************
00002 * DISCLAIMER
00003 * This software is supplied by Renesas Electronics Corporation and is only
00004 * intended for use with Renesas products. No other uses are authorized. This
00005 * software is owned by Renesas Electronics Corporation and is protected under
00006 * all applicable laws, including copyright laws.
00007 * THIS SOFTWARE IS PROVIDED "AS IS" AND RENESAS MAKES NO WARRANTIES REGARDING
00008 * THIS SOFTWARE, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING BUT NOT
00009 * LIMITED TO WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE
00010 * AND NON-INFRINGEMENT. ALL SUCH WARRANTIES ARE EXPRESSLY DISCLAIMED.
00011 * TO THE MAXIMUM EXTENT PERMITTED NOT PROHIBITED BY LAW, NEITHER RENESAS
00012 * ELECTRONICS CORPORATION NOR ANY OF ITS AFFILIATED COMPANIES SHALL BE LIABLE
00013 * FOR ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES FOR
00014 * ANY REASON RELATED TO THIS SOFTWARE, EVEN IF RENESAS OR ITS AFFILIATES HAVE
00015 * BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
00016 * Renesas reserves the right, without notice, to make changes to this software
00017 * and to discontinue the availability of this software. By using this software,
00018 * you agree to the additional terms and conditions found by accessing the
00019 * following link:
00020 * http://www.renesas.com/disclaimer
00021 * Copyright (C) 2012 - 2014 Renesas Electronics Corporation. All rights reserved.
00022 *******************************************************************************/
00023 /******************************************************************************
00024 * $FileName: jcu_local.h $
00025 * $Module: JCU $ $PublicVersion: 1.00 $ (=JCU_VERSION)
00026 * $Rev: 35 $
00027 * $Date:: 2014-02-26 13:18:53 +0900#$
00028 * Description  : JCU driver local parameter
00029 ******************************************************************************/
00030 
00031 #ifndef JCU_LOCAL_H
00032 #define JCU_LOCAL_H
00033 
00034 /******************************************************************************
00035 Includes   <System Includes> , "Project Includes"
00036 ******************************************************************************/
00037 #include    "r_jcu_api.h"
00038 #include    "r_jcu_user.h"
00039 
00040 #ifdef __cplusplus
00041 extern "C"
00042 {
00043 #endif /* __cplusplus */
00044 /******************************************************************************
00045 Typedef definitions
00046 ******************************************************************************/
00047 
00048 typedef struct st_jcu_i_lock_t   jcu_i_lock_t;  /*[jcu_i_lock_t]*/
00049 
00050 /*! [jcu_internal_information_t] Internal Information for this driver */
00051 typedef struct {
00052     jcu_codec_status_t             Codec;
00053     bool_t                         IsCountMode;
00054     jcu_int_detail_errors_t        ErrorFilter;  /* 1=Enable */
00055 
00056     jcu_async_status_t             AsyncStatus;
00057     r_ospl_caller_t                InterruptCallbackCaller;
00058     jcu_i_lock_t                  *I_Lock;
00059     const r_ospl_i_lock_vtable_t  *I_LockVTable;
00060     bool_t                         Is_I_LockMaster;
00061     r_ospl_async_t                *AsyncForFinalize;
00062 } jcu_internal_information_t ;
00063 
00064 /*[jcu_i_lock_t]*/
00065 struct st_jcu_i_lock_t {
00066     bool_t        IsLock;
00067     bool_t        IsRequestedFinalize;
00068 };
00069 
00070 
00071 /******************************************************************************
00072 Macro definitions
00073 ******************************************************************************/
00074 
00075 /******************************************************************************
00076 Variable Externs
00077 ******************************************************************************/
00078 
00079 /******************************************************************************
00080 Functions Prototypes
00081 ******************************************************************************/
00082 jcu_internal_information_t   *R_JCU_GetInternalInformation(void);
00083 jcu_i_lock_t    *R_JCU_GetILockObject(void);
00084 void             R_JCU_I_LOCK_Finalize(void);
00085 jcu_errorcode_t  R_JCU_TerminateStep2(void);
00086 
00087 #ifdef      JCU_PARAMETER_CHECK
00088 jcu_errorcode_t JCU_ParaCheckStart(void);
00089 jcu_errorcode_t JCU_ParaCheckSetCountMode(const jcu_count_mode_param_t  *const buffer);
00090 jcu_errorcode_t JCU_ParaCheckSelectCodec(const jcu_codec_t codec);
00091 jcu_errorcode_t JCU_ParaCheckSetCallbackFunc(const uintptr_t type);
00092 jcu_errorcode_t JCU_ParaCheckSetDecodeParam(const jcu_decode_param_t *const decode, const jcu_buffer_param_t *const buffer);
00093 jcu_errorcode_t JCU_ParaCheckGetImageInfo(const jcu_image_info_t *const buffer);
00094 jcu_errorcode_t JCU_ParaCheckGetErrorInfo(const jcu_detail_error_t *const errorCode);
00095 jcu_errorcode_t JCU_ParaCheckSetQuantizationTbl(const jcu_table_no_t tableNo);
00096 jcu_errorcode_t JCU_ParaCheckSetHuffmanTable(const jcu_table_no_t tableNo, const jcu_huff_t type);
00097 jcu_errorcode_t JCU_ParaCheckEncodeParam(const jcu_encode_param_t *const encode, const jcu_buffer_param_t *const buffer);
00098 jcu_errorcode_t JCU_CheckInterruptSource(const uint32_t interruptKind);
00099 #endif /* JCU_PARAMETER_CHECK */
00100 
00101 jcu_errorcode_t JCU_SetRegisterForInitialize(void);
00102 void JCU_SetRegisterForCodec(const jcu_codec_t codec);
00103 void JCU_SetRegisterForStart(const jcu_int_detail_error_t error_filter);
00104 void JCU_SetRegisterForReset(void);
00105 void JCU_SetRegisterForSetCountMode(const jcu_count_mode_param_t *const buffer);
00106 void JCU_SetRegisterForContinue(const jcu_continue_type_t type);
00107 void JCU_SetRegisterForSetDecodePrm(const jcu_decode_param_t *const decode, const jcu_buffer_param_t *const buffer);
00108 void JCU_SetRegisterForSetQtTable(const jcu_table_no_t tableNo, const uint8_t *const  table);
00109 void JCU_SetRegisterForSetHuffTbl(const jcu_table_no_t tableNo, const jcu_huff_t type, const uint8_t *const table);
00110 void JCU_SetRegisterForSetEncodePrm(const jcu_encode_param_t *const encode, const jcu_buffer_param_t *const buffer);
00111 void JCU_SetRegisterForSetPause(const bool_t is_pause, const jcu_int_detail_errors_t filter);
00112 void JCU_GetRegisterForGetImageInfo(jcu_image_info_t *const buffer);
00113 void JCU_GetEncodedSize(size_t *const out_Size);
00114 void JCU_ClearInterruptFlag(void);
00115 
00116 
00117 /* ->SEC M1.2.2(QAC-1259) */
00118 /*    If "Value" is signed, this is depend on CPU bit width. */
00119 /*    But driver code is no problem. */
00120 /*    This expects 32bit CPU. */
00121 /* ->SEC R3.6.2(QAC-3345) */
00122 /*    Volatile access at left of "=" and right of "=". */
00123 /*    But this is not depend on compiler spcifications. */
00124 /* ->MISRA 19.12 ->MISRA 19.13 ->SEC M5.1.2 (1) */
00125 #define R_SET_REG_BIT_FIELD( Register, BitName, Value ) \
00126         ( (Register) = (BitName##_TYPE)( ( (uint32_t)(Register) & (uint32_t)(~(BitName##_MASK) ) ) |\
00127         ( (uint32_t)( (uint32_t)(Value) << (BitName##_SHIFT) ) & (uint32_t)(BitName##_MASK) ) ) )
00128 #define R_GET_REG_BIT_FIELD( Register, BitName ) \
00129         ( (BitName##_TYPE)( ( ((uint32_t)(Register)) & (uint32_t)(BitName##_MASK) ) >> (BitName##_SHIFT) ) )
00130 /* <-SEC M1.2.3(QAC-1259) */
00131 /* <-SEC R3.6.2(QAC-3345) */
00132 /* <-MISRA 19.12 <-MISRA 19.13 <-SEC M5.1.2 (1) */
00133 
00134 /* Value of register */
00135 /* 1bit(Flag) */
00136 #define REG_F_CLR (0u)
00137 #define REG_F_SET (1u)
00138 
00139 /* Bit field name (Register name) */
00140 
00141 /* SRST(CPG.SWRSTCR2) */
00142 #define SRST_MASK       (0x00000002u)
00143 #define SRST_SHIFT      (1u)
00144 #define SRST_TYPE       uint8_t
00145 
00146 
00147 /*DSP(JCU.JCMOD) */
00148 #define DSP_MASK        (0x00000008u)
00149 #define DSP_SHIFT       (3u)
00150 #define DSP_TYPE        uint8_t
00151 
00152 /*REDU(JCU.JCMOD) */
00153 #define REDU_MASK       (0x00000007u)
00154 #define REDU_SHIFT      (0u)
00155 #define REDU_TYPE       uint8_t
00156 
00157 
00158 /*BRST(JCU.JCCMD) */
00159 #define BRST_MASK       (0x00000080u)
00160 #define BRST_SHIFT      (7u)
00161 #define BRST_TYPE       uint8_t
00162 
00163 /*JEND(JCU.JCCMD) */
00164 #define JEND_MASK       (0x00000004u)
00165 #define JEND_SHIFT      (2u)
00166 #define JEND_TYPE       uint8_t
00167 
00168 /*JRST(JCU.JCCMD) */
00169 #define JRST_MASK       (0x00000002u)
00170 #define JRST_SHIFT      (1u)
00171 #define JRST_TYPE       uint8_t
00172 
00173 /*JSRT(JCU.JCCMD) */
00174 #define JSRT_MASK       (0x00000001u)
00175 #define JSRT_SHIFT      (0u)
00176 #define JSRT_TYPE       uint8_t
00177 
00178 
00179 /*QT3(JCU.JCQTN) */
00180 #define QT3_MASK        (0x00000030u)
00181 #define QT3_SHIFT       (4u)
00182 #define QT3_TYPE        uint8_t
00183 
00184 /*QT2(JCU.JCQTN) */
00185 #define QT2_MASK        (0x0000000Cu)
00186 #define QT2_SHIFT       (2u)
00187 #define QT2_TYPE        uint8_t
00188 
00189 /*QT1(JCU.JCQTN) */
00190 #define QT1_MASK        (0x00000003u)
00191 #define QT1_SHIFT       (0u)
00192 #define QT1_TYPE        uint8_t
00193 
00194 
00195 /*HTA3(JCU.JCHTN) */
00196 #define HTA3_MASK       (0x00000020u)
00197 #define HTA3_SHIFT      (5u)
00198 #define HTA3_TYPE       uint8_t
00199 
00200 /*HTD3(JCU.JCHTN) */
00201 #define HTD3_MASK       (0x00000010u)
00202 #define HTD3_SHIFT      (4u)
00203 #define HTD3_TYPE       uint8_t
00204 
00205 /*HTA2(JCU.JCHTN) */
00206 #define HTA2_MASK       (0x00000008u)
00207 #define HTA2_SHIFT      (3u)
00208 #define HTA2_TYPE       uint8_t
00209 
00210 /*HTD2(JCU.JCHTN) */
00211 #define HTD2_MASK       (0x00000004u)
00212 #define HTD2_SHIFT      (2u)
00213 #define HTD2_TYPE       uint8_t
00214 
00215 /*HTA1(JCU.JCHTN) */
00216 #define HTA1_MASK       (0x00000002u)
00217 #define HTA1_SHIFT      (1u)
00218 #define HTA1_TYPE       uint8_t
00219 
00220 /*HTD1(JCU.JCHTN) */
00221 #define HTD1_MASK       (0x00000001u)
00222 #define HTD1_SHIFT      (0u)
00223 #define HTD1_TYPE       uint8_t
00224 
00225 
00226 /*INT7(JCU.JINTE0) Error of restart interval data. JINTE0.INT7 -> JINTS0.INS5 */
00227 #define INT7_MASK       (0x00000080u)
00228 #define INT7_SHIFT      (7u)
00229 #define INT7_TYPE       uint8_t
00230 
00231 /*INT6(JCU.JINTE0) Error of Segment total data. JINTE0.INT6 -> JINTS0.INS5 */
00232 #define INT6_MASK       (0x00000040u)
00233 #define INT6_SHIFT      (6u)
00234 #define INT6_TYPE       uint8_t
00235 
00236 /*INT5(JCU.JINTE0) Error of MCU block data. JINTE0.INT5 -> JINTS0.INS5 */
00237 #define INT5_MASK       (0x00000020u)
00238 #define INT5_SHIFT      (5u)
00239 #define INT5_TYPE       uint8_t
00240 
00241 /*INT3(JCU.JINTE0) */
00242 #define INT3_MASK       (0x00000008u)
00243 #define INT3_SHIFT      (3u)
00244 #define INT3_TYPE       uint8_t
00245 
00246 
00247 /*INS6(JCU.JINTS0) End Core Only */
00248 #define INS6_MASK       (0x00000040u)
00249 #define INS6_SHIFT      (6u)
00250 #define INS6_TYPE       uint8_t
00251 
00252 /*INS5(JCU.JINTS0) Decode Error */
00253 #define INS5_MASK       (0x00000020u)
00254 #define INS5_SHIFT      (5u)
00255 #define INS5_TYPE       uint8_t
00256 
00257 /*INS3(JCU.JINTS0) Get Image Information */
00258 #define INS3_MASK       (0x00000008u)
00259 #define INS3_SHIFT      (3u)
00260 #define INS3_TYPE       uint8_t
00261 
00262 
00263 /*ERR(JCU.JCDERR) */
00264 #define ERR_MASK        (0x0000000Fu)
00265 #define ERR_SHIFT       (0u)
00266 #define ERR_TYPE        uint8_t
00267 
00268 
00269 /*JOUTRINI(JCU.JIFECNT) */
00270 #define JOUTRINI_MASK   (0x00004000u)
00271 #define JOUTRINI_SHIFT  (14u)
00272 #define JOUTRINI_TYPE   uint32_t
00273 
00274 /*JOUTRCMD(JCU.JIFECNT) */
00275 #define JOUTRCMD_MASK   (0x00002000u)
00276 #define JOUTRCMD_SHIFT  (13u)
00277 #define JOUTRCMD_TYPE   uint32_t
00278 
00279 /*JOUTC(JCU.JIFECNT) */
00280 #define JOUTC_MASK      (0x00001000u)
00281 #define JOUTC_SHIFT     (12u)
00282 #define JOUTC_TYPE      uint32_t
00283 
00284 /*JOUTSWAP(JCU.JIFECNT) */
00285 #define JOUTSWAP_MASK   (0x00000700u)
00286 #define JOUTSWAP_SHIFT  (8u)
00287 #define JOUTSWAP_TYPE   uint32_t
00288 
00289 /*DINRINI(JCU.JIFECNT) */
00290 #define DINRINI_MASK    (0x00000040u)
00291 #define DINRINI_SHIFT   (6u)
00292 #define DINRINI_TYPE    uint32_t
00293 
00294 /*DINRCMD(JCU.JIFECNT) */
00295 #define DINRCMD_MASK    (0x00000020u)
00296 #define DINRCMD_SHIFT   (5u)
00297 #define DINRCMD_TYPE    uint32_t
00298 
00299 /*DINLC(JCU.JIFECNT) */
00300 #define DINLC_MASK      (0x00000010u)
00301 #define DINLC_SHIFT     (4u)
00302 #define DINLC_TYPE      uint32_t
00303 
00304 /*DINSWAP(JCU.JIFECNT) */
00305 #define DINSWAP_MASK    (0x00000007u)
00306 #define DINSWAP_SHIFT   (0u)
00307 #define DINSWAP_TYPE    uint32_t
00308 
00309 
00310 /*ESMW(JCU.JIFESOFST) */
00311 #define ESMW_MASK       (0x00007FFFu)
00312 #define ESMW_SHIFT      (0u)
00313 #define ESMW_TYPE       uint32_t
00314 
00315 
00316 /*LINES(JCU.JIFESLC, JCU.JIFDDLC) */
00317 #define LINES_MASK      (0x0000FFFFu)
00318 #define LINES_SHIFT     (0u)
00319 #define LINES_TYPE      uint32_t
00320 #define LINES_CLEAR     (0u)
00321 
00322 
00323 /*JDATAS(JCU.JIFESLC, JCU.JIFDSDC, JCU.JIFEDDC) */
00324 #define JDATAS_MASK     (0x0000FFFFu)
00325 #define JDATAS_SHIFT    (0u)
00326 #define JDATAS_TYPE     uint32_t
00327 #define JDATAS_CLEAR    (0u)
00328 
00329 
00330 /*VINTER(JCU.JIFDCNT) */
00331 #define VINTER_MASK     (0x3C000000u)
00332 #define VINTER_SHIFT    (28u)
00333 #define VINTER_TYPE     uint32_t
00334 
00335 /*HINTER(JCU.JIFDCNT) */
00336 #define HINTER_MASK     (0x0C000000u)
00337 #define HINTER_SHIFT    (26u)
00338 #define HINTER_TYPE     uint32_t
00339 
00340 /*OPF(JCU.JIFDCNT) */
00341 #define OPF_MASK        (0x03000000u)
00342 #define OPF_SHIFT       (24u)
00343 #define OPF_TYPE        uint32_t
00344 
00345 /*JINRINI(JCU.JIFDCNT) */
00346 #define JINRINI_MASK    (0x00004000u)
00347 #define JINRINI_SHIFT   (14u)
00348 #define JINRINI_TYPE    uint32_t
00349 
00350 /*JINRCMD(JCU.JIFDCNT) */
00351 #define JINRCMD_MASK    (0x00002000u)
00352 #define JINRCMD_SHIFT   (13u)
00353 #define JINRCMD_TYPE    uint32_t
00354 
00355 /*JINC(JCU.JIFDCNT) */
00356 #define JINC_MASK       (0x00001000u)
00357 #define JINC_SHIFT      (12u)
00358 #define JINC_TYPE       uint32_t
00359 
00360 /*JINSWAP(JCU.JIFDCNT) */
00361 #define JINSWAP_MASK    (0x00000700u)
00362 #define JINSWAP_SHIFT   (8u)
00363 #define JINSWAP_TYPE    uint32_t
00364 
00365 /*DOUTRINI(JCU.JIFDCNT) */
00366 #define DOUTRINI_MASK   (0x00000040u)
00367 #define DOUTRINI_SHIFT  (6u)
00368 #define DOUTRINI_TYPE   uint32_t
00369 
00370 /*DOUTRCMD(JCU.JIFDCNT) */
00371 #define DOUTRCMD_MASK   (0x00000020u)
00372 #define DOUTRCMD_SHIFT  (5u)
00373 #define DOUTRCMD_TYPE   uint32_t
00374 
00375 /*DOUTLC(JCU.JIFDCNT) */
00376 #define DOUTLC_MASK     (0x00000010u)
00377 #define DOUTLC_SHIFT    (4u)
00378 #define DOUTLC_TYPE     uint32_t
00379 
00380 /*DOUTSWAP(JCU.JIFDCNT) */
00381 #define DOUTSWAP_MASK   (0x00000007u)
00382 #define DOUTSWAP_SHIFT  (0u)
00383 #define DOUTSWAP_TYPE   uint32_t
00384 
00385 
00386 /*DDMW(JCU.JIFDDOFST) */
00387 #define DDMW_MASK       (0x00007FFFu)
00388 #define DDMW_SHIFT      (0u)
00389 #define DDMW_TYPE       uint32_t
00390 
00391 
00392 /*ALPHA(JCU.JIFDADT) */
00393 #define ALPHA_MASK      (0x000000FFu)
00394 #define ALPHA_SHIFT     (0u)
00395 #define ALPHA_TYPE      uint32_t
00396 
00397 
00398 /*CBTEN(JCU.JINTE1) */
00399 #define CBTEN_MASK      (0x00000040u)
00400 #define CBTEN_SHIFT     (6u)
00401 #define CBTEN_TYPE      uint32_t
00402 
00403 /*DINLEN(JCU.JINTE1) */
00404 #define DINLEN_MASK     (0x00000020u)
00405 #define DINLEN_SHIFT    (5u)
00406 #define DINLEN_TYPE     uint32_t
00407 
00408 /*JOUTEN(JCU.JINTE1) */
00409 #define JOUTEN_MASK     (0x00000010u)
00410 #define JOUTEN_SHIFT    (4u)
00411 #define JOUTEN_TYPE     uint32_t
00412 
00413 /*DBTEN(JCU.JINTE1) */
00414 #define DBTEN_MASK      (0x00000004u)
00415 #define DBTEN_SHIFT     (2u)
00416 #define DBTEN_TYPE      uint32_t
00417 
00418 /*JINEN(JCU.JINTE1) */
00419 #define JINEN_MASK      (0x00000002u)
00420 #define JINEN_SHIFT     (1u)
00421 #define JINEN_TYPE      uint32_t
00422 
00423 /*DOUTLEN(JCU.JINTE1) */
00424 #define DOUTLEN_MASK    (0x00000001u)
00425 #define DOUTLEN_SHIFT   (0u)
00426 #define DOUTLEN_TYPE    uint32_t
00427 
00428 
00429 /*CBTF(JCU.JINTS1) JINTE1.CBTEN -> JINTS1.CBTF */
00430 #define CBTF_MASK       (0x00000040u)
00431 #define CBTF_SHIFT      (6u)
00432 #define CBTF_TYPE       uint32_t
00433 
00434 /*DINLF(JCU.JINTS1) Input Data for Encoding */
00435 #define DINLF_MASK      (0x00000020u)
00436 #define DINLF_SHIFT     (5u)
00437 #define DINLF_TYPE      uint32_t
00438 
00439 /*JOUTF(JCU.JINTS1) Output Data for Encoding */
00440 #define JOUTF_MASK      (0x00000010u)
00441 #define JOUTF_SHIFT     (4u)
00442 #define JOUTF_TYPE      uint32_t
00443 
00444 /*DBTF(JCU.JINTS1) JINTE1.DBTEN -> JINTS1.DBTF */
00445 #define DBTF_MASK       (0x00000004u)
00446 #define DBTF_SHIFT      (2u)
00447 #define DBTF_TYPE       uint32_t
00448 
00449 /*JINF(JCU.JINTS1) Input Data for Decoding */
00450 #define JINF_MASK       (0x00000002u)
00451 #define JINF_SHIFT      (1u)
00452 #define JINF_TYPE       uint32_t
00453 
00454 /*DOUTLF(JCU.JINTS1) Output Data for Decoding */
00455 #define DOUTLF_MASK     (0x00000001u)
00456 #define DOUTLF_SHIFT    (0u)
00457 #define DOUTLF_TYPE     uint32_t
00458 
00459 
00460 /*DINYCHG(JCU.JIFESVSZ) */
00461 #define DINYCHG_MASK     (0x00008000u)
00462 #define DINYCHG_SHIFT    (15u)
00463 #define DINYCHG_TYPE     uint32_t
00464 
00465 /*DOUTYCHG(JCU.JIFESHSZ) */
00466 #define DOUTYCHG_MASK     (0x00008000u)
00467 #define DOUTYCHG_SHIFT    (15u)
00468 #define DOUTYCHG_TYPE     uint32_t
00469 
00470 /* Others */
00471 #define JCU_JINTS1_ALL  ( CBTF_MASK | DINLF_MASK | JOUTF_MASK | DBTF_MASK | JINF_MASK | DOUTLF_MASK )
00472 #define SHIFT_16BITS    (16u)                               /* 16bit-SHIFT */
00473 #define SHIFT_8BITS     (8u)                                /* 8bit-SHIFT */
00474 #define JCU_SHIFT_JINTS1 (8)
00475 
00476 #ifdef __cplusplus
00477 }
00478 #endif /* __cplusplus */
00479 
00480 #endif /* JCU_LOCAL_H */