SDK_V1.2.0
command | ||
xs9922_test.c | help iic(iic_main) xs9922(xs9922_main) _exit _quit | main |
xs9922_main.c | help reg_mipi reg_bt unreg setdev setco_lineout setcoaud setlinein setlineout setdev_vo_2mux setdev_vo_4mux getdev detect dstart dstop seteq geteq status freerun camera(w s a d e) senddata recvdata | |
iic.c | iic [rRwW] chip bus reg iic [mr|MR] chip bus reg flag iic [mw|MW] chip bus reg data flag |
build
1 #!/bin/bash
2
3 export CROSS=/opt/bin/gcc-arm-10.3-2021.07-x86_64-arm-none-linux-gnueabihf/bin/arm-none-linux-gnueabihf-
4
5 clean () {
6 make clean comp=free plat=arm -C build/Linux_Lib
7 make clean chip=arm -C build/Linux_App
8 }
9
10 build () {
11 make comp=free plat=arm -C build/Linux_Lib
12 make chip=arm -C build/Linux_App
13 }
14
15 clean
16 build
patch
static for android9
--- a/build/Linux_App/Makefile
+++ b/build/Linux_App/Makefile
@@ -32,6 +32,7 @@ ifeq ($(strip $(chip)),)
$(error "make chip=chip_type");
endif
+APP_DIR := ../../sample/Linux_APP^M
ifeq ($(chip), hisi3531a)
APP_DIR := ../../test/Linux_Hisi3531_APP
CROSS = /home/compiler/hisi/Hi3531a/arm-hisiv300-linux/bin/arm-hisiv300-linux-uclibcgnueabi-
@@ -65,8 +66,9 @@ SYS_LIBS :=
LIBS := $(EXT_LIBS) $(SYS_LIBS)
########### configurate CFLAGS ##########################
-CFLAGS += -Wall -O2 -w -lpthread
-CFLAGS += -g $(INCPATH) $(LIBS)
+CFLAGS += -Wall -O2 -w^M
+CFLAGS += -g $(INCPATH)^M
+LDFLAGS += -g $(LIBS) -lpthread -static^M
CFILES-y := ../../src/xs9922.c
CFILES-y += $(APP_DIR)/src/xs9922_test.c
@@ -74,16 +76,22 @@ CFILES-y += $(APP_DIR)/src/cmd.c
CFILES-y += $(APP_DIR)/src/iic.c
CFILES-y += $(APP_DIR)/src/xs9922_main.c
+OBJS := $(CFILES-y:.c=.o)^M
EXEC := $(CFG_NAME)
+EXEC := xs9922_sdk^M
.PHONY: all
all: clean $(EXEC)
-$(EXEC):
- $(CC) $(CFLAGS) -o $(EXEC) $(CFILES-y)
- scp $(EXEC) share@10.35.37.1:/mnt/pool/share/home/chen_li/miami
+%.o: %.c^M
+ $(CC) -o $@ -c $(CFLAGS) $<^M
+^M
+$(EXEC): $(OBJS)^M
+ $(CC) -o $(EXEC) $^ $(LDFLAGS)^M
+ #scp $(EXEC) share@10.35.37.1:/mnt/pool/share/home/chen_li/miami^M
clean:
@echo Make Clean;
+ rm -f $(OBJS)^M
rm -f $(EXEC)
--- a/build/Linux_Lib/Makefile
+++ b/build/Linux_Lib/Makefile
@@ -47,6 +47,8 @@ PDF_FILE_NAME := xs9922\ SDK\ Development\ Guide.pdf
PDF_IN_FILE := ../$(PDF_FILE_NAME)
# Configure the Makefile CROSS Compiler
+DIR:= $(plat)
+TEST_FILE = ../../test/Linux_APP
ifeq ($(comp), hisi3531dv100)
COMP_NAME := For_Hisi3531dv100
@@ -91,7 +93,7 @@ endif
LIBNAME =
# link the lib
-LIBS = -L. -L/usr/lib $(LIBNAME)
+#LIBS = -L. -L/usr/lib $(LIBNAME)
# Configure the Makefile *.h *.hpp search path
API_INC := ../../include/*.h
@@ -122,8 +124,9 @@ SOBJS :=
OBJ := $(COBJS)
-.c.o:
+%.o: %.c
$(CC) $(CFLAGS) $(INCLUDE) -c -o $@ $<
+
all: begin welcome version clean $(APP) ssize end
test:
--- a/sample/Linux_APP/src/xs9922_main.c
+++ b/sample/Linux_APP/src/xs9922_main.c
@@ -50,7 +50,7 @@
#include "xs9922_api.h"
#include "iic.h"
#include "xs9922_main.h"
-//#include "xs9922_reg_cfg.h"
+#include "xs9922_reg_cfg.h"^M
// #define USE_HI_CODEC
@@ -519,7 +519,7 @@ NI_S32 run_register_bt()
// stRegInfo.enChipPack[0] = NI_CHIP_PACK_MIPI; // MIPI or BT
stRegInfo.stMipiLaneAttr.stMipiLaneNum = NI_MIPI_LANE_MODE_4; //lane_num
stRegInfo.stMipiLaneAttr.u16MipiLaneFreq = 1500; // 1.5G
- stRegInfo.astNiDevInfo[0].u8I2cDev = 0;
+ stRegInfo.astNiDevInfo[0].u8I2cDev = 6;^M
stRegInfo.astNiDevInfo[0].u8DevAddr = 0x60;
stRegInfo.stNiRegFunc.NI_WriteByte = NI_TEST_WriteByte;
stRegInfo.stNiRegFunc.NI_ReadByte = NI_TEST_ReadByte;
@@ -551,7 +551,7 @@ NI_S32 run_register_mipi()
stRegInfo.stMipiLaneAttr.bMipiLanePnSwap[2] = 1;
stRegInfo.stMipiLaneAttr.bMipiLanePnSwap[3] = 0;
stRegInfo.stMipiLaneAttr.u16MipiLaneFreq = 1500; // 1.5G
- stRegInfo.astNiDevInfo[0].u8I2cDev = 0;
+ stRegInfo.astNiDevInfo[0].u8I2cDev = 6;^M
stRegInfo.astNiDevInfo[0].u8DevAddr = 0x60;
stRegInfo.stNiRegFunc.NI_WriteByte = NI_TEST_WriteByte;
stRegInfo.stNiRegFunc.NI_ReadByte = NI_TEST_ReadByte;
@@ -2071,7 +2071,7 @@ int xs9922_main(int argc, char **argv)
fmt_num = str2int(argv[4]);
}
- reg_cfg(u8I2cDev, u8DevAddr, fmt_num);
+ reg_cfg(u8I2cDev, u8DevAddr, NI_CHIP_PACK_MIPI, fmt_num);^M
}
/*else if (!strcmp(argv[1], "capture"))
for evb
i2c0, normal video out mode
--- a/sample/Linux_APP/src/xs9922_main.c
+++ b/sample/Linux_APP/src/xs9922_main.c
@@ -551,7 +551,7 @@ NI_S32 run_register_mipi()
stRegInfo.stMipiLaneAttr.bMipiLanePnSwap[2] = 1;
stRegInfo.stMipiLaneAttr.bMipiLanePnSwap[3] = 0;
stRegInfo.stMipiLaneAttr.u16MipiLaneFreq = 1500; // 1.5G
- stRegInfo.astNiDevInfo[0].u8I2cDev = 6;
+ stRegInfo.astNiDevInfo[0].u8I2cDev = 0;^M
stRegInfo.astNiDevInfo[0].u8DevAddr = 0x60;
stRegInfo.stNiRegFunc.NI_WriteByte = NI_TEST_WriteByte;
stRegInfo.stNiRegFunc.NI_ReadByte = NI_TEST_ReadByte;
--- a/src/xs9922.c
+++ b/src/xs9922.c
@@ -4302,7 +4302,7 @@ static NI_VOID NiSdkDevInit(NI_U8 u8DevId)
pstNiCtx->astNiDevAttr[u8DevId].astVideoAttr[i].stFreeRunAttr.enFreeRunColor = NI_FREERUN_COLOR_BLUE;
pstNiCtx->astNiDevAttr[u8DevId].astVideoAttr[i].stFreeRunAttr.enFreeRunFormat = NI_CVI_1280x720_25HZ;
stFreeRunAttr = pstNiCtx->astNiDevAttr[u8DevId].astVideoAttr[i].stFreeRunAttr;
- NiSdkSetFreeRun(u8DevId, i, &stFreeRunAttr, 1);
+ NiSdkSetFreeRun(u8DevId, i, &stFreeRunAttr, 0);^M
NiSdkWriteRegBit(u8I2cDev, u8DevAddr, NI_050E_VIDEO_OUT_CTRL1 + (i * NI_REG_CHANEL_INC1000), 0, 1, pstNiCtx->astNiDevAttr[u8DevId].astVideoAttr[i].stVoAttr.enChnDataSrc);
}
问多多
CVBS摄像头图像明显的锯齿
摄像头图像先黑白后彩色
720P30摄像头偏色
接360盒子图像水波纹
接360盒子图像左右晃动
接720P30摄像头上下抖
接720P 360盒子画面顶部有变形
接海康摄像头偏色
调试
colorbar.bat
::@echo off
@title xs9922b colorbar by adb
adb wait-for-device
adb push i2ctransfer /data/xbin/i2ctransfer
adb shell chmod +x /data/xbin/i2ctransfer
::freerun color: 0 white, 1 yellow, 2 cyan, 3 green, 4 purple, 5 red, 6 blue, 7 black, 8 colorbar
adb shell /data/xbin/i2ctransfer -f -y 6 w3@0x30 0x0e 0x11 0x08
::freerun std: 1 720P25, 2 720P30, 3 720P50, 4 720P60, 5 1080P25, 6 1080P30, 11 960PAL, 12 960NTSC, 13 720PAL, 14 720NTSC, 15 D-PHY stress, default 720P25
adb shell /data/xbin/i2ctransfer -f -y 6 w3@0x30 0x0e 0x12 0x02
pause
colorbar_disable.bat
::@echo off
@title xs9922b colorbar by adb
adb wait-for-device
::free_run_enable, bit 0: 1 enable, 0 disable
adb shell /data/xbin/i2ctransfer -f -y 6 w3@0x30 0x0e 0x10 0x00
pause
colorbar_enable.bat
::@echo off
@title xs9922b colorbar by adb
adb wait-for-device
::free_run_enable, bit 0: 1 enable, 0 disable
adb shell /data/xbin/i2ctransfer -f -y 6 w3@0x30 0x0e 0x10 0x01
pause
freerun_force.bat
::@echo off
@title xs9922b colorbar by adb
adb wait-for-device
::video out mode, bit 6:5 3 force freerun, 0 normal
adb shell /data/xbin/i2ctransfer -f -y 6 w3@0x30 0x05 0x02 0xe0
pause
freerun_normal.bat
::@echo off
@title xs9922b colorbar by adb
adb wait-for-device
::video out mode, bit 6:5 3 force freerun, 0 normal
adb shell /data/xbin/i2ctransfer -f -y 6 w3@0x30 0x05 0x02 0x80
pause
get.bat
::@echo off
@title i2c by adb
::Usage: i2ctransfer [-f] [-y] [-v] [-V] [-a] I2CBUS DESC [DATA] [DESC [DATA]]...
:: I2CBUS is an integer or an I2C bus name
:: DESC describes the transfer in the form: {r|w}LENGTH[@address]
:: 1) read/write-flag 2) LENGTH (range 0-65535) 3) I2C address (use last one if omitted)
:: DATA are LENGTH bytes for a write message. They can be shortened by a suffix:
:: = (keep value constant until LENGTH)
:: + (increase value by 1 until LENGTH)
:: - (decrease value by 1 until LENGTH)
:: p (use pseudo random generator until LENGTH with value as seed)
::Example (bus 0, read 8 byte at offset 0x64 from EEPROM at 0x50):
:: # i2ctransfer 0 w1@0x50 0x64 r8
::Example (same EEPROM, at offset 0x42 write 0xff 0xfe ... 0xf0):
:: # i2ctransfer 0 w17@0x50 0x42 0xff-
:: xs9922b i2c bus 6, i2c address 0x30
adb wait-for-device
adb push i2ctransfer /data/xbin/i2ctransfer
adb shell chmod +x /data/xbin/i2ctransfer
::x130 NI_0130_TBC_AND_BACK_END_HSYNC_LOOP_CONTROL_REGISTER, be_edge_sel 0-auto 2-positive
::x12e NI_012E_BACK_END_HSYNC_STEP_CONTROL_REGISTER
:: read register
adb shell /data/xbin/i2ctransfer -f -y 6 w2@0x30 0x01 0x30 r1
adb shell /data/xbin/i2ctransfer -f -y 6 w2@0x30 0x11 0x30 r1
adb shell /data/xbin/i2ctransfer -f -y 6 w2@0x30 0x21 0x30 r1
adb shell /data/xbin/i2ctransfer -f -y 6 w2@0x30 0x31 0x30 r1
adb shell /data/xbin/i2ctransfer -f -y 6 w2@0x30 0x01 0x2e r1
adb shell /data/xbin/i2ctransfer -f -y 6 w2@0x30 0x11 0x2e r1
adb shell /data/xbin/i2ctransfer -f -y 6 w2@0x30 0x21 0x2e r1
adb shell /data/xbin/i2ctransfer -f -y 6 w2@0x30 0x31 0x2e r1
pause
set_be_edge_sel__ll_p_scale.bat
::@echo off
@title i2c by adb
::Usage: i2ctransfer [-f] [-y] [-v] [-V] [-a] I2CBUS DESC [DATA] [DESC [DATA]]...
:: I2CBUS is an integer or an I2C bus name
:: DESC describes the transfer in the form: {r|w}LENGTH[@address]
:: 1) read/write-flag 2) LENGTH (range 0-65535) 3) I2C address (use last one if omitted)
:: DATA are LENGTH bytes for a write message. They can be shortened by a suffix:
:: = (keep value constant until LENGTH)
:: + (increase value by 1 until LENGTH)
:: - (decrease value by 1 until LENGTH)
:: p (use pseudo random generator until LENGTH with value as seed)
::Example (bus 0, read 8 byte at offset 0x64 from EEPROM at 0x50):
:: # i2ctransfer 0 w1@0x50 0x64 r8
::Example (same EEPROM, at offset 0x42 write 0xff 0xfe ... 0xf0):
:: # i2ctransfer 0 w17@0x50 0x42 0xff-
:: xs9922b i2c bus 6, i2c address 0x30
adb wait-for-device
adb push i2ctransfer /data/xbin/i2ctransfer
adb shell chmod +x /data/xbin/i2ctransfer
::x130 NI_0130_TBC_AND_BACK_END_HSYNC_LOOP_CONTROL_REGISTER, be_edge_sel 0-auto 2-positive
::x12e NI_012E_BACK_END_HSYNC_STEP_CONTROL_REGISTER
:: read register
adb shell /data/xbin/i2ctransfer -f -y 6 w3@0x30 0x01 0x30 0x00
adb shell /data/xbin/i2ctransfer -f -y 6 w3@0x30 0x11 0x30 0x00
adb shell /data/xbin/i2ctransfer -f -y 6 w3@0x30 0x21 0x30 0x00
adb shell /data/xbin/i2ctransfer -f -y 6 w3@0x30 0x31 0x30 0x00
adb shell /data/xbin/i2ctransfer -f -y 6 w3@0x30 0x01 0x2e 0x30
adb shell /data/xbin/i2ctransfer -f -y 6 w3@0x30 0x11 0x2e 0x30
adb shell /data/xbin/i2ctransfer -f -y 6 w3@0x30 0x21 0x2e 0x30
adb shell /data/xbin/i2ctransfer -f -y 6 w3@0x30 0x31 0x2e 0x30
adb shell /data/xbin/i2ctransfer -f -y 6 w3@0x30 0x01 0x30 0x02
adb shell /data/xbin/i2ctransfer -f -y 6 w3@0x30 0x11 0x30 0x02
adb shell /data/xbin/i2ctransfer -f -y 6 w3@0x30 0x21 0x30 0x02
adb shell /data/xbin/i2ctransfer -f -y 6 w3@0x30 0x31 0x30 0x02
adb shell /data/xbin/i2ctransfer -f -y 6 w3@0x30 0x01 0x2e 0x31
adb shell /data/xbin/i2ctransfer -f -y 6 w3@0x30 0x11 0x2e 0x31
adb shell /data/xbin/i2ctransfer -f -y 6 w3@0x30 0x21 0x2e 0x31
adb shell /data/xbin/i2ctransfer -f -y 6 w3@0x30 0x31 0x2e 0x31
pause