RTEMS  5.1
isi.h
Go to the documentation of this file.
1 /* ---------------------------------------------------------------------------- */
2 /* Atmel Microcontroller Software Support */
3 /* SAM Software Package License */
4 /* ---------------------------------------------------------------------------- */
5 /* Copyright (c) 2015, Atmel Corporation */
6 /* */
7 /* All rights reserved. */
8 /* */
9 /* Redistribution and use in source and binary forms, with or without */
10 /* modification, are permitted provided that the following condition is met: */
11 /* */
12 /* - Redistributions of source code must retain the above copyright notice, */
13 /* this list of conditions and the disclaimer below. */
14 /* */
15 /* Atmel's name may not be used to endorse or promote products derived from */
16 /* this software without specific prior written permission. */
17 /* */
18 /* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR */
19 /* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */
20 /* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE */
21 /* DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, */
22 /* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */
23 /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, */
24 /* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF */
25 /* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING */
26 /* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */
27 /* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
28 /* ---------------------------------------------------------------------------- */
29 
48 #ifndef ISI_H
49 #define ISI_H
50 
51 
52 
53 /*----------------------------------------------------------------------------
54  * Definition
55  *----------------------------------------------------------------------------*/
56 #define YUV_INPUT 0
57 #define RGB_INPUT 1
58 #define GRAYSCALE_INPUT 2
59 
60 /*----------------------------------------------------------------------------
61  * Types
62  *----------------------------------------------------------------------------*/
63 
65 typedef struct {
67  uint32_t CurrentLcdIndex;
69  volatile uint32_t DisplayCodec;
71  uint32_t nb_codec_ovf;
73  uint32_t nb_prev_ovf;
75 
77 typedef struct {
79  uint32_t Current;
81  uint32_t Control;
83  uint32_t Next;
85 
86 
88 typedef struct {
90  uint8_t C0;
92  uint8_t C1;
94  uint8_t C2;
96  uint8_t C3;
98  uint8_t Croff;
100  uint8_t Cboff;
102  uint8_t Yoff;
104  uint16_t C4;
105 } ISI_Y2R;
106 
108 typedef struct {
110  uint8_t C0;
112  uint8_t C1;
114  uint8_t C2;
116  uint8_t Roff;
118  uint8_t C3;
120  uint8_t C4;
122  uint8_t C5;
124  uint8_t Goff;
126  uint8_t C6;
128  uint8_t C7;
130  uint8_t C8;
132  uint8_t Boff;
133 } ISI_R2Y;
134 
135 /*----------------------------------------------------------------------------
136  * Exported functions
137  *----------------------------------------------------------------------------*/
138 extern void ISI_Enable(void);
139 
140 extern void ISI_Disable(void);
141 
142 void ISI_DmaChannelEnable(uint32_t channel);
143 
144 void ISI_DmaChannelDisable(uint32_t channel);
145 
146 extern void ISI_EnableInterrupt(uint32_t flag);
147 
148 extern void ISI_DisableInterrupt(uint32_t flag);
149 
150 extern void ISI_CodecPathFull(void);
151 
152 extern void ISI_SetFrameRate(uint32_t frame);
153 
154 extern uint8_t ISI_BytesForOnePixel(uint8_t bmpRgb);
155 
156 extern void ISI_Reset(void);
157 
158 extern void ISI_Init(pIsi_Video pVideo);
159 
160 extern uint32_t ISI_StatusRegister(void);
161 
162 extern void ISI_SetBlank(
163  uint8_t hBlank,
164  uint8_t vBlank);
165 
166 extern void ISI_SetSensorSize(
167  uint32_t hSize,
168  uint32_t vSize);
169 
170 extern void ISI_RgbPixelMapping(uint32_t wRgbPixelMapping);
171 
172 extern void ISI_RgbSwapMode(uint32_t swapMode);
173 
174 extern void ISI_YCrCbFormat(uint32_t wYuvSwapMode);
175 
176 extern void ISI_setGrayScaleMode(uint32_t wPixelFormat);
177 
178 extern void ISI_setInputStream(uint32_t wStreamMode);
179 
180 extern void ISI_setPreviewSize(
181  uint32_t hSize,
182  uint32_t vSize);
183 
184 extern void ISI_calcScalerFactor(void);
185 
186 extern void ISI_setDmaInPreviewPath(
187  uint32_t baseFrameBufDesc,
188  uint32_t dmaCtrl,
189  uint32_t frameBufferStartAddr);
190 
191 extern void ISI_setDmaInCodecPath(
192  uint32_t baseFrameBufDesc,
193  uint32_t dmaCtrl,
194  uint32_t frameBufferStartAddr);
195 
196 extern void ISI_SetMatrix4Yuv2Rgb (ISI_Y2R *yuv2rgb);
197 extern void ISI_SetMatrix4Rgb2Yuv (ISI_R2Y *rgb2yuv);
198 
199 #endif //#ifndef ISI_H
200 
void ISI_calcScalerFactor(void)
calculate scaler factor automatically.
Definition: isi.c:307
uint32_t Current
Definition: isi.h:79
uint8_t Goff
Definition: isi.h:124
Definition: isi.h:77
uint8_t C1
Definition: isi.h:92
uint32_t Control
Definition: isi.h:81
void ISI_SetMatrix4Rgb2Yuv(ISI_R2Y *rgb2yuv)
ISI set matrix for RGB to YUV color space for codec path.
Definition: isi.c:368
uint8_t C0
Definition: isi.h:110
uint32_t CurrentLcdIndex
Definition: isi.h:67
void ISI_DmaChannelDisable(uint32_t channel)
Disable ISI Dma channel.
Definition: isi.c:81
void ISI_Enable(void)
Enable ISI.
Definition: isi.c:61
Definition: isi.h:65
Definition: video.h:44
void ISI_setDmaInPreviewPath(uint32_t baseFrameBufDesc, uint32_t dmaCtrl, uint32_t frameBufferStartAddr)
Configure DMA for preview path.
Definition: isi.c:325
uint32_t nb_codec_ovf
Definition: isi.h:71
uint8_t Cboff
Definition: isi.h:100
uint8_t C4
Definition: isi.h:120
void ISI_YCrCbFormat(uint32_t wYuvSwapMode)
Defines YCrCb swap format.
Definition: isi.c:259
uint8_t Croff
Definition: isi.h:98
void ISI_Disable(void)
Disable ISI.
Definition: isi.c:89
void ISI_EnableInterrupt(uint32_t flag)
Enable ISI interrupt.
Definition: isi.c:104
void ISI_setGrayScaleMode(uint32_t wPixelFormat)
Input image is assumed to be grayscale-coded.
Definition: isi.c:269
void ISI_SetMatrix4Yuv2Rgb(ISI_Y2R *yuv2rgb)
ISI set matrix for YUV to RGB color space for preview path.
Definition: isi.c:351
void ISI_SetBlank(uint8_t hBlank, uint8_t vBlank)
Set the windows blank.
Definition: isi.c:202
uint8_t C0
Definition: isi.h:90
volatile uint32_t DisplayCodec
Definition: isi.h:69
uint8_t C1
Definition: isi.h:112
void ISI_SetFrameRate(uint32_t frame)
Set frame rate.
Definition: isi.c:142
void ISI_setInputStream(uint32_t wStreamMode)
Set data stream format.
Definition: isi.c:281
void ISI_DmaChannelEnable(uint32_t channel)
Enable ISI Dma channel.
Definition: isi.c:72
void ISI_SetSensorSize(uint32_t hSize, uint32_t vSize)
Set vertical and horizontal Size of the Image Sensor.
Definition: isi.c:213
uint8_t Yoff
Definition: isi.h:102
void ISI_RgbSwapMode(uint32_t swapMode)
Enables RGB swap.
Definition: isi.c:248
void ISI_setPreviewSize(uint32_t hSize, uint32_t vSize)
Set preview size.
Definition: isi.c:293
uint32_t Next
Definition: isi.h:83
uint8_t ISI_BytesForOnePixel(uint8_t bmpRgb)
Get the number of byte per pixels.
Definition: isi.c:156
uint32_t ISI_StatusRegister(void)
Return ISI status register.
Definition: isi.c:122
uint8_t C3
Definition: isi.h:118
void ISI_RgbPixelMapping(uint32_t wRgbPixelMapping)
Defines RGB pattern when RGB_MODE is set to 1.
Definition: isi.c:233
void ISI_DisableInterrupt(uint32_t flag)
Disable ISI interrupt.
Definition: isi.c:113
uint8_t Boff
Definition: isi.h:132
uint8_t C8
Definition: isi.h:130
uint8_t C2
Definition: isi.h:94
uint8_t Roff
Definition: isi.h:116
void ISI_CodecPathFull(void)
Enable Codec path for capture next frame.
Definition: isi.c:130
uint8_t C3
Definition: isi.h:96
void ISI_setDmaInCodecPath(uint32_t baseFrameBufDesc, uint32_t dmaCtrl, uint32_t frameBufferStartAddr)
Configure DMA for Codec path.
Definition: isi.c:339
Definition: isi.h:108
uint32_t nb_prev_ovf
Definition: isi.h:73
uint8_t C5
Definition: isi.h:122
Definition: isi.h:88
void ISI_Reset(void)
Reset ISI.
Definition: isi.c:179
uint8_t C6
Definition: isi.h:126
uint8_t C7
Definition: isi.h:128
uint8_t C2
Definition: isi.h:114
uint16_t C4
Definition: isi.h:104