ソースを参照

CPU工程更新
1、pxp驱动添加对argb888格式的支持
2、优化spi flash驱动编译警告问题(添加头文件)

helen 1 週間 前
コミット
141915d9f7

+ 1 - 0
amt630hv160-freertos-beta/ArkmicroFiles/libcpu-amt630hv160/include/pxp.h

@@ -113,6 +113,7 @@ typedef enum _PXP_ROTATE {
 }PXP_ROTATE;
 
 typedef enum _PXP_S0_FORMAT {
+	PXP_S0_FORMAT_ARGB888	= 0x0,	//
 	PXP_S0_FORMAT_RGB888	= 0x1,	//
 	PXP_S0_FORMAT_RGB565	= 0x4,	//
 	PXP_S0_FORMAT_RGB555	= 0x5,	//

+ 22 - 5
amt630hv160-freertos-beta/ArkmicroFiles/libcpu-amt630hv160/source/pxp.c

@@ -423,7 +423,7 @@ int pxp_reset(void)
 	PXP_WRITEL(1 << 31, PXP_CTRL);
     udelay(10);
 	PXP_WRITEL(0, PXP_CTRL);
-	
+
 	return 0;
 }
 
@@ -537,6 +537,8 @@ int pxp_rotate(uint32_t s0buf, uint32_t s0ubuf, uint32_t s0vbuf,
 {
 	uint32_t ctrl;
 	int ret = 0;
+	int alpha_out_enable = 0;
+	int crop_enable = 0;
 
 	configASSERT(outangle >= PXP_ROTATE_0 && outangle <= PXP_ROTATE_270);
 
@@ -551,6 +553,22 @@ int pxp_rotate(uint32_t s0buf, uint32_t s0ubuf, uint32_t s0vbuf,
 	pxp_set_s0_input_size(0, 0, s0width, s0height);
 	pxp_set_s0_background_color(0);
 	pxp_set_color_space_conversion_coefficient(PXP_CSCCOEFF_YCBCR2RGB);
+	if (outformat == PXP_OUT_FORMAT_ARGB888) {
+		if(s0format == PXP_S0_FORMAT_ARGB888) {
+			pxp_overlay_set_addr(PXP_OL0, s0buf);
+			pxp_overlay_set_size(PXP_OL0, 0, 0, s0width, s0height);
+			pxp_overlay_set_alpha_value(PXP_OL0, 0xff);
+			pxp_overlay_set_format(PXP_OL0, PXP_OL_FORMAT_ARGB8888);
+			pxp_overlay_set_alpha_cntl_type(PXP_OL0, PXP_OL_ALPHA_CNTL_TYPE_ROPS);
+			pxp_overlay_set_rop(PXP_OL0, 3);
+			pxp_overlay_enable(PXP_OL0, 1);
+			pxp_set_s0_cropping_size(0, 0, 0, 0);
+			crop_enable = 1;
+			s0format = PXP_S0_FORMAT_RGB888;
+		} else {
+			alpha_out_enable = 1;
+		}
+	}
 
 	pxp_param param;
 	memset(&param, 0, sizeof(pxp_param));
@@ -563,10 +581,9 @@ int pxp_rotate(uint32_t s0buf, uint32_t s0ubuf, uint32_t s0vbuf,
 #ifdef PXP_OUTPUT_MIRROR
 	param.hflip_enable			= 1;
 #endif
-	param.crop_enable			= 1;
-	param.scale_enable			= 1;
-	if(outformat == PXP_OUT_FORMAT_ARGB888)
-		param.alpha_out_enable = 1;
+	param.crop_enable			= crop_enable;
+	param.scale_enable			= 0;
+	param.alpha_out_enable		= alpha_out_enable;
 	pxp_set_control_param(&param);
 
 	xQueueReset(pxp_done);

+ 1 - 0
amt630hv160-freertos-beta/lib/sfud/port/sfud_port.c

@@ -30,6 +30,7 @@
 #include <stdarg.h>
 #include <string.h>
 
+#include "timer.h"
 #include "FreeRTOS.h"
 #include "spi.h"
 #include "errno.h"