Home
RZ/A1H Group JPEG Codec Unit(JCU) Sample Driver
Contents
1. ENESAS APPLICATION NOTE RZ A1 H Group RO1AN1862EJ0100 Rev 1 00 JPEG Codec Unit JCU Sample Driver Jun 20 2014 Introduction This application note describes the sample driver which is decoded from the JPEG image data and encoded to the JPEG image data The JPEG Codec Unit JCU sample driver offers the following features e The JPEG image data is converted to a raw image data of the RGB565 ARGB8888 and YCbCr422 formats O The raw image data of the YCbCr format is converted to a JPEG image data O The interrupt information is used for notice of conversion completion Target Device RZ A1H When applying the sample program covered in this application note to another microcomputer modify the program according to the specifications for the target microcomputer and conduct an extensive evaluation of the modified program RO1AN1862EJ0100 Rev 1 00 Page 1 of 40 Jun 20 2014 RENESAS RZ A1H Group JPEG Codec Unit JCU APPLICATION NOTE Table of contents le Spe GifigallonSu U L aa ante S ia umum aa Gaeta aaa E aaa 4 2 Operation Check Conditions n nn nn sns nsn na 5 3 Reference Application N0te 8 uuu aa aaa ssssssassaaaasskawasagsasasanas NAAA KARANE RNA NNE NAAA 6 4 Peripheral FUnclOnS uuu uuu u E u mu ss 7 5 Description OF FARO WANG oia 8 5 1 Hardware Configurations cms eee 8 52 Lito Pmnsto be Usd u u u u u u uu ms 9 6 Description of SoftWare prs
2. 64MB CS1 mirror space CS0 space 64MB CS0 mirror space Others 502MB Others 502MB Large capacity on chip RAM 10MB Large capacity on chip RAM 10MB SPI multi I O bus space 2 64MB Serial flash memory 64MB SPI multi I O bus space 1 64MB Serial flash memory 64MB CS5 space 64MB CS4 space 64MB User area CS3 space 64MB SDRAM 64MB CS2 space 64MB SDRAM 64MB CS1 space 64MB NOR flash memory 64MB CSO space 64MB NOR flash memory 64MB RO1AN1862EJ0100 Rev 1 00 Jun 20 2014 Page 12 of 40 RENESAS RZ A1H Group JPEG Codec Unit JCU APPLICATION NOTE 6 2 1 Section Assignment in Sample Code In this sample code the exception processing vector table and the IRQ interrupt handler are assigned to the large capacity on chip RAM and they are executed in such RAM to speed up the interrupt processing The transfer processing from the NOR flash memory area which is the program code of the exception processing vector table and the IRQ interrupt handler to the large capacity on chip RAM area the clear to zero processing for the data selection without initial data and the initialization for the data selection with initial data are executed by using the scatter loading function Refer to Image structure and generation in ARM Compiler toolchain Using the Linker provided by the ARM for more information abo
3. JCU_OUTPUT_BUFFER Resumes writing output image data JCU_GET_IMAGE_INFO 2 Clears the process stopped state caused by requests to read the image information 6 5 6 Table 6 12 jcu_detail_error_t Error classification of the JCU driver Symbol Value Description JCU_JCDERR_OK 0x0000 Normal JCU_JCDERR_SOI_NOT_FOUND 0x4521 SOI not detected SOI not detected until EOI detected JCU_JCDERR_INVALID_SOF JCU_JCDERR_UNPROVIDED_SOF 0x4522 0x4523 SOF1 to SOFF detected Unprovided pixel format detected JCU_JCDERR_SOF_ACCURACY 0x4524 SOF accuracy error Other than 8 detected JCU_JCDERR_DQT_ACCURACY 0x4525 DQT accuracy error Other than 0 detected JCU_JCDERR_COMPONENT_1 0x4526 Component error 1 The number of SOFO header components detected is other than 1 3 or 4 JCU_JCDERR_COMPONENT_2 0x4527 Component error 2 The number of components differs between SOFO header and SOS JCU_JCDERR_NO_SOFO_DQT_DHT 0x4528 SOFO DQT and DHT not detected when SOS detected JCU_JCDERR_SOS_NOT_FOUND JCU_JCDERR_EOI_NOT_FOUND RO1AN1862EJ0100 Rev 1 00 Jun 20 2014 0x4529 0x452A SOS not detected SOS not detected until EOI detected EOI not detected default Page 20 of 40 RENESAS RZ A1H Group JPEG Codec Unit JCU APPLICATION NOTE Symbol Value Description JCU_JCDERR_RESTART_INTERVAL 0x452B Restart interval data number error detected JCU_JCD
4. R_JCU_SetHuffmanTable No change R_JCU_GetEncodedSize No change R_JCU_GetAsyncStatus No change When executing R_JCU_TerminateAsync in the Run state the state doesn t transfer After interrupt occurred the callback function is executed the state transfers to Undef RO1AN1862EJ0100 Rev 1 00 Page 29 of 40 Jun 20 2014 RENESAS RZ A1H Group JPEG Codec Unit JCU APPLICATION NOTE RO1AN1862EJ0100 Rev 1 00 Page 30 of 40 Jun 20 2014 RENESAS RZ A1H Group JPEG Codec Unit JCU APPLICATION NOTE 6 9 Description of function The specification of sample code functions is following below 6 9 1 R_JCU_Initialize Synopsis Initializes the JCU driver Header r_jcu_api h Declaration jcu_errorcode_t R_JCU_Initialize void const NullConfig Description The state will be in the initialized status Initializes the internal status g_jcu_condition The user defined function R_JCU_Onlnitialize is called Perform the following processing in the user defined function 1 Clock supply to JCU 2 Sets the priority of interrupt 3 Sets the environment depend process Arguments void const NullConfig Please set a null Return value Error code 6 9 2 R_JCU_ Terminate Synopsis Performs termination processing for the JCU driver synchronous process Header r_jcu_api h Declaration jcu_errorcode_t R_JCU_Terminate void Description The processing which finishes a JCU driver The function keeps executing
5. lol x File Edit Setup Control Window Help oration All righ SAMPLE gt Figure 6 3 Message output at sample program execution RO1AN1862EJ0100 Rev 1 00 Page 11 of 40 Jun 20 2014 RENESAS RZ A1H Group JPEG Codec Unit JCU APPLICATION NOTE 6 2 Memory Mapping Figure 6 4 shows the Address Space of the RZ A1H group and the Memory Mapping of the GENMAI Board RTK772100BC00000BR In this sample code the code and data used in the ROM area is located in the NOR flash memory connected to the CSO space and the code and data used in the RAM area is located in the large capacity on chip RAM H FFFF FFFF H 60A0 0000 H 6000 0000 H 5C00 0000 H 5800 0000 Mirror space H 5000 0000 H 4C00 0000 H 4800 0000 H 4400 0000 H 4000 0000 H 20A0 0000 H 2000 0000 H 1C00 0000 H 1800 0000 Normal space H 1000 0000 H 0C00 0000 H 0800 0000 H 0400 0000 H 0000 0000 Figure 6 5 Memory Mapping RZ A1H group Address space Others 2550MB RTK772100BCO000BR Memory map Others 2550MB Large capacity on chip RAM 10MB Large capacity on chip RAM mirror space SPI multi I O bus space 2 64MB SPI multi I O bus mirror space 2 SPI multi I O bus space 1 64MB SPI multi I O bus mirror space 1 CS5 space 64MB CS4 space 64MB CS5 mirror space CS4 mirror space CS3 space 64MB CS3 mirror space CS2 space 64MB CS2 mirror space CS1 space
6. section 45 3 1 4 a Quantization Table Specification Arguments const jcu_table_no_t Quantization table number RO1AN1862EJ0100 Rev 1 00 Page 34 of 40 Jun 20 2014 RENESAS RZ A1H Group JPEG Codec Unit JCU APPLICATION NOTE tableNo const uint8_t const table Quantization table Return value Error code 6 9 16 R_JCU_SetHuffmanTable Synopsis Sets the Huffman table Header r_jcu_api h Declaration jcu_errorcode_t R_JCU_SetHuffmanTable const jcu_table_no_t tableNo const jcu_huff_t type const uint8_t const table Description Huffman table data For the setting value of the Huffman table data see RZ A1H Group User s Manual Hardware section 45 3 1 4 b Huffman Table Specification Arguments const jcu_table_no_t Huffman table number tableNo const jcu_huff_t type Type of Huffman table AC or DC const uint8_t const table Huffman table Return value Error code 6 9 17 R_JCU_GetEncodedSize Synopsis Gets the size of data to be compressed Header r_jcu_api h Declaration jcu_errorcode_t R_JCU_GetEncodedSize size_t const out Size Description Gets the size of data to be compressed If data is read before interrupt of encoding complete the data is not guaranteed Arguments size_t const out_Size Pointer to variable of the data size Return value Error code 6 9 18 R_JCU_GetAsyncStatus Synopsis Gets the pointer of a structure that indicates the state of the interrupt and asynchronous process Header r_jcu_api h
7. 6 9 8 R JGU StHart uu gu sun nanan A ica 32 6 9 9 B JOU Start AS vines ccccvesescstasavsecsasiescstasecscxveseacedasdsecczashescsdapgaeecaveseacedaaadeacdassesceanadenccasaseacedd 33 6 910 RJICU CONTINUO isso innnan oian ae aaia eiaa naida Eai anina eaae na 33 6941 R JCU GontingetASymme U LLULLU anka naea aka Nn KER AAR ANANKE ARANNA ANNAR RANAR 33 6 9 12 R_JCU_SetDecodeParaM u u u uuu iaaa aaan aeaa EEA AEE as aE 34 69413 FR JOU Getimagelnfg nv isiseccicisendecissesctivedecdcvassecseanbseededesessctaabesedcxasheateaabanedexasaesctanedsedevasseateda 34 6 9 14 R_JCU_SetEncodeP ara 2 cccccccccseeccccccssccssssscccsecasevecessacsesceussusesssessecsenssusdeseassesseneaues 34 6 9 15 R_ JCU SetQuantizationT able 34 6 9 16 RR JCU SetHufiman Table u uuu uuu u seed anaa aa acia 35 6947 R JCU GetEncoded Size s uu uuu u uuu uuu is 35 6918 RJCU GetASVACStatus viscccissscccssessivevesicinssestinecsasi causes ecvadscasecduuas scvuduasde canenssteheveusecdvecsscets 35 6 9 19 R_JCU_OmInterrupting cee eee eeence cece eee assasi saan aasssapissa aska asas sasa sata asad 35 6920 P JCU Onintorupted hecssccidueesiciessastdivedesscdercesncudeeestencsbasncdeadeasshensusndadhvassedensaatlavesusceneueveres 36 6921 RJGU Oninitiallz z uu n uu idad 36 69 22 Fu JGU OnFi alize u uu innin aaa e aaa adaa aada a ia a a 36 6923 R JCU SetDefault
8. R_JCU_SetInterruptCallbackCaller The object which the interrupt callback function is called is registered with driver s transplantation layer R_JCU_OnEnablelnterrupt It s made interrupt enabled R_JCU_OnDisablelnterrupt RO1AN1862EJ0100 Rev 1 00 Jun 20 2014 It s made interrupt disabled Page 28 of 40 RENESAS RZ A1H Group JPEG Codec Unit JCU APPLICATION NOTE x R_JCU_TerminateAsync R_JCU_Terminate R_JCU_SelectCodec R_JCU_SetEncodeParam R_JCU_SelectCodec R_JCU_SetDecodeParam R_JCU_StartAsync R_JCU_ContinueAsync Interrupt occurred Figure 6 8 State transition diagram When executing R_JCU_TerminateAsync in the Run state the state doesn t transfer After interrupt occurred the callback function is executed the state transfers to Undef Table 6 29 State transition table Status ee API Interruptin taa Undef Init Selected Ready Run ping destination Interrupted R_JCU Initialize OK Init R_JCU_Terminate OK OK OK OK OK OK Undef R_JCU_TerminateAsync OK OK OK OK OK OK Undef R_JCU_SelectCodec OK OK OK Selected R_JCU_SetCountMode OK OK No change R_JCU_SetPauseFor OK OK No change Imagelnfo R_JCU_SetErrorFilter No change R_JCU_Start No change R_JCU_StartAsync Run R_JCU_Continue No change R_JCU_ContinueAsync Run R_JCU_SetDecodeParam Ready R_JCU_Getlmagelnto No change R_JCU SetEncodeParam Ready R_JCU_SetQuantizationTable No change
9. Tel Rel Ro Tel Re Un Tel Re Un Tel Re 49 211 6503 0 Fax 49 211 6503 1327 nesas Electronics China Co Ltd om 1709 Quantum Plaza No 27 ZhiChunLu Haidian District Beijing 100191 P R China 86 10 8235 1155 Fax 86 10 8235 7679 nesas Electronics Shanghai Co Ltd oe it 301 Tower A Central Towers 555 Langao Road Putuo District Shanghai P R China 200333 86 21 2226 0888 Fax 86 21 2226 0999 nesas Electronics Hong Kong Limited it 1601 1613 16 F Tower 2 Grand Century Place 193 Prince Edward Road West Mongkok Kowloon Hong Kong 852 2265 6688 Fax 852 2886 9022 9044 nesas Electronics Taiwan Co Ltd 13F No 363 Fu Shing North Road Taipei 10543 Taiwan Tel Re 80 Tel Re Un Tel Re 886 2 8175 9600 Fax 886 2 8175 9670 nesas Electronics Singapore Pte Ltd Bendemeer Road Unit 06 02 Hyflux Innovation Centre Singapore 339949 65 6213 0200 Fax 65 6213 0300 nesas Electronics Malaysia Sdn Bhd g it 906 Block B Menara Amcorp Amcorp Trade Centre No 18 Jln Persiaran Barat 46050 Petaling Jaya Selangor Darul Ehsan Malaysia 60 3 7955 9390 Fax 60 3 7955 9510 nesas Electronics Korea Co Ltd 12F 234 Teheran ro Gangnam Ku Seoul 135 920 Korea Tel 82 2 558 3737 Fax 82 2 558 5141 2014 Renesas Electronics Corporation All rights reserved Colophon 4 0
10. arising from the use of any Renesas Electronics product for which the product is not intended by Renesas Electronics You should use the Renesas Electronics products described in this document within the range specified by Renesas Electronics especially with respect to the maximum rating operating supply voltage range movement power voltage range heat radiation characteristics installation and other product characteristics Renesas Electronics shall have no liability for malfunctions or damages arising out of the use of Renesas Electronics products beyond such specified ranges Although Renesas Electronics endeavors to improve the quality and reliability of its products semiconductor products have specific characteristics such as the occurrence of failure at a certain rate and malfunctions under certain use conditions Further Renesas Electronics products are not subject to radiation resistance design Please be sure to implement safety measures to guard them against the possibility of physical injury and injury or damage caused by fire in the event of the failure of a Renesas Electronics product such as safety design for hardware and software including but not limited to redundancy fire control and malfunction prevention appropriate treatment for aging degradation or any other appropriate measures Because the evaluation of microcomputer software alone is very difficult please evaluate the safety of the final products or systems manufactured by you
11. jcu_cbcr_offset_t Cb Cr range setting inputCbCrOffset 6 6 7 jcu_internal_information_t jcu_internal_information_t Synopsis Structure for the internal state of the JCU driver Header r_jcu_api h Description Member variable jcu_status_information_t The internal state of the JCU driver status jcu_codec_status_t Mode selection information codec bool_t isRunning false JCU driver inactive true JCU driver active bool t isPaused false JCU driver is not paused true JCU driver is paused bool ti isCountMode false JCU driver is not count mode true JCU driver is count mode RO1AN1862EJ0100 Rev 1 00 Page 26 of 40 Jun 20 2014 RENESAS RZ A1H Group JPEG Codec Unit JCU APPLICATION NOTE 6 7 List of Variables Table 6 26 Global Variables Variable Name Contents Function Used jcu_internal_informa g_jcu condition The internal state of the All API functions other than JCU driver R JCU_ GetEncodedSize JCU_ChecklnterruptSource function RO1AN1862EJ0100 Rev 1 00 Page 27 of 40 Jun 20 2014 RENESAS RZ A1H Group 6 8 List of Functions Table 6 27 API functions Section Function Name R_JCU_Initialize JPEG Codec Unit JCU APPLICATION NOTE Outline Initializes the JCU driver R_JCU_ Terminate Performs termination processing for the JCU driver synchronous process 6 9 4 R_JCU_TerminateAsync R_JCU_SelectCodec Performs termination processing for the JCU driver asynchronous proc
12. ta aaa aa Aa aaea aaeei aa ai aSa a 22 63 17 JcuU IMterupt lO tssirini a aaa raaa aa aa iaaa arara qasay a iaaa 23 6 95 18 jeu interrupt lines tu a a a AR A a aaa 23 66 A AO 24 6 6 1 cu count mode PAM lu uuu ull E S 24 6 6 2 JCU DUET aso aa aa a aa aaa A aaa EE dicos arancel 24 6 6 3 jeu buffer param Tartas li ld tii Aa A E EAOa aaa 25 6 6 4 jou decode param uu u tad iii aaa adders 25 6 6 5 jeu image BIO Ee iets POPE O ashi a aa aE ada Cebus 25 6 6 6 icu encode Para Lu y y uuu u uu uuu u su 25 6 6 7 Jcu Internal formatin L ua ua taaacnervastadaneasactennardeansaanetenvastadantansatentssvveasdaaseteabanvxdantaanate 26 6 Listof Variab eSuuu uu uu uuu sdctoczvsdananins Ganncxsaeanaeineiceecxssbaagesne aeaea aoaia aoaaa aae aae REEK NaRa 27 68 LISP OT FUNCTIONS etuiraiannaa edi anie aaa aaa aE Ea a aeiaai aiel ka A adaalat Eaa 28 69 Deoscripiono Unci uuu u u uu u a 2 usb 31 6 9 1 PGW I itlallgeuu m uy ici ea 31 6 9 2 FR JGU Terminales iia 31 6 9 3 R JCU TerminaleASyno0 L LLULLLL Las sayskaqasuskankaiapyasapuskksqaykkakasakqskasqakikk hisap 31 6 9 4 R JGU S lectGOOge0 u u uum uuu iii 32 6 9 5 R JCU SeIG6untMo9d u caia leia dicen 32 6 9 6 R JCU_SetPauseForIlmagelnfo nas 32 RO1AN1862EJ0100 Rev 1 00 Page 2 of 40 Jun 20 2014 RENESAS RZ A1H Group JPEG Codec Unit JCU APPLICATION NOTE 6 9 7 Fu JOU S etETrrorFilf r uu uu uuu uuu u u uuu uuu ul uu u aaa uu kemana sb qa ipu Qusan 32
13. until processing ends The state will be in the uninitialized status The user defined function R_JCU_OnFinalize is called Perform the following processing in the user defined function 1 Clock stopped to JCU 2 Clear the priority of interrupt 3 Sets the environment depend process When g_jcu_condition status is JCU_STATUS_ RUN it waits until processing ends Arguments None Return value Error code 6 9 3 R_JCU_TerminateAsync Synopsis Performs termination processing for the JCU driver asynchronous process Header r_jcu_api h Declaration jcu_errorcode_t R_JCU_TerminateAsync r_ospl_async_t const async Description The processing which finishes a JCU driver The function which is executing is suspended before processing ends For the detail of the argument async see the explanation of R_DRIVER_TransferAsync function in OS transplantation layer OSPL for RZ A1H group PFV JCU R01AN1887EJ About others see R_JCU_Terminate Arguments r_ospl_async_t const Synchronization setting async Return value Error code RO1AN1862EJ0100 Rev 1 00 Page 31 of 40 Jun 20 2014 RENESAS RZ A1H Group JPEG Codec Unit JCU APPLICATION NOTE 6 9 4 R_JCU_SelectCodec Synopsis Sets the JCU mode Header r_jcu_api h Declaration jcu_errorcode_t R_JCU_SelectCodec const jcu_codec_t codec Description This function selects the JCU mode Compression or De compression Please set again all parameters of decode encode a
14. 1H has seven types of exception processing reset undefined instruction software interrupt prefetch abort data abort IRQ and FIQ In the case of boot mode 0 the exception processing vector table is assigned to the area from H 0000 0000 to the area of 32 bytes from H 0000 0000 to H 0000 001F after the reset cancellation Figure 6 7 shows the contents of the sample code exception processing vector table as a description example vector_table LDR pc reset_handler 0x0000_0000 Reset exception pc undefined_handler 0x0000_0004 Undefined instructions exception pc svc_handler 0x0000_0008 Software interrupts exceptions LDR LDR LDR pc prefetch_handler 0x0000_000c Prefetch abort exception LDR pc abort_handler 0x0000_0010 Data abort exception LDR pc reserved_handler Ox0000_0014 Reserved LDR pc irq_handler 0x0000_0018 IRQ exception LDR pc fiq_handler 0x0000_001c FIQ exception Figure 6 7 Description Example of Exception Processing Vector Table 6 3 Interrupt Table 6 4 shows Interrupts using by sample code Table 6 4 Interrupts using by sample code Interrupt Priority Summary Source ID JCU_INT_PRI 2 INT_PRI JCU_INT_PRI 2 Compression Decompression process JDTI JCU_INT_PRI Data transfer process RO1AN1862EJ0100 Rev 1 00 Page 17 of 40 Jun 20 2014 RENESAS RZ A1H Group 6 4 Basic Types JPEG Codec Unit JCU APPLICATION NOTE Table 6 5 lists
15. AM GODE HANDLER H 2000 0000 10MB CODE_HANDLER_JMPTBL Transfer program CONST code which requires CONST speeding up to on chip RAM H 1C00 0000 CODE CODE H 1800 0000 CODE_IO_REGRW CODE_IO_REGRW CODE_RESET CODE_RESET CODE _FPU_INIT CODE _FPU_INIT H 1000 0000 InRoot InRoot H 0C00 0000 CODE_BASIC_SETUP CODE_BASIC_SETUP H 0800 0000 RESER_HANDLER RESER_HANDLER Transfer exception H 0000 0200 processing vector to chip RAM H 0400 0000 H 0000 0100 VECTOR_MIRROR_TABLE eae CS0 space H 0000 0000 64MB H 0000 0000 VECTOR_TABLE VECTOR_TABLE Figure 6 6 Section Assignment RO1AN1862EJ0100 Rev 1 00 Page 15 of 40 Jun 20 2014 RENESAS RZ A1H Group 6 2 2 Setting for MMU JPEG Codec Unit JCU APPLICATION NOTE The MMU is set to manage the 4 GB area in 1MB unit from the address H 0000 0000 in response to the memory map of the hardware resource used for the GENMAI Board Set by the ttb_init s file The minimum unit should be 1MB when customizing the MMU based on the system Table 6 3 lists the Setting for MMU Table 6 3 Definition Name M_SIZE_ NOR Setting for MMU Contents CS0 and CS1 spaces NOR flash memory Address H 0000 0000 to H 07FF FFFF Memory Type L1 cache enable Normal memory M_SIZE_SDRAM CS2 and CS3 spaces SDRAM H 0800 0000 to H OFFF FFFF L1 cache enable Normal
16. AS8ymce TT 36 6 9 24 R_JCU_ SellnterruptCallbackCaller u 37 6925 R_JCU OnEnablelnterrupt l U ULU asas aasawa aaa sasha suasaxkassaasaussussaksssasasska 37 6926 R JCU OnDiablelnterrupt uLU uuu ua seetuvsastcausas edbucedesc cubis A RARR 37 To Sample CeOdeS uuu uuu u A A Aa cti 39 8 Documents for Reference u uuu uuu uuu uuu alada aaa A eae aeai ON RAA 39 RO1AN1862EJ0100 Rev 1 00 Page 3 of 40 Jun 20 2014 RENESAS RZ A1H Group JPEG Codec Unit JCU APPLICATION NOTE 1 Specifications Table 1 1 lists the Peripheral Functions and Their Applications and Figure 1 1 shows the Operation Overview Table 1 1 Peripheral Functions to be Used and their Uses Peripheral functions JPEG Codec Unit JCU Converts image data Interrupt controller INTC The processor will receive interrupts when decoding or encoding is completed failed or paused Serial Communication Interface with FIFO SCIF Ch2 Output sample code message Terminal software outputs sample code message Host PC R7S72100 CPU board Seralimertade RTK7721008C00000BR RS 232C cable Ra E A A AS mE g A ooe ma Figure 1 1 Operation Overview R01AN1862EJ0100 Rev 1 00 Page 4 of 40 Jun 20 2014 RENESAS RZ A1H Group JPEG Codec Unit JCU APPLICATION NOTE 2 Operation Check Conditions The sample code accompanying this applicatio
17. CU_Continue const jcu_continue_type_t type Description Processing of JCU which paused is resumed The function will not return until decoding or encoding ends or pauses The parameter is a paused factor Arguments const Paused factor continue mode jcu_continue_type_t type Return value Error code 6 9 11 R_JCU_ContinuetAsync Synopsis Resume the JCU process asynchronous process Header r_jcu_api h Declaration jcu_errorcode_t R_JCU_ContinueAsync const jcu_continue_type_t type r_ospl_async_t const async Description Starts JCU process The function will return before decoding or encoding ends or pauses About others see R_JCU_ Start Arguments r_ospl_async_t const Synchronization setting async Return value Error code RO1AN1862EJ0100 Rev 1 00 Page 33 of 40 Jun 20 2014 RENESAS RZ A1H Group JPEG Codec Unit JCU APPLICATION NOTE 6 9 12 R_JCU_SetDecodeParam Synopsis Sets decoding parameter Header r_jcu_api h Declaration jcu_errorcode_t R_JCU_SetDecodeParam const jcu_decode_param_t const decode const jcu_buffer_param_t const buffer const uint32_t interruptKind Description Sets decoding parameter If the pixel format isn t ARGB8888 the alpha value has to be zero If the pixel format isn t YCbCr the Cb Cr value has to be JCU_CBCR_OFFSET_0 Arguments const Pointer to variable of decode parameter information jcu_decode_param_t const decode const jcu_buffer_param_t Pointer to variable of buffer const
18. Declaration R_JCU_GetAsyncStatus const jcu_async_status_t const out Status Description Pointer variable out_Status needs the const modifiers Arguments jcu_async_status_t Output Pointer of a structure that indicates the state of out_Status the interrupt and asynchronous process Return value Error code No error 0 6 9 19 R_JCU_Onlnterrupting Synopsis Interrupt is accepted Header r_jcu_api h Declaration errnum_t R_JCU_Onlnterrupting const r_ospl_interrupt_t const InterruptSource Description This function is usually called automatically from the interrupt callback function of the default This function sets the value of the interrupt status register to variable gs_jcu_internal_information AsyncStatus InterruptFlags And Interrupt request is cleared after it For the detail see the explanation of R_DRIVER_OnInterrupting function in OS RO1AN1862EJ0100 Rev 1 00 Page 35 of 40 Jun 20 2014 RENESAS RZ A1H Group JPEG Codec Unit JCU APPLICATION NOTE transplantation layer OSPL for RZ A1H group PFV JCU RO1AN1887EJ Arguments r_ospl_interrupt_t Interruption sender InterruptSource Return value Error code No error 0 6 9 20 R_JCU_Onlnterrupted Synopsis Interrupt function is executed Header r_jcu_api h Declaration errnum_t R_JCU_Oninterrupted void Description This function is usually called automatically from the interrupt callback function of the default Variable gs_jcu_internal_informat
19. ERR_IMAGE_ SIZE 0x452C Image size error detected JCU_JCDERR_LAST MCU DATA 0x452D Last MCU data number error detected JCU_JCDERR_BLOCK_DATA 0x452E Block data number error detected 6 5 7 jcu_int_detail_error_t Table 6 13 Particular error code Description JCU_INT_ERROR_RESTART_INTE The number of data in the restart interval of the RVAL_DATA Huffman coding segment is not correct in de compression JCU_INT_ERROR_SEGMENT_TOT The total number of data in the Huffman coding AL_DATA segment is not correct in de compression JCU_INT_ERROR_MCU_BLOCK_D The final number of MCU data in the ATA Huffman coding segment is not correct in de compression 6 5 8 jcu_swap t Table 6 14 Swap setting Symbol Value Description JCU_SWAP_BYTE Byte swap JCU_SWAP_WORD Word swap JCU_SWAP_WORD_AND_ BYTE Word byte swap JCU_SWAP_LONG_WORD Longword swap JCU_SWAP_LONG_WORD_AND_ BYTE Longword byte swap JCU_SWAP_LONG_WORD_AND_ WORD Longword word swap JCU_SWAP_LONG_WORD_AND_WORD Longword word byte swap _AND_BYTE 6 5 9 jcu_sub_sampling_t Table 6 15 Sub sample of the decoded image data Symbol Value Description JCU_SUB_SAMPLING_1_1 0x00 No subsampling JCU_SUB_SAMPLING_1_2 Subsamples output data into 1 2 JCU_SUB_SAMPLING_1_4 Subsamples output data into 1 4 JCU_SUB_SAMPLING_1_8 Subsamples output data into 1 8 6 5 10 jcu_decode_format_t Table 6 16 Output pixel format of RAW i
20. MPU MCU products from Renesas For detailed usage notes on the products covered by this document refer to the relevant sections of the document as well as any technical updates that have been issued for the products 1 Handling of Unused Pins Handle unused pins in accordance with the directions given under Handling of Unused Pins in the manual The input pins of CMOS products are generally in the high impedance state In operation with an unused pin in the open circuit state extra electromagnetic noise is induced in the vicinity of LSI an associated shoot through current flows internally and malfunctions occur due to the false recognition of the pin state as an input signal become possible Unused pins should be handled as described under Handling of Unused Pins in the manual 2 Processing at Power on The state of the product is undefined at the moment when power is supplied The states of internal circuits in the LSI are indeterminate and the states of register settings and pins are undefined at the moment when power is supplied In a finished product where the reset signal is applied to the external reset pin the states of pins are not guaranteed from the moment when power is supplied until the reset process is completed In a similar way the states of pins in a product that is reset by an on chip power on reset function are not guaranteed from the moment when power is supplied until the power reaches the level at which resetti
21. OnEnablelnterrupt Synopsis It s made interrupt enabled Header r_jcu_pl h Declaration void R_JCU_OnEnablelnterrupt jcu_interrupt_lines_t const Enables Description The user defined function executed by the processing which enable interrupt of the JCU driver Execute the following processing Interrupt service of JCU is enabled to execute Arguments jcu_interrupt_lines_t The kind of interrupt as the bit flag value The flag is set to const Enables 1 for enabled interrupt Return value None 6 9 26 R_JCU_OnDiablelnterrupt Synopsis It s made interrupt Disabled Header r_jcu_pl h Declaration void R_JCU_OnDisablelnterrupt jcu_interrupt_lines_t const Disables Description The user defined function executed by the processing which disable interrupt of the JCU driver Execute the following processing Interrupt service of JCU is disabled to execute Arguments jcu_interrupt_lines_t The kind of interrupt as the bit flag value The flag is set to RO1AN1862EJ0100 Rev 1 00 Page 37 of 40 Jun 20 2014 RENESAS RZ A1H Group JPEG Codec Unit JCU APPLICATION NOTE const Enables 1 for disabled interrupt Return value None RO1AN1862EJ0100 Rev 1 00 Page 38 of 40 Jun 20 2014 RENESAS RZ A1H Group JPEG Codec Unit JCU APPLICATION NOTE 7 Sample Codes The sample codes can be downloaded from the Renesas Electronics website 8 Documents for Reference User s Manual Hardware RZ A1H Group User s Manual Hardware The latest v
22. Please contact a Renesas Electronics sales office for details as to environmental matters such as the environmental compatibility of each Renesas Electronics product Please use Renesas Electronics products in compliance with all applicable laws and regulations that regulate the inclusion or use of controlled substances including without limitation the EU RoHS Directive Renesas Electronics assumes no liability for damages or losses occurring as a result of your noncompliance with applicable laws and regulations Renesas Electronics products and technology may not be used for or incorporated into any products or systems whose manufacture use or sale is prohibited under any applicable domestic or foreign laws or regulations You should not use Renesas Electronics products or technology described in this document for any purpose relating to military applications or use by the military including but not limited to the development of weapons of mass destruction When exporting the Renesas Electronics products or technology described in this document you should comply with the applicable export control laws and regulations and follow the procedures required by such laws and regulations 10 Itis the responsibility of the buyer or distributor of Renesas Electronics products who distributes disposes of or otherwise places the product with a third party to notify such third party in advance of the contents and conditions set forth in this document Renesas El
23. YMBOL Error of undefined symbol E_NO_NEXT There are no next E_ACCESS_DENIED E_NOT_IMPLEMENT_YET Error of Read Write denied Not implemented E_ERRNO See errno E_LIMITATION Limitation E_STATE RO1AN1862EJ0100 Rev 1 00 Jun 20 2014 The error which can t be executed in this state 14 15 16 18 Page 19 of 40 RENESAS RZ A1H Group E _BAD_COMMAND_ID JPEG Codec Unit JCU APPLICATION NOTE Symbol Value Description The command id number is the outside of the range E_TIME_OUT Time out E _NO_DEBUG_TLS There is no debug work area See R_OSPL_SET_DEBUG_WORK E_EXIT_TEST 6 5 3 Table 6 9 jcu_errorcode t Error code JCU_ERROR_OK 0x0000 Stop request of the test Description No error has occurred JCU_ERROR_PARAM 0x4501 A parameter provided to a function is incorrect JCU_ERROR_STATUS JCU_ERROR_CODEC_TYPE 0x4502 0x4503 A function was called in an incorrect state A function was called in an incorrect mode JCU_ERROR_LIMITATION 6 5 4 Table 6 10 jcu_codec_t 0x4504 Restrictions on JCU driver Mode selection Compression or De compression Symbol JCU_ENCODE 0 Compression process JCU_DECODE 1 De compression process 6 5 5 Table 6 11 jcu_continue_type_t Paused factor continue mode SE JCU_INPUT_BUFFER 0 Resumes reading input image data
24. alize function Creates an input image in RAM Sets conversion information in the JCU R_JCU_SelectCodec function R_JCU_SetDecodeParam function Starts JCU to initiate conversion R_JCU_Start function Output image data Performs termination processing for the JCU R_JCU_Terminate function Figure 6 1 Sequence of image data conversion using the synchronous function Please refer to OS transplantation layer OSPL for RZ A1H group PFV JCU RO1AN1887EJ when using the asynchronous function This sample program has processing of 3 kinds decoding processing of a JPEG picture R_JCU_SampleDecode function decoding and encoding processing of a JPEG picture R_JCU_SampleDecodeEncode function and the processing indicated after decoding of a JPEG picture R_JCU_SampleDecodeAndShow function RO1AN1862EJ0100 Rev 1 00 Page 10 of 40 Jun 20 2014 RENESAS RZ A1H Group JPEG Codec Unit JCU APPLICATION NOTE 6 1 1 Preparations The following preparations in Sample Code 1 Terminal software is started in a host PC and it s established as follows In the case of Tera Term Tera Term Serial port setup xj Port Baud rate 115200 Data j Bbt Cancel Parity ne Stop fbit Help Flow control oe lla Transmit delay po msec char po mseciline Figure 6 2 Setting of a serial port 2 When a sample program is executed a message is output at a terminal as follows COM1 115200baud Tera Term VT
25. are assigned in this area RO1AN1862EJ0100 Rev 1 00 Page 13 of 40 Jun 20 2014 RENESAS RZ A1H Group Table 6 2 JPEG Codec Unit JCU APPLICATION NOTE Sections to be Used 2 2 Area Name Description Loading Execution Area Area VECTOR_MIRROR_ Exception processing vector table Code FLASH LRAM TABLE Section to transfer data to large capacity on chip RAM CODE_HANDLER_ Program code area for user defined Code FLASH LRAM JMPTBL functions of IRQ interrupt handler CODE_HANDLER Program code area of IRQ interrupt Code FLASH LRAM handler This area consists of the following sections e CODE_HANDLER e IRQ_FIQ_HANDLER DATA_HANDLER _ Registration table data area for RW Data FLASH LRAM JMPTBL user defined functions of IRQ interrupt handler ARM_LIB_STACK Application stack area Z Data LRAM IRQ_STACK IRQ mode stack area Z Data LRAM FIQ_STACK FIQ mode stack area Z Data LRAM SVC_STACK Supervisor SVC mode stack area Zl Data LRAM ABT_STACK Abort ABT mode stack area ZI Data LRAM TTB MMU translation table area Z Data LRAM ARM_LIB_HEAP Application heap area ZI Data LRAM DATA Data area with initial value for defaults RW Data FLASH LRAM All the RW Data type sections which do not define section names with C source are assigned in this area BSS Data area without initial value for defaults ZI Data LRAM All the ZI Data type sections which do not defi
26. ble true Enable the division processing on output buffer bool t outputBuffer false When decoding paused the input address isn t isInitAddress initialized true When decoding paused the output address is initialized by outputBuffer restartAddress uint32_t outputBuffer If IsInitAddress is true the output data address is restartAddress initialized by this value uint32_t outputBuffer The division size of the output buffer dataCount In the case of decoding mode when JCU outputs data of dataCount line when data of YCbCr420 was decoded two times of dataCount lines it pauses In the case of encoding mode when JCU outputs data of dataCount byte it pauses The dataCount must be a multiple of 8 lines 6 6 2 jcu_buffer_t jcu_buffer_t RO1AN1862EJ0100 Rev 1 00 Page 24 of 40 Jun 20 2014 RENESAS RZ A1H Group JPEG Codec Unit JCU APPLICATION NOTE Synopsis Structure for the input output buffer setting Header r_jcu_api h Description Member variable jcu_swap_t Byte Word Longword Swap swapSetting uint32_t address Buffer address 6 6 3 jcu_buffer_param_t jcu_buffer_param_t Synopsis Parameters for the input output buffer setting in de compression Header r_jcu_api h Description Member variable jcu_buffer_t source Input buffer jcu_buffer_t destination Output buffer intl6 t lineOffset Line offset 6 6 4 jcu_decode_param_t jcu_decode_param_t Synopsis Parameters for the option setting i
27. buffer Return value Error code 6 9 13 R_JCU_Getlmagelnfo Synopsis Gets information on the JPEG data Header r_jcu_api h Declaration jcu_errorcode_t R_JCU_Getlmagelnfo jcu_image_info_t const buffer Description Gets the image information width height pixel format of the decoded JPEG data If data is read before the request which reads the image information the data is not guaranteed If the pixel format of the decoded JPEG data is outside of the jcu_jpeg_format_t it s the error so JCU can t decode Arguments jcu_image_info_t const Pointer to variable of image information buffer Return value Error code 6 9 14 R_JCU_ SetEncodeParam Synopsis Sets encoding parameter Header r_jcu_api h Declaration jcu_errorcode_t R_JCU_SetEncodeParam const jcu_encode_param_t const encode const jcu_buffer_param_t const buffer const uint32_t interruptKind Description Sets Encoding parameter Arguments const Pointer to variable of encode parameter information jcu_encode_param_t const encode const jcu_buffer_param_t Pointer to variable of buffer const buffer Return value Error code 6 9 15 R_JCU_SetQuantizationTable Synopsis Sets the Quantization table Header r_jcu_api h Declaration jcu_errorcode_t R_JCU_SetQuantizationTable const jcu_table_no_t tableNo const uint8_t const table Description Quantization table data For the setting value of the quantization table data see RZ A1H Group User s Manual Hardware
28. cation note s RZ A1H Example of Initialization R01AN1646EJ RZ A1H Definition of I O Register file iodefine h RO1AN1860JJ RZ A1H Group OS porting layer OSPL Sample Program R01AN1887EJ RO1AN1862EJ0100 Rev 1 00 Page 6 of 40 Jun 20 2014 RENESAS RZ A1H Group JPEG Codec Unit JCU APPLICATION NOTE 4 Peripheral Functions The basic functions of the JCU are described in the RZ A1H Group User s Manual Hardware RO1AN1862EJ0100 Rev 1 00 Page 7 of 40 Jun 20 2014 RENESAS RZ A1H Group JPEG Codec Unit JCU APPLICATION NOTE 5 Description of Hardware 5 1 Hardware Configuration Figure 5 1 shows examples of hardware devices connected GENMAI board Power supply ULINK2 ICE Option board Optional gt To host PC s USB i LCD output Optional To host PC s serial port Figure 5 1 Examples of Hardware Devices Connected RO1AN1862EJ0100 Rev 1 00 Page 8 of 40 Jun 20 2014 RENESAS RZ A1H Group JPEG Codec Unit JCU APPLICATION NOTE 5 2 List of Pins to be Used Table 5 1 lists the pins to be used and their functions Table 5 1 Pins to be Used and their Functions Description Pin name None RO1AN1862EJ0100 Rev 1 00 Page 9 of 40 Jun 20 2014 RENESAS RZ A1H Group JPEG Codec Unit JCU APPLICATION NOTE 6 Description of Software 6 1 Operation Outline Figure 6 1 shows the sequence of image data converted using the synchronous function Initialize the JCU R_JCU_Initi
29. curs Arguments jcu_int_detail_errors t The valid decoding error code jcu_int_detail_error_t as filter the bit flag value Return value Error code 6 9 8 R_JCU_ Start Synopsis Starts JCU process synchronous process Header r_jcu_api h Declaration jcu_errorcode_t R_JCU_Start void Description Starts JCU process The function will not return until decoding or encoding ends or RO1AN1862EJ0100 Rev 1 00 Page 32 of 40 Jun 20 2014 RENESAS RZ A1H Group JPEG Codec Unit JCU APPLICATION NOTE pauses Using the R_JCU_SetDecoderParam API function or the R_JCU_SetEncoderParamSet API function set the parameters before the JCU process starts You cannot stop the JCU process after the JCU process starts Arguments None Return value Error code 6 9 9 R_JCU_StartAsync Synopsis Starts JCU process asynchronous process Header r_jcu_api h Declaration jcu_errorcode_t R_JCU_StartAsync r_ospl_async_t const async Description Starts JCU process The function will return before decoding or encoding ends or pauses For the detail of the argument async see the explanation of R_DRIVER_TransferAsync function in OS transplantation layer OSPL for RZ A1H group PFV JCU R01AN1887EJ About others see R_JCU_ Start Arguments r_ospl_async_t const Synchronization setting async Return value Error code 6 9 10 R_JCU_ Continue Synopsis Resume the JCU process synchronous process Header r_jcu_api h Declaration jcu_errorcode_t R_J
30. e selection Compression or De compression 6 5 5 jcu continue type t Paused factor continue mode 6 5 6 jcu_detail_error_t Error classification of the JCU driver 6 5 7 jcu_int_detail_error_t Particular error code 6 5 8 jcu_swap_t Swap setting 6 5 9 jcu_sub_sampling_t Sub sample of the decoded image data 6 5 10 jcu_decode_format_t Output pixel format of RAW image data 6 5 11 jcu_jpeg_format_t Pixel format of JPEG image data 6 5 12 jcu_huff_t Type of Huffman table AC or DC 6 5 13 jcu_table_no_t Quantization table number or Huffman table number 6 5 14 jcu_status_information_t Internal state of the JCU driver 6 5 15 jcu_codec_status_t Mode selection information 6 5 16 jcu_cbcr_offset_t Cb Cr range setting If the pixel format isn t YCbCr the JCU_CBCR_OFFSET_0 must be used 6 5 17 jcu_interrupt_line_t The kind of interrupt as the bit flag value 6 5 18 jcu_interrupt_lines t Logical sum of the bit flag value jcu_interrupt_line_t 6 5 1 Version Table 6 7 Version information Symbol JCU_VERSION JCU version number JCU_VERSION_STRING Character string of the JCU version number 6 5 2 errnum_t Table 6 8 Error information Symbol Value Description 0 No error E OTHERS Other error E FEW_ARRAY The fixed length arrays size is smaller than data size E_FEW_MEMORY E_FIFO_OVER Out of memory error occurred when ensure a heap memory Error when enqueue to FIFO is failed E_NOT_FOUND_S
31. ectronics assumes no responsibility for any losses incurred by you or third parties as a result of unauthorized use of Renesas Electronics products 11 This document may not be reproduced or duplicated in any form in whole or in part without prior written consent of Renesas Electronics 12 Please contact a Renesas Electronics sales office if you have any questions regarding the information contained in this document or Renesas Electronics products or if you have any other inquiries Note 1 Renesas Electronics as used in this document means Renesas Electronics Corporation and also includes its majority owned subsidiaries Note 2 Renesas Electronics product s means any product developed or manufactured by or for Renesas Electronics ENESAS SALES OFFICES Renesas Electronics Corporation http www renesas com Re Re fer to http www renesas com for the latest and detailed information nesas Electronics America Inc 2801 Scott Boulevard Santa Clara CA 95050 2549 U S A Tel Re 1 408 588 6000 Fax 1 408 588 6130 nesas Electronics Canada Limited 1101 Nicholson Road Newmarket Ontario L3Y 9C3 Canada Tel Rel Du Tel Re 1 905 898 5441 Fax 1 905 898 3220 nesas Electronics Europe Limited kes Meadow Millboard Road Bourne End Buckinghamshire SL8 5FH U K 44 1628 585 100 Fax 44 1628 585 900 nesas Electronics Europe GmbH Arcadiastrasse 10 40472 D sseldorf Germany
32. ersion can be downloaded from the Renesas Electronics website R7S72100 RTK772100BC00000BR GENMAI User s Manual The latest version can be downloaded from the Renesas Electronics website R7S72100 CPU GENMAJD Optional Board RTK7721000B00000BR User s Manual The latest version can be downloaded from the Renesas Electronics website ARM Architecture Reference Manual ARMv7 A and ARMv7 R edition Issue C The latest version can be downloaded from the ARM website ARM Generic Interrupt Controller Architecture Specification Architecture version 1 0 The latest version can be downloaded from the ARM website Technical Update Technical News The latest information can be downloaded from the Renesas Electronics website User s Manual Development Tools ARM Software Development Tools ARM Compiler toolchain ARM DS 5 etc can be downloaded from the ARM website The latest version can be downloaded from the Renesas Electronics website RO1AN1862EJ0100 Rev 1 00 Page 39 of 40 Jun 20 2014 RENESAS RZ A1H Group Website and Support Renesas Electronics website http www renesas com Inquiries http www renesas com contact RO1AN1862EJ0100 Rev 1 00 Jun 20 2014 JPEG Codec Unit JCU APPLICATION NOTE RENESAS Page 40 of 40 Revision History Description Rev Date Page Summary 1 00 Jun 20 2014 First edition issued A 1 General Precautions in the Handling of MPU MCU Products The following usage notes are applicable to all
33. ess Sets the JCU mode R_JCU_SetCountMode Sets the count mode R_JCU_SetPauseForlmagelnfo When the image information can be acquired it s made the setting which is paused R_JCU_SetErrorFilter R_JCU_Start The particular error code jcu_int_detail_error_t was set to valid Starts JCU process synchronous process R_JCU_StartAsync Starts JCU process asynchronous process R_JCU_Continue Resume the JCU process synchronous process R_JCU_ContinueAsync R_JCU_SetDecodeParam Resume the JCU process asynchronous process Sets decoding parameter 6 9 13 R_JCU_Getlmagelnto Gets information on the JPEG data 6 9 14 R_JCU_SetEncodeParam Sets encoding parameter 6 9 15 R_JCU_SetQuantizationTable Sets the Quantization table 6 9 16 R_JCU_SetHuffmanT able Sets the Huffman table 6 9 17 R_JCU_GetEncodedSize Gets the size of data to be compressed 6 9 18 R_JCU_GetAsyncStatus Gets the pointer of a structure that indicates the state of the interrupt and asynchronous process 6 9 19 R_JCU_Onlnterrupting Interrupt is accepted 6 9 20 R_JCU_Onlnterrupted Interrupt function is executed Table 6 28 User defined functions Section Function Name R_JCU_Onlnitialize Outline Initializes the user defined process R_JCU_OnFinalize R_JCU_SetDefaultAsync Finalizes the user defined process Sets the default value of the variable of r_ospl_async_t type structure
34. ics assumes no responsibility for any losses incurred by you or third parties arising from such alteration modification copy or otherwise misappropriation of Renesas Electronics product Renesas Electronics products are classified according to the following two quality grades Standard and High Quality The recommended applications for each Renesas Electronics product depends on the product s quality grade as indicated below Standard Computers office equipment communications equipment test and measurement equipment audio and visual equipment home electronic appliances machine tools personal electronic equipment and industrial robots etc High Quality Transportation equipment automobiles trains ships etc traffic control systems anti disaster systems anti crime systems and safety equipment etc Renesas Electronics products are neither intended nor authorized for use in products or systems that may pose a direct threat to human life or bodily injury artificial life support devices or systems surgical implantations etc or may cause serious property damages nuclear reactor control systems military equipment etc You must check the quality grade of each Renesas Electronics product before using it in a particular application You may not use any Renesas Electronics product for any application for which itis not intended Renesas Electronics shall not be in any way liable for any damages or losses incurred by you or third parties
35. ion AsyncStatus InterruptFlags the e function set in 1 is cleared in 0 And interrupt function is executed For the detail see the explanation of R_DRIVER_OnlInterrupted function in OS transplantation layer OSPL for RZ A1H group PFV JCU RO1AN1887EJ Arguments None Return value Error code No error 0 6 9 21 R_JCU_Onlnitialize Synopsis Initializes the user defined process Header r_jcu_pl h Declaration errnum_t R_JCU_Onlnitialize void Description The user defined function executed by an initializing process of the JCU driver If necessary execute the following processing Clock control Set interrupt priority Environment depend process Arguments None Return value Error code No error 0 6 9 22 R_JCU_On Finalize Synopsis Finalizes the user defined process Header r_jcu_pl h Declaration errnum_t R_JCU_OnFinalize errnum_t e Description The user defined function executed by a finalizing process of the JCU driver If necessary execute the following processing Clock stop Clear interrupt priority Environment depend process Arguments errnum_t e Error code Use it for a return value Return value Error code 6 9 23 R_JCU_SetDefaultAsync Synopsis Sets the default value of the variable of r_ospl_async_t type structure Header r_jcu_pl h RO1AN1862EJ0100 Rev 1 00 Page 36 of 40 Jun 20 2014 RENESAS RZ A1H Group JPEG Codec Unit JCU APPLICATION NOTE Declaration void R_JCU_SetDefaultAsy
36. mage data Symbol JCU_OUTPUT_YCbCr422 YCbCr422 JCU_OUTPUT_ARGB8888 0x01 ARGB8888 JCU_OUTPUT_RGB565 0x02 RGB565 6 5 11 jcu_jpeg_format_t Table 6 17 Pixel format of JPEG image data RO1AN1862EJ0100 Rev 1 00 Page 21 of 40 Jun 20 2014 RENESAS RZ A1H Group JPEG Codec Unit JCU APPLICATION NOTE Description JCU_JPEG_YCbCr444 YCbCr444 JCU_JPEG_YCbCr422 YCbCr422 JCU_JPEG_YCbCr420 YCbCr420 JCU_JPEG_YCbCr41 1 YCbCr411 6 5 12 jcu huff t Table6 18 Type of Huffman table AC or DC Symbol JCU_HUFFMAN_AC JCU_HUFFMAN_DC 6 5 13 jcu_table_no_t Table 6 19 Quantization table number or Huffman table number Description JCU_TABLE_NO_0 Quantization table No 0 JCQTBLO or DC AC Huffman table No 0 JCHTBDO JCHTBAO JCU_TABLE NO_1 Quantization table No 1 JCQTBL1 or DC AC Huffman table No 1 JCHTBD1 JCHTBA1 JCU_ TABLE _NO 2 Quantization table No 2 JCQTBL2 JCU_TABLE_NO_3 Quantization table No 3 JCQTBL3 6 5 14 jcu_status_information_t Table 6 20 Internal state of the JCU driver Symbol Value Description JCU_STATUS_UNDEF 0x00 The JCU is uninitialized status JCU_STATUS_INIT 0x01 The JCU is initialized status JCU_STATUS_SELECTED 0x02 The JCU mode is selected JCU_STATUS_READY The JCU decode encode is ready or the JCU 0x08 decode encode has been completed JCU_STATUS_RUN 0x10 The JCU decode encode being executed JCU_STATUS INTERRUPTING The s
37. memory M_SIZE_CS45 CS4 and CS5 spaces H 1000 0000 to H 17FF FFFF Strongly ordered memory L1 cache disable M_SIZE_SPI SPI multi IO bus space 1 and 2 serial flash memory H 1800 0000 to H 1FFF FFFF L1 cache enable Normal memory M_SIZE_RAM Large capacity on chip RAM space H 2000 0000 to H 209F FFFF L1 cache enable Normal memory M_SIZE_IO_1 On chip peripheral module and reserved area H 20A0 0000 to H 3FFF FFFF Strongly ordered memory L1 cache disable M_SIZE_NOR_M M_SIZE_SDRAM_M CSO and CS1 mirror spaces CS2 and CS3 mirror spaces H 4000 0000 to H 47FF FFFF H 4800 0000 to H 4FFF FFFF L1 cache disable Normal memory L1 cache disable Normal memory M_SIZE_CS45_M CS4 and CS5 mirror spaces H 5000 0000 to H 57FF FFFF Strongly ordered memory L1 cache disable M_SIZE_SPI_M SPI multi lO bus mirror space 1 and 2 H 5800 0000 to H 5FFF FFFF L1 cache disable Normal memory M_SIZE_RAM_M Large capacity on chip RAM mirror space H 6000 0000 to H 609F FFFF L1 cache disable Normal memory M_SIZE_IO_2 On chip peripheral module and reserved area RO1AN1862EJ0100 Rev 1 00 Jun 20 2014 H 60A0 0000 to H FFFF FFFF RENESAS 2550MB Strongly ordered memory L1 cache disable Page 16 of 40 RZ A1H Group JPEG Codec Unit JCU APPLICATION NOTE 6 2 3 Exception Processing Vector Table The RZ A
38. n de compression Header r_jcu_api h Description Member variable jcu_sub_sampling_t Vertical subsampling verticalSubSampling jcu_sub_sampling_t Horizontal subsampling horizontalSubSampling jcu_decode_format_t The output pixel format of RAW image data decodeFormat jcu_cbcr_offset_t Cb Cr range setting If the pixel format isn t YCbCr the outputCbCrOffset Cb Cr value has to be JCU_CBCR_OFFSET_0 uint8_t alpha Alpha value setting If the pixel format isn t ARGB8888 the alpha value has to be zero 6 6 5 jcu_image_info_t jcu_image_info_t Synopsis Structure for the image information of the decoded JPEG data Header r_jcu_api h Description Member variable uint32_t width The width of the image data uint32_t height The height of the image data jcu_jpeg_format_t The pixel format of original JPEG data encodedFormat 6 6 6 jcu_encode_param_t jcu_encode_param_t Synopsis Parameters for the option setting in compression Header r_jcu_api h Description Member variable jcu_jpeg_format_t The pixel format of compressed JPEG data encodeFormat This value has to be JCU_JPEG_YCbCr422 int32_t Quantization table QuantizationTable int32_t HuffmanTable Huffman table uint32 t DRI_value DRI Define Restart Interval value RO1AN1862EJ0100 Rev 1 00 Page 25 of 40 Jun 20 2014 RENESAS RZ A1H Group JPEG Codec Unit JCU APPLICATION NOTE uint32_t width The width of the input image data uint32_t height The height of the input image data
39. n note has been run and confirmed under the conditions below Table 2 1 Operation Check Conditions Item Contents MCU used RZ A1H Operating frequency CPU clock Ip 400MHz Image processing clock Gd 266 67MHz Internal bus clock Bo 133 33MHz Peripheral clock 1 P10 66 67MHz Peripheral clock O PO 33 33MHz Operating voltage Power supply voltage 1 0 3 3V Power supply voltage Internal 1 18V Integrated development ARM integrated development environment environment ARM Development Studio 5 DS 5 Version 5 16 C compiler ARM C C Compiler Linker Assembler Ver 5 03 Build 102 Compiler options excluding additional directory path 03 Ospace cpu Cortex A9 littleend arm apcs interwork no_unaligned_access fpu vfpv3_fp16 g Operating mode Boot mode 0 CSO space 16 bit booting Communication setting of e Communication speed 115200bps terminal software e Data length 8 bits e Parity None e Stop bit length 1 bit e Flow control None Board used GENMAI Board e RTK772100BC00000BR R7S72100 CPU board e RTK77210000B00000BR R7S72100 Option board Device used LCD Only the sample should be used e Serial interface D sub 9 pin connector RO1AN1862EJ0100 Rev 1 00 Page 5 of 40 Jun 20 2014 RENESAS RZ A1H Group JPEG Codec Unit JCU APPLICATION NOTE 3 Reference Application Note s For additional information associated with this document refer to the following appli
40. nc r_ospl_async_t const Async Description The user defined function executed by all asynchronous process of the JCU driver Execute the following processing Member of variable of r_ospl_async_t type structure corresponds to the Flags is set to the default value if the Flags member of the variable is zero ReturnValue member of the variable is cleared by asynchronous caller s processing Arguments r_ospl_async_t Async Synchronization setting NULL can t be used Return value Error code 6 9 24 R_JCU_SetInterruptCallbackCaller Synopsis The object which the interrupt callback function is called is registered with driver s transplantation layer Header r_jcu_pl h Declaration errnum_t R_JCU_SetlInterruptCallbackCaller const r_ospl_caller_t const Caller Description The user defined function executed by all asynchronous process of the JCU driver Execute the following processing The setting which calls the R_OSPL_CallInterrupiCallback function value of the argument Caller is designated from the interrupt handler For the detail see the explanation of R_DRIVER_OnlInterrupted function in OS transplantation layer OSPL for RZ A1H group PFV JCU RO1AN1887EJ Driver caller s function manages the body of the structure an argument Caller indicates Arguments r_ospl_caller_t caller The value sent to the R_OSPL_CallInterrupiCallback function Return value Error code No error 0 6 9 25 R_JCU_
41. nd count mode Because when this function was called these parameters were initialized Arguments const jcu_codec_tcodec JCU mode Compression or De compression Return value Error code 6 9 5 R_JCU_SetCountMode Synopsis Sets the count mode Header r_jcu_api h Declaration jcu_errorcode_t R_JCU_SetCountMode const jcu_count_mode_param_t const buffer Description Sets the count mode division process The division processing on input buffer can t be used simultaneously with the division processing on output buffer Arguments const Count mode jcu_count_mode_param t const buffer Return value Error code 6 9 6 R_JCU_SetPauseForlmagelnfo Synopsis When the image information can be acquired it s made the setting which is paused Header r_jcu_api h Declaration jcu_errorcode_t R_JCU_SetPauseForlmagelnfo const bool_t is_pause Description When the image information can be acquired it s made the setting which is paused by the R_JCU_Getlmagelnto function Arguments const bool_t is_pause TRUE It s made the setting which is paused FALSE It s made the setting which isn t paused Return value Error code 6 9 7 R_JCU_SetErrorFilter Synopsis The particular error code jcu_int_detail_error_t was set to valid Header r_jcu_api h Declaration jcu_errorcode_t R_JCU_SetErrorFilter jcu_int_detail_errors_t filter Description The particular error code was set to valid When the valid decoding error occurred interrupt oc
42. ne section names with C source area assigned in this area Notes 1 FLASH and LRAM shown in Loading Area and Execution Area indicate the NOR flash memory area and the large capacity on chip RAM area respectively 2 Basically the section name is set to be the same as the region s however it consists of some sections in the areas of RESET_HANDLER InRoot CODE_FPU_INIT CODE_RESET CODE CONST CODE_HANDLER DATA and BSS Refer to the ARM compiler toolchain manual about the region and the section RO1AN1862EJ0100 Rev 1 00 Jun 20 2014 RENESAS Page 14 of 40 RZ A1H Group JPEG Codec Unit JCU APPLICATION NOTE RZ A1H group Section assignment Section assignment Address space Load view Execution view Memory allocation after H EFFF FFFF H 209F FFFF executing scatter loading Clear to zero Initialize data with initial value H 200B 8000 ARM_LIB_HEAP H 2003 8000 Secure area such H 2003 4000 as stack area H 2003 2000 p ABT STACK H 2003 0000 SVC_STACK H 2002 E000 FIQ_STAC H 2002 C000 IRQ_STACK TTB H 2002 4000 ARM_LIB_STACK Initialize data with initial value DATA_HANDLER_JMPTBL CODE_HANDLER H 2002 0100 CODE_HANDLER_JMPTBL H 2002 0000 VECTOR_MIRROR_TABLE H 2000 0000 H 03FF FFFF H 4000 0000 DATA_HANDLER_JMPTBL H 20A0 0000 Large capacity on chip R
43. ne uuu N oscila aa 10 6 1 Operation Outline sis ecomiaalna title ida cea cre riot 10 6 1 1 Pie Yalli x uu u 2 xu lio siciliana 11 6 2 Memory Mapping uu l l a rata 12 6 2 1 Section Assignment in Sample Code sasa 13 6 2 2 Setting tot MMU u uy ua ua aniano nestao aeaa aeaa aaa aE q tia beta cade 16 6 2 3 Exception Processing Vector Table U u u 17 63 hiep uu da n apas A 17 6 4 Basic IPS sitios 18 6 5 Constants Enumerations and Error code cocccccccnnococonononononononononenononononenononenanenenenenanenananenenenaneso 19 6 5 1 AEEA suku E A asahan la Q qhuspa E qiya 19 6 5 2 SUMO ua uma u umu a bus sasam a m ama u Qhatun anasu Saam kusapa has 19 6 5 3 PET y u Sun an uaqta a a a aaa aaae aaa aaa a a aleda biah 20 6 5 4 PA aiaia iae a aa e ai a aaa a a a aa is 20 6 5 5 icu continue ype uuu u A us ass as 20 6 5 6 jeu detail SO Lau uuu Aaa 20 6 5 7 Jeun detail eno is uu dad tido 21 6 5 8 je T WD birra ein 21 6 5 9 ICu sup Sampling l uuu x u u ire 21 65 10 Jeu decode Toma tica ica ile 21 6 35 11 Jou PSG TONAL ticas ta ii 2 21 CHAS JEU NU rfan aut Daaka aE A ea a Eaa Ta aa S aaa E a NEA 22 6 5 13 jot table MOM bs u uuu uuu uuu iaai aaa ea S aaa kia iah aaa aaa gk kaaa 22 6 5 14 cu Status INTO MAIN luu ua asaciensasccdeesaactudnasucdoanadsaendnscedenanaeecebasneddthaasateabnanedcnsaais 22 65 15 jo codec stats Tisian Rania iaa 22 COAG Jeu e 910 OMSET Tosiaan onaniaa ane
44. ng has been specified 3 Prohibition of Access to Reserved Addresses Access to reserved addresses is prohibited The reserved addresses are provided for the possible future expansion of functions Do not access these addresses the correct operation of LSI is not guaranteed if they are accessed 4 Clock Signals After applying a reset only release the reset line after the operating clock signal has become stable When switching the clock signal during program execution wait until the target clock signal has stabilized When the clock signal is generated with an external resonator or from an external oscillator during a reset ensure that the reset line is only released after full stabilization of the clock signal Moreover when switching to a clock signal produced with an external resonator or by an external oscillator while program execution is in progress wait until the target clock signal is stable 5 Differences between Products Before changing from one product to another i e to a product with a different part number confirm that the change will not lead to problems The characteristics of an MPU or MCU in the same group but having a different part number may differ in terms of the internal memory capacity layout pattern and other factors which can affect the ranges of electrical characteristics such as characteristic values operating margins immunity to noise and amount of radiated noise When changing to a p
45. or the input output buffer setting in de compression jcu_decode_param_t Parameters for the option setting in de compression jcu_image_info_t Structure for the image information of the decoded JPEG data jcu_encode_param_t Parameters for the option setting in compression jcu_internal_information_t Structure for the internal state of the JCU driver jcu_async_status_t The JCU driver state and interrupt status 6 6 1 jcu_count_mode_param_t jcu_count_mode_param_t Synopsis Parameters for the count mode division process Header r_jcu_api h Description Member variable bool_t inputBuffer false Disable the division processing on input buffer isEnable true Enable the division processing on input buffer bool_t inputBuffer false When decoding paused the input address isn t isInitAddress initialized true When decoding paused the input address is initialized by inputBuffer restartAddress uint382_t inputBuffer If IsInitAddress is true the input data address is restartAddress initialized by this value uint32 t inputBuffer The division size of the input buffer dataCount In the case of decoding mode when data of dataCount byte count is input to JCU it pauses In the case of encoding mode when data of dataCount line count is input to JCU it pauses The dataCount must be a multiple of 8 bytes bool t outputBuffer false Disable the division processing on output buffer isEna
46. roduct with a different part number implement a system evaluation test for the given product Notice Descriptions of circuits software and other related information in this document are provided only to illustrate the operation of semiconductor products and application examples You are fully responsible for the incorporation of these circuits software and information in the design of your equipment Renesas Electronics assumes no responsibility for any losses incurred by you or third parties arising from the use of these circuits software or information Renesas Electronics has used reasonable care in preparing the information included in this document but Renesas Electronics does not warrant that such information is error free Renesas Electronics assumes no liability whatsoever for any damages incurred by you resulting from errors in or omissions from the information included herein Renesas Electronics does not assume any liability for infringement of patents copyrights or other intellectual property rights of third parties by or arising from the use of Renesas Electronics products or technical information described in this document No license express implied or otherwise is granted hereby under any patents copyrights or other intellectual property rights of Renesas Electronics or others You should not alter modify copy or otherwise misappropriate any Renesas Electronics product whether in whole or in part Renesas Electron
47. tate that interrupt occurred JCU_STATUS INTERRUPTED The state after interrupt function executed 6 5 15 cu_codec status t Table 6 21 Mode selection information Symbol JCU_CODEC_NOT_ SELECTED 5 The state of the JCU mode is not selected JCU_STATUS_ ENCODE The state of the JCU mode is JCU_ENCODE JCU_STATUS_DECODE uma sa The state of the JCU mode is JCU_DECODE 6 5 16 jcu_cbcr_offset_t Table 6 22 Cb Cr range setting Symbol JCU_CBCR_OFFSET_0 Range from 128 to 127 JCU_CBCR_OFFSET_128 i Range from 0 to 255 If the pixel format isn t YCbCr the JCU_CBCR_OFFSET_0 must be used R01AN1862EJ0100 Rev 1 00 Page 22 of 40 Jun 20 2014 RENESAS RZ A1H Group JPEG Codec Unit JCU APPLICATION NOTE 6 5 17 jcu_interrupt_line t Table 6 23 The kind of interrupt as the bit flag value Symbol JCU_INTERRUPT_LINE JEDI 0x00000001u Interrupt of JEDI JCU_INTERRUPT_LINE JDTI 0x00000002u Interrupt of JDTI 6 5 18 jcu_interrupt_lines_t Table 6 24 Logical sum of the bit flag value jcu_interrupt_line_t Symbol JCU_INTERRUPT_LINE_ ALL 0x00000003u Interrupt of both of JEDI and JDTI RO1AN1862EJ0100 Rev 1 00 Page 23 of 40 Jun 20 2014 RENESAS RZ A1H Group JPEG Codec Unit JCU APPLICATION NOTE 6 6 Structures Table 6 25 Structures Section Symbol Outline jcu_count_mode_param_t Parameters for the count mode division process jcu_buffer_t Structure for the input output buffer setting jcu_buffer_param_t Parameters f
48. the Basic types using in the example code Table 6 5 Basic types using in the example code Symbol Description 8 bit character bool_t Logical data type The value is true 1 or false 0 int_t The signed integer for this library is a 32 bit signed integer int8_t 8 bit signed integer int16_t int32_t 16 bit signed integer 32 bit signed integer uint8_t 8 bit unsigned integer uint16_t 16 bit unsigned integer uint32_t int_fast32_t 32 bit unsigned integer Fastest 32 bit minimum width signed integer uint_fast8_t Fastest 8 bit minimum width unsigned integer uint_fast16_ t Fastest 16 bit minimum width unsigned integer uint_fast32_t Fastest 32 bit minimum width unsigned integer uintptr_t Same as pointer bit width unsigned integer as physical address size_t Same as pointer bit width unsigned integer as byte size bit_flags_fast32_t Same as uint_fast32_t bit flags bit field bit_flags32_t RO1AN1862EJ0100 Rev 1 00 Jun 20 2014 Same as uint32_t bit flags bit field Page 18 of 40 RENESAS RZ A1H Group JPEG Codec Unit JCU APPLICATION NOTE 6 5 Constants Enumerations and Error code Table 6 6 Constants Used in Sample Code Section Description 6 5 1 Version information 6 5 2 errnum_t Error information 6 5 3 jcu_errorcode_t Error code 0 No error 6 5 4 jcu_codec_t Mod
49. ut the scatter loading function Table 6 1 and Table 6 2 list the Sections to be Used in this sample code Figure 6 6 shows the Section Assignment for the initial condition of the sample code and the condition after using the scatter loading function Table 6 1 Sections to be Used 1 2 Area Name Description Loading Execution Area Area VECTOR_TABLE Exception processing vector table FLASH FLASH RESET_HANDLER Program code area of reset handler processing This area consists of the following sections e INITCA9CACHE L1 cache setting e INIT_TTB MMU setting e RESET_HANDLER Reset handler CODE_BASIC_SETUP Program code area to optimize operating frequency and flash memory InRoot This area consists of the sections located in the root area such as C standard library CODE _FPU_INIT Program code area for NEON and VFP initializations This area consists of the following sections e CODE _FPU_INIT e FPU_INIT CODE_RESET Program code area for hardware initialization This area consists of the following sections e CODE_RESET Startup processing e INIT_VBAR Vector base setting CODE_IO_REGRW Program code area for read write functions of I O register CODE Program code area for defaults All the Code type sections which do not define section names with C source are assigned in this area Constant data area for defaults RO Data All the RO Data type sections which do not define section names with C source
Download Pdf Manuals
Related Search
Related Contents
V-CUBE セミナー 本校蒸気タービン実験装置再生プロジェクト (第3報) John Deere 5203 Lawn Mower User Manual Copyright © All rights reserved.
Failed to retrieve file