at91_isi.h 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221
  1. #ifndef _ARCH_ARM_AT91_ISI_H_
  2. #define _ARCH_ARM_AT91_ISI_H_
  3. /*
  4. * Copyright (C) 2010 by egnite GmbH
  5. *
  6. * All rights reserved.
  7. *
  8. * Redistribution and use in source and binary forms, with or without
  9. * modification, are permitted provided that the following conditions
  10. * are met:
  11. *
  12. * 1. Redistributions of source code must retain the above copyright
  13. * notice, this list of conditions and the following disclaimer.
  14. * 2. Redistributions in binary form must reproduce the above copyright
  15. * notice, this list of conditions and the following disclaimer in the
  16. * documentation and/or other materials provided with the distribution.
  17. * 3. Neither the name of the copyright holders nor the names of
  18. * contributors may be used to endorse or promote products derived
  19. * from this software without specific prior written permission.
  20. *
  21. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  22. * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  23. * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
  24. * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
  25. * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
  26. * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
  27. * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
  28. * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
  29. * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  30. * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
  31. * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  32. * SUCH DAMAGE.
  33. *
  34. * For additional information see http://www.ethernut.de/
  35. */
  36. /*!
  37. * \file arch/arm/at91_isi.h
  38. * \brief AT91 peripherals.
  39. *
  40. * \verbatim
  41. * $Id$
  42. * \endverbatim
  43. */
  44. /*!
  45. * \addtogroup xgNutArchArmAt91Isi
  46. */
  47. /*@{*/
  48. /*! \name Image Sensor Control Register 1 */
  49. /*@{*/
  50. #define ISI_CR1_OFF 0x00000000 /*!< \brief Control register 1 offset. */
  51. #define ISI_CR1 (ISI_BASE + ISI_CR1_OFF) /*!< \brief Control register 1 address. */
  52. #define ISI_RST 0x00000001 /*!< \brief Image sensor interface reset. */
  53. #define ISI_DIS 0x00000002 /*!< \brief Image sensor shut down. */
  54. #define ISI_HSYNC_POL 0x00000004 /*!< \brief HSYNC active low. */
  55. #define ISI_VSYNC_POL 0x00000008 /*!< \brief VSYNC active low. */
  56. #define ISI_PIXCLK_POL 0x00000010 /*!< \brief Data sampled on falling edge of pixel clock. */
  57. #define ISI_EMB_SYNC 0x00000040 /*!< \brief Embedded synchronisation. */
  58. #define ISI_CRC_SYNC 0x00000080 /*!< \brief CRC correction. */
  59. #define ISI_FRATE 0x00000700 /*!< \brief Frame rate capture mask. */
  60. #define ISI_FRATE_LSB 8 /*!< \brief Frame rate capture LSB. */
  61. #define ISI_FULL 0x00001000 /*!< \brief Full mode is allowed. */
  62. #define ISI_THMASK 0x00006000 /*!< \brief Threshold mask. */
  63. #define ISI_THMASK_4_8_16_BURST 0x00000000 /*!< \brief 4, 8 and 16 AHB bursts are allowed. */
  64. #define ISI_THMASK_8_16_BURST 0x00002000 /*!< \brief 8 and 16 AHB bursts are allowed. */
  65. #define ISI_THMASK_16_BURST 0x00004000 /*!< \brief Only 16 AHB bursts are allowed. */
  66. #define ISI_CODEC_ON 0x00008000 /*!< \brief Codec path enable. */
  67. #define ISI_SLD 0x00FF0000 /*!< \brief Start of line delay mask. */
  68. #define ISI_SLD_LSB 16 /*!< \brief Start of line delay LSB. */
  69. #define ISI_SFD 0xFF000000 /*!< \brief Start of frame delay mask. */
  70. #define ISI_SFD_LSB 24 /*!< \brief Start of frame delay LSB. */
  71. /*@}*/
  72. /*! \name Image Sensor Control Register 2 */
  73. /*@{*/
  74. #define ISI_CR2_OFF 0x00000004 /*!< \brief Control register 2 offset. */
  75. #define ISI_CR2 (ISI_BASE + ISI_CR2_OFF) /*!< \brief Control register 2 address. */
  76. #define ISI_IM_VSIZE 0x000007FF /*!< \brief Vertical size of the image sensor mask. */
  77. #define ISI_IM_VSIZE_LSB 0 /*!< \brief Vertical size of the image sensor LSB. */
  78. #define ISI_GS_MODE 0x00000800 /*!< \brief 1 pixel grayscale mode. */
  79. #define ISI_RGB_MODE 0x00001000 /*!< \brief 16 bit RGB mode. */
  80. #define ISI_GRAYSCALE 0x00002000 /*!< \brief Grayscale enable. */
  81. #define ISI_RGB_SWAP 0x00004000 /*!< \brief RGB swap. */
  82. #define ISI_COL_SPACE 0x00008000 /*!< \brief RGB color space for the image data. */
  83. #define ISI_IM_HSIZE 0x07FF0000 /*!< \brief Horizontal size of the image sensor mask. */
  84. #define ISI_IM_HSIZE_LSB 16 /*!< \brief Horizontal size of the image sensor LSB. */
  85. #define ISI_YCC_SWAP 0x30000000 /*!< \brief YCC swap mask. */
  86. #define ISI_YCC_SWAP_DEFAULT 0x00000000 /*!< \brief Image data format Cb(i) Y(i) Cr(i) Y(i+1). */
  87. #define ISI_YCC_SWAP_MODE1 0x10000000 /*!< \brief Image data format Cr(i) Y(i) Cb(i) Y(i+1). */
  88. #define ISI_YCC_SWAP_MODE2 0x20000000 /*!< \brief Image data format Y(i) Cb(i) Y(i+1) Cr(i). */
  89. #define ISI_YCC_SWAP_MODE3 0x30000000 /*!< \brief Image data format Y(i) Cr(i) Y(i+1) Cb(i). */
  90. #define ISI_RGB_CFG 0xC0000000 /*!< \brief RGB configuration mask. */
  91. #define ISI_RGB_CFG_DEFAULT 0x00000000 /*!< \brief RGB pattern R/G(MSB) G(LSB)/B R/G(MSB) G(LSB)/B. */
  92. #define ISI_RGB_CFG_MODE1 0x40000000 /*!< \brief RGB pattern B/G(MSB) G(LSB)/R B/G(MSB) G(LSB)/R. */
  93. #define ISI_RGB_CFG_MODE2 0x80000000 /*!< \brief RGB pattern G(LSB)/R B/G(MSB) G(LSB)/R B/G(MSB). */
  94. #define ISI_RGB_CFG_MODE3 0xC0000000 /*!< \brief RGB pattern G(LSB)/B R/G(MSB) G(LSB)/B R/G(MSB). */
  95. /*@}*/
  96. /*! \name Image Sensor Status and Interrupt Registers */
  97. /*@{*/
  98. #define ISI_SR_OFF 0x00000008 /*!< \brief Status register offset. */
  99. #define ISI_SR (ISI_BASE + ISI_SR_OFF) /*!< \brief Status register address. */
  100. #define ISI_IER_OFF 0x0000000C /*!< \brief Interrupt enable register offset. */
  101. #define ISI_IER (ISI_BASE + ISI_IER_OFF) /*!< \brief Interrupt enable address. */
  102. #define ISI_IDR_OFF 0x00000010 /*!< \brief Interrupt disable register offset. */
  103. #define ISI_IDR (ISI_BASE + ISI_IDR_OFF) /*!< \brief Interrupt disable address. */
  104. #define ISI_IMR_OFF 0x00000014 /*!< \brief Interrupt mask register offset. */
  105. #define ISI_IMR (ISI_BASE + ISI_IMR_OFF) /*!< \brief Interrupt mask address. */
  106. #define ISI_SOF 0x00000001 /*!< \brief Start of frame. */
  107. #define ISI_DIS 0x00000002 /*!< \brief Interface disable. */
  108. #define ISI_SOFTRST 0x00000004 /*!< \brief Software reset. */
  109. #define ISI_CDC_PND 0x00000008 /*!< \brief Codec request pending. */
  110. #define ISI_CRC_ERR 0x00000010 /*!< \brief CRC synchronisation error. */
  111. #define ISI_FO_C_OVF 0x00000020 /*!< \brief Codec overflow. */
  112. #define ISI_FO_P_OVF 0x00000040 /*!< \brief Preview FIFO overflow. */
  113. #define ISI_FO_P_EMP 0x00000080 /*!< \brief Preview FIFO empty. */
  114. #define ISI_FO_C_EMP 0x00000100 /*!< \brief Codec FIFO empty. */
  115. #define ISI_FR_OVR 0x00000200 /*!< \brief Frame rate overun. */
  116. /*@}*/
  117. /*! \name Image Sensor Preview Size Register */
  118. /*@{*/
  119. #define ISI_PSIZE_OFF 0x00000020 /*!< \brief Preview size register offset. */
  120. #define ISI_PSIZE (ISI_BASE + ISI_PSIZE_OFF) /*!< \brief Preview size register address. */
  121. #define ISI_PREV_VSIZE 0x000003FF /*!< \brief Vertical size for the preview path mask. */
  122. #define ISI_PREV_VSIZE_LSB 0 /*!< \brief Vertical size for the preview path LSB. */
  123. #define ISI_PREV_HSIZE 0x03FF0000 /*!< \brief Horizontal size for the preview path mask. */
  124. #define ISI_PREV_HSIZE_LSB 16 /*!< \brief Horizontal size for the preview path LSB. */
  125. /*@}*/
  126. /*! \name Image Sensor Preview Decimation Register */
  127. /*@{*/
  128. #define ISI_PDECF_OFF 0x00000024 /*!< \brief Preview decimation factor register offset. */
  129. #define ISI_PDECF (ISI_BASE + ISI_PDECF_OFF) /*!< \brief Preview decimation factor register address. */
  130. #define ISI_DEC_FACTOR 0x000000FF /*!< \brief Decimation factor mask. */
  131. #define ISI_DEC_FACTOR_LSB 0 /*!< \brief Decimation factor LSB. */
  132. /*@}*/
  133. /*! \name Image Sensor Preview Primary FBD Register */
  134. /*@{*/
  135. #define ISI_PPFBD_OFF 0x00000028 /*!< \brief Preview frame buffer address register offset. */
  136. #define ISI_PPFBD (ISI_BASE + ISI_PPFBD_OFF) /*!< \brief Preview frame buffer address register address. */
  137. /*@}*/
  138. /*! \name Image Sensor Codec DMA Base Address Register */
  139. /*@{*/
  140. #define ISI_CDBA_OFF 0x0000002C /*!< \brief Codec DMA address register offset. */
  141. #define ISI_CDBA (ISI_BASE + ISI_CDBA_OFF) /*!< \brief Codec DMA address register address. */
  142. /*@}*/
  143. /*! \name Image Sensor Color Space Conversion YCrCb To RGB Set 0 Register */
  144. /*@{*/
  145. #define ISI_Y2R_SET0_OFF 0x00000030 /*!< \brief YCrCb to RGB conversion set 0 register offset. */
  146. #define ISI_Y2R_SET0 (ISI_BASE + ISI_Y2R_SET0_OFF) /*!< \brief YCrCb to RGB conversion set 0 register address. */
  147. #define ISI_Y2R_C0 0x000000FF /*!< \brief Conversion matrix coefficient C0 mask. */
  148. #define ISI_Y2R_C0_LSB 0 /*!< \brief Conversion matrix coefficient C0 LSB. */
  149. #define ISI_Y2R_C1 0x0000FF00 /*!< \brief Conversion matrix coefficient C1 mask. */
  150. #define ISI_Y2R_C1_LSB 8 /*!< \brief Conversion matrix coefficient C1 LSB. */
  151. #define ISI_Y2R_C2 0x00FF0000 /*!< \brief Conversion matrix coefficient C2 mask. */
  152. #define ISI_Y2R_C2_LSB 16 /*!< \brief Conversion matrix coefficient C2 LSB. */
  153. #define ISI_Y2R_C3 0xFF000000 /*!< \brief Conversion matrix coefficient C3 mask. */
  154. #define ISI_Y2R_C3_LSB 24 /*!< \brief Conversion matrix coefficient C3 LSB. */
  155. /*@}*/
  156. /*! \name Image Sensor Color Space Conversion YCrCb To RGB Set 1 Register */
  157. /*@{*/
  158. #define ISI_Y2R_SET1_OFF 0x00000034 /*!< \brief YCrCb to RGB conversion set 1 register offset. */
  159. #define ISI_Y2R_SET1 (ISI_BASE + ISI_Y2R_SET1_OFF) /*!< \brief YCrCb to RGB conversion set 1 register address. */
  160. #define ISI_Y2R_C4 0x000001FF /*!< \brief Conversion matrix coefficient C4 mask. */
  161. #define ISI_Y2R_C4_LSB 0 /*!< \brief Conversion matrix coefficient C4 LSB. */
  162. #define ISI_Y2R_YOFF 0x00001000 /*!< \brief Luminance default offset 128. */
  163. #define ISI_Y2R_CROFF 0x00002000 /*!< \brief Red chrominance default offset 16. */
  164. #define ISI_Y2R_CBOFF 0x00004000 /*!< \brief Blue chrominance default offset 16. */
  165. /*@}*/
  166. /*! \name Image Sensor Color Space Conversion RGB To YCrCb Set 0 Register */
  167. /*@{*/
  168. #define ISI_R2Y_SET0_OFF 0x00000038 /*!< \brief RGB to YCrCb conversion set 0 register offset. */
  169. #define ISI_R2Y_SET0 (ISI_BASE + ISI_R2Y_SET0_OFF) /*!< \brief RGB to YCrCb conversion set 0 register address. */
  170. #define ISI_R2Y_C0 0x000000FF /*!< \brief Conversion matrix coefficient C0 mask. */
  171. #define ISI_R2Y_C0_LSB 0 /*!< \brief Conversion matrix coefficient C0 LSB. */
  172. #define ISI_R2Y_C1 0x0000FF00 /*!< \brief Conversion matrix coefficient C1 mask. */
  173. #define ISI_R2Y_C1_LSB 8 /*!< \brief Conversion matrix coefficient C1 LSB. */
  174. #define ISI_R2Y_C2 0x00FF0000 /*!< \brief Conversion matrix coefficient C2 mask. */
  175. #define ISI_R2Y_C2_LSB 16 /*!< \brief Conversion matrix coefficient C2 LSB. */
  176. #define ISI_R2Y_ROFF 0x01000000 /*!< \brief Red component offset 16. */
  177. /*@}*/
  178. /*! \name Image Sensor Color Space Conversion RGB To YCrCb Set 1 Register */
  179. /*@{*/
  180. #define ISI_R2Y_SET1_OFF 0x0000003C /*!< \brief RGB to YCrCb conversion set 1 register offset. */
  181. #define ISI_R2Y_SET1 (ISI_BASE + ISI_R2Y_SET1_OFF) /*!< \brief RGB to YCrCb conversion set 1 register address. */
  182. #define ISI_R2Y_C3 0x000000FF /*!< \brief Conversion matrix coefficient C3 mask. */
  183. #define ISI_R2Y_C3_LSB 0 /*!< \brief Conversion matrix coefficient C3 LSB. */
  184. #define ISI_R2Y_C4 0x0000FF00 /*!< \brief Conversion matrix coefficient C4 mask. */
  185. #define ISI_R2Y_C4_LSB 8 /*!< \brief Conversion matrix coefficient C4 LSB. */
  186. #define ISI_R2Y_C5 0x00FF0000 /*!< \brief Conversion matrix coefficient C5 mask. */
  187. #define ISI_R2Y_C5_LSB 16 /*!< \brief Conversion matrix coefficient C5 LSB. */
  188. #define ISI_R2Y_GOFF 0x01000000 /*!< \brief Green component offset 128. */
  189. /*@}*/
  190. /*! \name Image Sensor Color Space Conversion RGB To YCrCb Set 2 Register */
  191. /*@{*/
  192. #define ISI_R2Y_SET2_OFF 0x00000040 /*!< \brief RGB to YCrCb conversion set 2 register offset. */
  193. #define ISI_R2Y_SET2 (ISI_BASE + ISI_R2Y_SET2_OFF) /*!< \brief RGB to YCrCb conversion set 2 register address. */
  194. #define ISI_R2Y_C6 0x000000FF /*!< \brief Conversion matrix coefficient C6 mask. */
  195. #define ISI_R2Y_C6_LSB 0 /*!< \brief Conversion matrix coefficient C6 LSB. */
  196. #define ISI_R2Y_C7 0x0000FF00 /*!< \brief Conversion matrix coefficient C7 mask. */
  197. #define ISI_R2Y_C7_LSB 8 /*!< \brief Conversion matrix coefficient C7 LSB. */
  198. #define ISI_R2Y_C8 0x00FF0000 /*!< \brief Conversion matrix coefficient C8 mask. */
  199. #define ISI_R2Y_C8_LSB 16 /*!< \brief Conversion matrix coefficient C8 LSB. */
  200. #define ISI_R2Y_BOFF 0x01000000 /*!< \brief Blue component offset 128. */
  201. /*@}*/
  202. /*@} xgNutArchArmAt91Isi */
  203. #endif /* _ARCH_ARM_AT91_ISI_H_ */