Skip to content

Commit

Permalink
Add GC5603
Browse files Browse the repository at this point in the history
  • Loading branch information
dimerr committed Jan 16, 2025
1 parent abb5522 commit e756fa4
Show file tree
Hide file tree
Showing 6 changed files with 3,302 additions and 1 deletion.
184 changes: 183 additions & 1 deletion libraries/sensor/hi3516ev200/bt656/bt656_sensor_ctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,8 @@ void bt656_restart(VI_PIPE ViPipe) { return; }
void bt656_init(VI_PIPE ViPipe) {
sensor_i2c_init(ViPipe);

tp9950_720p30_init(ViPipe);
tp9950_960h25_init(ViPipe);
//tp9950_720p30_init(ViPipe);
// tp9950_1080p30_init(ViPipe);

g_pastBT656[ViPipe]->bInit = GK_TRUE;
Expand All @@ -216,6 +217,187 @@ void bt656_exit(VI_PIPE ViPipe) {
return;
}


void tp9950_960h25_init(VI_PIPE ViPipe) {
sensor_write_register(ViPipe, 0x02, 0xCE);
sensor_write_register(ViPipe, 0x05, 0x00);
sensor_write_register(ViPipe, 0x06, 0x32);
sensor_write_register(ViPipe, 0x07, 0xC0);
sensor_write_register(ViPipe, 0x08, 0x00);
sensor_write_register(ViPipe, 0x09, 0x24);
sensor_write_register(ViPipe, 0x0A, 0x48);
sensor_write_register(ViPipe, 0x0B, 0xC0);
sensor_write_register(ViPipe, 0x0C, 0x13);
sensor_write_register(ViPipe, 0x0D, 0x51);
sensor_write_register(ViPipe, 0x0E, 0x00);
sensor_write_register(ViPipe, 0x0F, 0x00);
sensor_write_register(ViPipe, 0x10, 0xF8);
sensor_write_register(ViPipe, 0x11, 0x40);
sensor_write_register(ViPipe, 0x12, 0x60);
sensor_write_register(ViPipe, 0x13, 0x00);
sensor_write_register(ViPipe, 0x14, 0x00);
sensor_write_register(ViPipe, 0x15, 0x13);
sensor_write_register(ViPipe, 0x16, 0x70);
sensor_write_register(ViPipe, 0x17, 0xBC);
sensor_write_register(ViPipe, 0x18, 0x17);
sensor_write_register(ViPipe, 0x19, 0x20);
sensor_write_register(ViPipe, 0x1A, 0x17);
sensor_write_register(ViPipe, 0x1B, 0x01);
sensor_write_register(ViPipe, 0x1C, 0x09);
sensor_write_register(ViPipe, 0x1D, 0x48);
sensor_write_register(ViPipe, 0x1E, 0x80);
sensor_write_register(ViPipe, 0x1F, 0x80);
sensor_write_register(ViPipe, 0x20, 0x48);
sensor_write_register(ViPipe, 0x21, 0x84);
sensor_write_register(ViPipe, 0x22, 0x37);
sensor_write_register(ViPipe, 0x23, 0x3F);
sensor_write_register(ViPipe, 0x24, 0x04);
sensor_write_register(ViPipe, 0x25, 0xFF);
sensor_write_register(ViPipe, 0x26, 0x05);
sensor_write_register(ViPipe, 0x27, 0x2D);
sensor_write_register(ViPipe, 0x28, 0x00);
sensor_write_register(ViPipe, 0x29, 0x48);
sensor_write_register(ViPipe, 0x2A, 0x30);
sensor_write_register(ViPipe, 0x2B, 0x70);
sensor_write_register(ViPipe, 0x2C, 0x2A);
sensor_write_register(ViPipe, 0x2D, 0x64);
sensor_write_register(ViPipe, 0x2E, 0x56);
sensor_write_register(ViPipe, 0x2F, 0x00);
sensor_write_register(ViPipe, 0x30, 0x7A);
sensor_write_register(ViPipe, 0x31, 0x4A);
sensor_write_register(ViPipe, 0x32, 0x4D);
sensor_write_register(ViPipe, 0x33, 0xF0);
sensor_write_register(ViPipe, 0x34, 0x00);
sensor_write_register(ViPipe, 0x35, 0x65);
sensor_write_register(ViPipe, 0x36, 0xDC);
sensor_write_register(ViPipe, 0x37, 0x00);
sensor_write_register(ViPipe, 0x38, 0x00);
sensor_write_register(ViPipe, 0x39, 0x04);
sensor_write_register(ViPipe, 0x3A, 0x32);
sensor_write_register(ViPipe, 0x3B, 0x26);
sensor_write_register(ViPipe, 0x3C, 0x00);
sensor_write_register(ViPipe, 0x3D, 0x60);
sensor_write_register(ViPipe, 0x3E, 0x00);
sensor_write_register(ViPipe, 0x3F, 0x00);
sensor_write_register(ViPipe, 0x40, 0x00);
sensor_write_register(ViPipe, 0x41, 0x00);
sensor_write_register(ViPipe, 0x42, 0x00);
sensor_write_register(ViPipe, 0x43, 0x00);
sensor_write_register(ViPipe, 0x44, 0x00);
sensor_write_register(ViPipe, 0x45, 0x00);
sensor_write_register(ViPipe, 0x46, 0x00);
sensor_write_register(ViPipe, 0x47, 0x00);
sensor_write_register(ViPipe, 0x48, 0x00);
sensor_write_register(ViPipe, 0x49, 0x00);
sensor_write_register(ViPipe, 0x4A, 0x00);
sensor_write_register(ViPipe, 0x4B, 0x00);
sensor_write_register(ViPipe, 0x4C, 0x43);
sensor_write_register(ViPipe, 0x4D, 0x00);
sensor_write_register(ViPipe, 0x4E, 0x17);
sensor_write_register(ViPipe, 0x4F, 0x00);
sensor_write_register(ViPipe, 0x50, 0x00);
sensor_write_register(ViPipe, 0x51, 0x00);
sensor_write_register(ViPipe, 0x52, 0x00);
sensor_write_register(ViPipe, 0x53, 0x00);
sensor_write_register(ViPipe, 0x54, 0x00);

sensor_write_register(ViPipe, 0xB3, 0xFA);
sensor_write_register(ViPipe, 0xB4, 0x00);
sensor_write_register(ViPipe, 0xB5, 0x00);
sensor_write_register(ViPipe, 0xB6, 0x00);
sensor_write_register(ViPipe, 0xB7, 0x00);
sensor_write_register(ViPipe, 0xB8, 0x00);
sensor_write_register(ViPipe, 0xB9, 0x00);
sensor_write_register(ViPipe, 0xBA, 0x00);
sensor_write_register(ViPipe, 0xBB, 0x00);
sensor_write_register(ViPipe, 0xBC, 0x00);
sensor_write_register(ViPipe, 0xBD, 0x00);
sensor_write_register(ViPipe, 0xBE, 0x00);
sensor_write_register(ViPipe, 0xBF, 0x00);
sensor_write_register(ViPipe, 0xC0, 0x00);
sensor_write_register(ViPipe, 0xC1, 0x00);
sensor_write_register(ViPipe, 0xC2, 0x0B);
sensor_write_register(ViPipe, 0xC3, 0x0C);
sensor_write_register(ViPipe, 0xC4, 0x00);
sensor_write_register(ViPipe, 0xC5, 0x00);
sensor_write_register(ViPipe, 0xC6, 0x1F);
sensor_write_register(ViPipe, 0xC7, 0x78);
sensor_write_register(ViPipe, 0xC8, 0x27);
sensor_write_register(ViPipe, 0xC9, 0x00);
sensor_write_register(ViPipe, 0xCA, 0x00);
sensor_write_register(ViPipe, 0xCB, 0x07);
sensor_write_register(ViPipe, 0xCC, 0x08);
sensor_write_register(ViPipe, 0xCD, 0x00);
sensor_write_register(ViPipe, 0xCE, 0x00);
sensor_write_register(ViPipe, 0xCF, 0x04);
sensor_write_register(ViPipe, 0xD0, 0x00);
sensor_write_register(ViPipe, 0xD1, 0x00);
sensor_write_register(ViPipe, 0xD2, 0x60);
sensor_write_register(ViPipe, 0xD3, 0x10);
sensor_write_register(ViPipe, 0xD4, 0x06);
sensor_write_register(ViPipe, 0xD5, 0xBE);
sensor_write_register(ViPipe, 0xD6, 0x39);
sensor_write_register(ViPipe, 0xD7, 0x27);
sensor_write_register(ViPipe, 0xD8, 0x00);
sensor_write_register(ViPipe, 0xD9, 0x00);
sensor_write_register(ViPipe, 0xDA, 0x00);
sensor_write_register(ViPipe, 0xDB, 0x00);
sensor_write_register(ViPipe, 0xDC, 0x00);
sensor_write_register(ViPipe, 0xDD, 0x00);
sensor_write_register(ViPipe, 0xDE, 0x00);
sensor_write_register(ViPipe, 0xDF, 0x00);
sensor_write_register(ViPipe, 0xE0, 0x00);
sensor_write_register(ViPipe, 0xE1, 0x00);
sensor_write_register(ViPipe, 0xE2, 0x00);
sensor_write_register(ViPipe, 0xE3, 0x00);
sensor_write_register(ViPipe, 0xE4, 0x00);
sensor_write_register(ViPipe, 0xE5, 0x00);
sensor_write_register(ViPipe, 0xE6, 0x00);
sensor_write_register(ViPipe, 0xE7, 0x13);
sensor_write_register(ViPipe, 0xE8, 0x03);
sensor_write_register(ViPipe, 0xE9, 0x00);
sensor_write_register(ViPipe, 0xEA, 0x00);
sensor_write_register(ViPipe, 0xEB, 0x00);
sensor_write_register(ViPipe, 0xEC, 0x00);
sensor_write_register(ViPipe, 0xED, 0x00);
sensor_write_register(ViPipe, 0xEE, 0x00);
sensor_write_register(ViPipe, 0xEF, 0x00);
sensor_write_register(ViPipe, 0xF0, 0x00);
sensor_write_register(ViPipe, 0xF1, 0x00);
sensor_write_register(ViPipe, 0xF2, 0x00);
sensor_write_register(ViPipe, 0xF3, 0x00);
sensor_write_register(ViPipe, 0xF4, 0x20);
sensor_write_register(ViPipe, 0xF5, 0x10);
sensor_write_register(ViPipe, 0xF6, 0x00);
sensor_write_register(ViPipe, 0xF7, 0x00);
sensor_write_register(ViPipe, 0xF8, 0x00);
sensor_write_register(ViPipe, 0xF9, 0x00);
sensor_write_register(ViPipe, 0xFA, 0x0b);
sensor_write_register(ViPipe, 0xFB, 0x00);
sensor_write_register(ViPipe, 0xFC, 0x00);

sensor_write_register(ViPipe, 0x40, 0x08);
sensor_write_register(ViPipe, 0x00, 0x00);
sensor_write_register(ViPipe, 0x01, 0xf8);
sensor_write_register(ViPipe, 0x02, 0x01);
sensor_write_register(ViPipe, 0x08, 0xf0);
sensor_write_register(ViPipe, 0x13, 0x24);
sensor_write_register(ViPipe, 0x14, 0x73);
sensor_write_register(ViPipe, 0x15, 0x08);
sensor_write_register(ViPipe, 0x20, 0x12);
sensor_write_register(ViPipe, 0x34, 0x1b);
sensor_write_register(ViPipe, 0x23, 0x02);
sensor_write_register(ViPipe, 0x23, 0x00);

sensor_write_register(ViPipe, 0x40, 0x00);


printf("================================================================\n");
printf("==== Techpoint TP9950 960H25fps(BT656) init success! ===========\n");
printf("================================================================\n");
return;
}

void tp9950_720p30_init(VI_PIPE ViPipe) {
sensor_write_register(ViPipe, 0x0, 0x11);
sensor_write_register(ViPipe, 0x1, 0x7a);
Expand Down
17 changes: 17 additions & 0 deletions libraries/sensor/hi3516ev200/galaxycore_gc5603/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
LIB_NAME := libsns_gc5603

override CFLAGS += -DSDK_CODE=$(SDK_CODE) -fPIC -I$(CURDIR)/../../../../include

SRCS := $(wildcard *.c)
OBJS := $(SRCS:%.c=%.o) $(ASM_SRCS:%.S=%.o)

all: $(LIB_NAME).so $(LIB_NAME).a

$(LIB_NAME).so: $(OBJS)
$(CC) -shared -o $@ $(OBJS)

$(LIB_NAME).a: $(OBJS)
$(AR) -rcs $(LIB_NAME).a $(OBJS)

clean:
-rm $(OBJS) $(LIB_NAME).so
Loading

0 comments on commit e756fa4

Please sign in to comment.