SAMV71 Xplained Ultra Software Package 1.5

isi.h

Go to the documentation of this file.
00001 /* ---------------------------------------------------------------------------- */
00002 /*                  Atmel Microcontroller Software Support                      */
00003 /*                       SAM Software Package License                           */
00004 /* ---------------------------------------------------------------------------- */
00005 /* Copyright (c) 2015, Atmel Corporation                                        */
00006 /*                                                                              */
00007 /* All rights reserved.                                                         */
00008 /*                                                                              */
00009 /* Redistribution and use in source and binary forms, with or without           */
00010 /* modification, are permitted provided that the following condition is met:    */
00011 /*                                                                              */
00012 /* - Redistributions of source code must retain the above copyright notice,     */
00013 /* this list of conditions and the disclaimer below.                            */
00014 /*                                                                              */
00015 /* Atmel's name may not be used to endorse or promote products derived from     */
00016 /* this software without specific prior written permission.                     */
00017 /*                                                                              */
00018 /* DISCLAIMER:  THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR   */
00019 /* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */
00020 /* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE   */
00021 /* DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT,      */
00022 /* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */
00023 /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,  */
00024 /* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF    */
00025 /* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING         */
00026 /* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */
00027 /* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.                           */
00028 /* ---------------------------------------------------------------------------- */
00029 
00030 /** \file */
00031 
00032 /** \addtogroup isi_module
00033  * @{
00034  * \section gmac_usage Usage
00035  * - ISI_Init: initialize ISI with default parameters
00036  * - ISI_EnableInterrupt: enable one or more interrupts
00037  * - ISI_DisableInterrupt: disable one or more interrupts
00038  * - ISI_Enable: enable isi module
00039  * - ISI_Disable: disable isi module
00040  * - ISI_CodecPathFull: enable codec path
00041  * - ISI_SetFrame: set frame rate
00042  * - ISI_BytesForOnePixel: return number of byte for one pixel
00043  * - ISI_StatusRegister: return ISI status register
00044  * - ISI_Reset: make a software reset
00045  */
00046 /**@}*/
00047 
00048 #ifndef ISI_H
00049 #define ISI_H
00050 
00051 
00052 
00053 /*----------------------------------------------------------------------------
00054  *        Definition
00055  *----------------------------------------------------------------------------*/
00056 #define YUV_INPUT          0
00057 #define RGB_INPUT          1
00058 #define GRAYSCALE_INPUT    2
00059 
00060 /*----------------------------------------------------------------------------
00061  *        Types
00062  *----------------------------------------------------------------------------*/
00063 
00064 /** ISI descriptors */
00065 typedef struct {
00066     /** Current LCD index, used with AT91C_ISI_MAX_PREV_BUFFER */
00067     uint32_t CurrentLcdIndex;
00068     /** set if Fifo Codec Empty is present */
00069     volatile uint32_t DisplayCodec;
00070     /** upgrade for each Fifo Codec Overflow (statistics use) */
00071     uint32_t nb_codec_ovf;
00072     /** upgrade for each Fifo Preview Overflow (statistics use) */
00073     uint32_t nb_prev_ovf;
00074 } ISI_Descriptors;
00075 
00076 /** Frame Buffer Descriptors */
00077 typedef struct {
00078     /** Address of the Current FrameBuffer */
00079     uint32_t Current;
00080     /** Address of the Control */
00081     uint32_t Control;
00082     /** Address of the Next FrameBuffer */
00083     uint32_t Next;
00084 } ISI_FrameBufferDescriptors;
00085 
00086 
00087 /** ISI Matrix Color Space Conversion YCrCb to RGB */
00088 typedef struct {
00089     /** Color Space Conversion Matrix Coefficient C0*/
00090     uint8_t C0;
00091     /** Color Space Conversion Matrix Coefficient C1 */
00092     uint8_t C1;
00093     /** Color Space Conversion Matrix Coefficient C2 */
00094     uint8_t C2;
00095     /** Color Space Conversion Matrix Coefficient C3 */
00096     uint8_t C3;
00097     /** Color Space Conversion Red Chrominance Default Offset */
00098     uint8_t Croff;
00099     /** Color Space Conversion Blue Chrominance Default Offset */
00100     uint8_t Cboff;
00101     /** Color Space Conversion Luminance Default Offset */
00102     uint8_t Yoff;
00103     /** Color Space Conversion Matrix Coefficient C4 */
00104     uint16_t C4;
00105 } ISI_Y2R;
00106 
00107 /** ISI Matrix Color Space Conversion RGB to YCrCb */
00108 typedef struct {
00109     /** Color Space Conversion Matrix Coefficient C0*/
00110     uint8_t C0;
00111     /** Color Space Conversion Matrix Coefficient C1 */
00112     uint8_t C1;
00113     /** Color Space Conversion Matrix Coefficient C2 */
00114     uint8_t C2;
00115     /** Color Space Conversion Red Component Offset */
00116     uint8_t Roff;
00117     /** Color Space Conversion Matrix Coefficient C3*/
00118     uint8_t C3;
00119     /** Color Space Conversion Matrix Coefficient C4 */
00120     uint8_t C4;
00121     /** Color Space Conversion Matrix Coefficient C5 */
00122     uint8_t C5;
00123     /** Color Space Conversion Green Component Offset */
00124     uint8_t Goff;
00125     /** Color Space Conversion Matrix Coefficient C6*/
00126     uint8_t C6;
00127     /** Color Space Conversion Matrix Coefficient C7 */
00128     uint8_t C7;
00129     /** Color Space Conversion Matrix Coefficient C8 */
00130     uint8_t C8;
00131     /** Color Space Conversion Blue Component Offset */
00132     uint8_t Boff;
00133 } ISI_R2Y;
00134 
00135 /*----------------------------------------------------------------------------
00136  *         Exported functions
00137  *----------------------------------------------------------------------------*/
00138 extern void ISI_Enable(void);
00139 
00140 extern void ISI_Disable(void);
00141 
00142 void ISI_DmaChannelEnable(uint32_t channel);
00143 
00144 void ISI_DmaChannelDisable(uint32_t channel);
00145 
00146 extern void ISI_EnableInterrupt(uint32_t flag);
00147 
00148 extern void ISI_DisableInterrupt(uint32_t flag);
00149 
00150 extern void ISI_CodecPathFull(void);
00151 
00152 extern void ISI_SetFrameRate(uint32_t frame);
00153 
00154 extern uint8_t ISI_BytesForOnePixel(uint8_t bmpRgb);
00155 
00156 extern void ISI_Reset(void);
00157 
00158 extern void ISI_Init(pIsi_Video pVideo);
00159 
00160 extern uint32_t ISI_StatusRegister(void);
00161 
00162 extern void ISI_SetBlank(
00163     uint8_t hBlank,
00164     uint8_t vBlank);
00165 
00166 extern void ISI_SetSensorSize(
00167     uint32_t hSize,
00168     uint32_t vSize);
00169 
00170 extern void ISI_RgbPixelMapping(uint32_t wRgbPixelMapping);
00171 
00172 extern void ISI_RgbSwapMode(uint32_t swapMode);
00173 
00174 extern void ISI_YCrCbFormat(uint32_t wYuvSwapMode);
00175 
00176 extern void ISI_setGrayScaleMode(uint32_t wPixelFormat);
00177 
00178 extern void ISI_setInputStream(uint32_t wStreamMode);
00179 
00180 extern void ISI_setPreviewSize(
00181     uint32_t hSize,
00182     uint32_t vSize);
00183 
00184 extern void ISI_calcScalerFactor(void);
00185 
00186 extern void ISI_setDmaInPreviewPath(
00187     uint32_t baseFrameBufDesc,
00188     uint32_t dmaCtrl,
00189     uint32_t frameBufferStartAddr);
00190 
00191 extern void ISI_setDmaInCodecPath(
00192     uint32_t baseFrameBufDesc,
00193     uint32_t dmaCtrl,
00194     uint32_t frameBufferStartAddr);
00195 
00196 extern void ISI_SetMatrix4Yuv2Rgb (ISI_Y2R *yuv2rgb);
00197 extern void ISI_SetMatrix4Rgb2Yuv (ISI_R2Y *rgb2yuv);
00198 
00199 #endif //#ifndef ISI_H
00200 
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines