@@ -197,6 +197,14 @@ typedef enum {
197197 ISP_LL_PIPELINE_CLK_CTRL_ALWAYS_ON , ///< Always on
198198} isp_ll_pipeline_clk_ctrl_t ;
199199
200+ /**
201+ * @brief Shadow mode
202+ */
203+ typedef enum {
204+ ISP_SHADOW_MODE_DISABLE ,
205+ ISP_SHADOW_MODE_UPDATE_EVERY_VSYNC ,
206+ ISP_SHADOW_MODE_UPDATE_ONLY_NEXT_VSYNC ,
207+ } isp_ll_shadow_mode_t ;
200208
201209/*---------------------------------------------------------------
202210 Clock
@@ -1852,6 +1860,224 @@ static inline void isp_ll_demosaic_set_padding_line_tail_valid_end_pixel(isp_dev
18521860 HAL_FORCE_MODIFY_U32_REG_FIELD (hw -> demosaic_matrix_ctrl , demosaic_tail_pixen_pulse_th , end_pixel );
18531861}
18541862
1863+ #if HAL_CONFIG (CHIP_SUPPORT_MIN_REV ) >= 300
1864+ /*---------------------------------------------------------------
1865+ Shadow
1866+ ---------------------------------------------------------------*/
1867+ /**
1868+ * @brief Shadow mode
1869+ *
1870+ * @param[in] hw Hardware instance address
1871+ * @param[in] mode 'isp_ll_shadow_mode_t`
1872+ */
1873+ static inline void isp_ll_shadow_set_mode (isp_dev_t * hw , isp_ll_shadow_mode_t mode )
1874+ {
1875+ hw -> shadow_reg_ctrl .shadow_update_sel = mode ;
1876+ }
1877+
1878+ /**
1879+ * @brief Update BLC shadow register
1880+ *
1881+ * @param[in] hw Hardware instance address
1882+ * @return
1883+ * - True if update is successful, False otherwise
1884+ */
1885+ static inline bool isp_ll_shadow_update_blc (isp_dev_t * hw )
1886+ {
1887+ //only valid when ISP_SHADOW_MODE_UPDATE_ONLY_NEXT_VSYNC
1888+ HAL_ASSERT (hw -> shadow_reg_ctrl .shadow_update_sel == ISP_SHADOW_MODE_UPDATE_ONLY_NEXT_VSYNC );
1889+
1890+ if (hw -> shadow_reg_ctrl .blc_update == 1 ) {
1891+ return false;
1892+ }
1893+
1894+ //self clear when ISP_SHADOW_MODE_UPDATE_ONLY_NEXT_VSYNC
1895+ hw -> shadow_reg_ctrl .blc_update = 1 ;
1896+
1897+ return true;
1898+ }
1899+
1900+ /**
1901+ * @brief Update DPC shadow register
1902+ *
1903+ * @param[in] hw Hardware instance address
1904+ * @return
1905+ * - True if update is successful, False otherwise
1906+ */
1907+ static inline bool isp_ll_shadow_update_dpc (isp_dev_t * hw )
1908+ {
1909+ //only valid when ISP_SHADOW_MODE_UPDATE_ONLY_NEXT_VSYNC
1910+ HAL_ASSERT (hw -> shadow_reg_ctrl .shadow_update_sel == ISP_SHADOW_MODE_UPDATE_ONLY_NEXT_VSYNC );
1911+
1912+ if (hw -> shadow_reg_ctrl .dpc_update == 1 ) {
1913+ return false;
1914+ }
1915+
1916+ //self clear when ISP_SHADOW_MODE_UPDATE_ONLY_NEXT_VSYNC
1917+ hw -> shadow_reg_ctrl .dpc_update = 1 ;
1918+
1919+ return true;
1920+ }
1921+
1922+ /**
1923+ * @brief Update BF shadow register
1924+ *
1925+ * @param[in] hw Hardware instance address
1926+ * @return
1927+ * - True if update is successful, False otherwise
1928+ */
1929+ static inline bool isp_ll_shadow_update_bf (isp_dev_t * hw )
1930+ {
1931+ //only valid when ISP_SHADOW_MODE_UPDATE_ONLY_NEXT_VSYNC
1932+ HAL_ASSERT (hw -> shadow_reg_ctrl .shadow_update_sel == ISP_SHADOW_MODE_UPDATE_ONLY_NEXT_VSYNC );
1933+
1934+ if (hw -> shadow_reg_ctrl .bf_update == 1 ) {
1935+ return false;
1936+ }
1937+
1938+ //self clear when ISP_SHADOW_MODE_UPDATE_ONLY_NEXT_VSYNC
1939+ hw -> shadow_reg_ctrl .bf_update = 1 ;
1940+
1941+ return true;
1942+ }
1943+
1944+ /**
1945+ * @brief Update WBG shadow register
1946+ *
1947+ * @param[in] hw Hardware instance address
1948+ * @return
1949+ * - True if update is successful, False otherwise
1950+ */
1951+ static inline bool isp_ll_shadow_update_wbg (isp_dev_t * hw )
1952+ {
1953+ //only valid when ISP_SHADOW_MODE_UPDATE_ONLY_NEXT_VSYNC
1954+ HAL_ASSERT (hw -> shadow_reg_ctrl .shadow_update_sel == ISP_SHADOW_MODE_UPDATE_ONLY_NEXT_VSYNC );
1955+
1956+ if (hw -> shadow_reg_ctrl .wbg_update == 1 ) {
1957+ return false;
1958+ }
1959+
1960+ //self clear when ISP_SHADOW_MODE_UPDATE_ONLY_NEXT_VSYNC
1961+ hw -> shadow_reg_ctrl .wbg_update = 1 ;
1962+
1963+ return true;
1964+ }
1965+
1966+ /**
1967+ * @brief Update CCM shadow register
1968+ *
1969+ * @param[in] hw Hardware instance address
1970+ * @return
1971+ * - True if update is successful, False otherwise
1972+ */
1973+ static inline bool isp_ll_shadow_update_ccm (isp_dev_t * hw )
1974+ {
1975+ //only valid when ISP_SHADOW_MODE_UPDATE_ONLY_NEXT_VSYNC
1976+ HAL_ASSERT (hw -> shadow_reg_ctrl .shadow_update_sel == ISP_SHADOW_MODE_UPDATE_ONLY_NEXT_VSYNC );
1977+
1978+ if (hw -> shadow_reg_ctrl .ccm_update == 1 ) {
1979+ return false;
1980+ }
1981+
1982+ //self clear when ISP_SHADOW_MODE_UPDATE_ONLY_NEXT_VSYNC
1983+ hw -> shadow_reg_ctrl .ccm_update = 1 ;
1984+
1985+ return true;
1986+ }
1987+
1988+ /**
1989+ * @brief Update Sharpen shadow register
1990+ *
1991+ * @param[in] hw Hardware instance address
1992+ * @return
1993+ * - True if update is successful, False otherwise
1994+ */
1995+ static inline bool isp_ll_shadow_update_sharpen (isp_dev_t * hw )
1996+ {
1997+ //only valid when ISP_SHADOW_MODE_UPDATE_ONLY_NEXT_VSYNC
1998+ HAL_ASSERT (hw -> shadow_reg_ctrl .shadow_update_sel == ISP_SHADOW_MODE_UPDATE_ONLY_NEXT_VSYNC );
1999+
2000+ if (hw -> shadow_reg_ctrl .sharp_update == 1 ) {
2001+ return false;
2002+ }
2003+
2004+ //self clear when ISP_SHADOW_MODE_UPDATE_ONLY_NEXT_VSYNC
2005+ hw -> shadow_reg_ctrl .sharp_update = 1 ;
2006+
2007+ return true;
2008+ }
2009+
2010+ /**
2011+ * @brief Update Color shadow register
2012+ *
2013+ * @param[in] hw Hardware instance address
2014+ * @return
2015+ * - True if update is successful, False otherwise
2016+ */
2017+ static inline bool isp_ll_shadow_update_color (isp_dev_t * hw )
2018+ {
2019+ //only valid when ISP_SHADOW_MODE_UPDATE_ONLY_NEXT_VSYNC
2020+ HAL_ASSERT (hw -> shadow_reg_ctrl .shadow_update_sel == ISP_SHADOW_MODE_UPDATE_ONLY_NEXT_VSYNC );
2021+
2022+ if (hw -> shadow_reg_ctrl .color_update == 1 ) {
2023+ return false;
2024+ }
2025+
2026+ //self clear when ISP_SHADOW_MODE_UPDATE_ONLY_NEXT_VSYNC
2027+ hw -> shadow_reg_ctrl .color_update = 1 ;
2028+
2029+ return true;
2030+ }
2031+
2032+ #else
2033+ static inline void isp_ll_shadow_set_mode (isp_dev_t * hw , isp_ll_shadow_mode_t mode )
2034+ {
2035+ //for compatibility
2036+ }
2037+
2038+ static inline bool isp_ll_shadow_update_blc (isp_dev_t * hw )
2039+ {
2040+ //for compatibility
2041+ return true;
2042+ }
2043+
2044+ static inline bool isp_ll_shadow_update_dpc (isp_dev_t * hw )
2045+ {
2046+ //for compatibility
2047+ return true;
2048+ }
2049+
2050+ static inline bool isp_ll_shadow_update_bf (isp_dev_t * hw )
2051+ {
2052+ //for compatibility
2053+ return true;
2054+ }
2055+
2056+ static inline bool isp_ll_shadow_update_wbg (isp_dev_t * hw )
2057+ {
2058+ //for compatibility
2059+ return true;
2060+ }
2061+
2062+ static inline bool isp_ll_shadow_update_ccm (isp_dev_t * hw )
2063+ {
2064+ //for compatibility
2065+ return true;
2066+ }
2067+
2068+ static inline bool isp_ll_shadow_update_sharpen (isp_dev_t * hw )
2069+ {
2070+ //for compatibility
2071+ return true;
2072+ }
2073+
2074+ static inline bool isp_ll_shadow_update_color (isp_dev_t * hw )
2075+ {
2076+ //for compatibility
2077+ return true;
2078+ }
2079+ #endif
2080+
18552081/*---------------------------------------------------------------
18562082 Sharpen
18572083---------------------------------------------------------------*/
0 commit comments