GK SDK 源码库: XMIPCLinuxV100R005C00SPC030 (kernel/tools/open_source excluded)
This commit is contained in:
+5
@@ -0,0 +1,5 @@
|
||||
ifneq ($(MCU), )
|
||||
include Makefile.riscv
|
||||
else
|
||||
include Makefile.linux
|
||||
endif
|
||||
@@ -0,0 +1,20 @@
|
||||
ISP_DIR := $(shell cd ../.. && /bin/pwd)
|
||||
SDK_DIR ?= $(shell cd $(ISP_DIR)/../../../.. && /bin/pwd)
|
||||
|
||||
include $(SDK_DIR)/build/base.mk
|
||||
include $(ISP_DIR)/sensor/plat.mk
|
||||
|
||||
LIB_NAME := libsns_sc8238
|
||||
|
||||
SRCS := $(wildcard *.c)
|
||||
|
||||
SDK_USR_CFLAGS += -I$(GMP_DIR)/include
|
||||
SDK_USR_CFLAGS += -I$(GMP_DIR)/usr/include
|
||||
SDK_USR_CFLAGS += -I$(ISP_DIR)/include
|
||||
SDK_USR_CFLAGS += -I$(ISP_DIR)/../include
|
||||
SDK_USR_CFLAGS += -I.
|
||||
AT := @
|
||||
|
||||
$(info SRCS=$(SRCS))
|
||||
|
||||
include $(SDK_DIR)/build/sdk_lib_rules.mk
|
||||
@@ -0,0 +1,4 @@
|
||||
|
||||
SRCS-y += sc8238.c
|
||||
SRCS-y += sc8238_ctrl.c
|
||||
|
||||
+1942
File diff suppressed because it is too large
Load Diff
+99
@@ -0,0 +1,99 @@
|
||||
#ifndef __SC8238_H__
|
||||
#define __SC8238_H__
|
||||
|
||||
#include "sns_comm.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#ifdef FPGA
|
||||
#define SC8238_VMAX_8M_LINEAR 0x8CA
|
||||
#define SC8238_VMAX_4M_LINEAR 0x8CA
|
||||
#define SC8238_VMAX_1M_LINEAR 0x2EE
|
||||
#define SC8238_VMAX_5M_1728P_LINEAR 0x0 // not supprot
|
||||
#define SC8238_VMAX_5M_LINEAR SC8238_VMAX_8M_LINEAR // crop from 8M
|
||||
#define SC8238_VMAX_3M_LINEAR SC8238_VMAX_8M_LINEAR
|
||||
#define SC8238_VMAX_2M_LINEAR SC8238_VMAX_8M_LINEAR
|
||||
#define SC8238_VMAX_8M_WDR 0x1194
|
||||
#define SC8238_VMAX_1M_WDR 0x5DC
|
||||
#define SC8238_VMAX_5M_WDR SC8238_VMAX_8M_WDR // crop from 8M
|
||||
#define SC8238_VMAX_4M_WDR SC8238_VMAX_8M_WDR
|
||||
#define SC8238_VMAX_3M_WDR SC8238_VMAX_8M_WDR
|
||||
#define SC8238_VMAX_2M_WDR SC8238_VMAX_8M_WDR
|
||||
|
||||
#define SC8238_S_EXP_MAX_DEFAULT_2160P 0x005E
|
||||
#define SC8238_S_EXP_MAX_DEFAULT_720P 0x0388
|
||||
#else
|
||||
#define SC8238_VMAX_8M_LINEAR 0x8CA
|
||||
#define SC8238_VMAX_5M_1728P_LINEAR 0x7D0
|
||||
#define SC8238_VMAX_5M_LINEAR SC8238_VMAX_8M_LINEAR // crop from 8M
|
||||
#define SC8238_VMAX_4M_LINEAR SC8238_VMAX_8M_LINEAR
|
||||
#define SC8238_VMAX_3M_LINEAR SC8238_VMAX_8M_LINEAR
|
||||
#define SC8238_VMAX_2M_LINEAR SC8238_VMAX_8M_LINEAR
|
||||
#define SC8238_VMAX_1M_LINEAR SC8238_VMAX_8M_LINEAR
|
||||
#define SC8238_VMAX_8M_WDR 0x1194
|
||||
#define SC8238_VMAX_5M_WDR SC8238_VMAX_8M_WDR // crop from 8M
|
||||
#define SC8238_VMAX_4M_WDR SC8238_VMAX_8M_WDR
|
||||
#define SC8238_VMAX_3M_WDR SC8238_VMAX_8M_WDR
|
||||
#define SC8238_VMAX_2M_WDR SC8238_VMAX_8M_WDR
|
||||
#define SC8238_VMAX_1M_WDR SC8238_VMAX_8M_WDR
|
||||
|
||||
#define SC8238_S_EXP_MAX_DEFAULT_2160P 0x010E
|
||||
#define SC8238_S_EXP_MAX_DEFAULT_720P SC8238_S_EXP_MAX_DEFAULT_2160P // crop from 8M
|
||||
#endif
|
||||
|
||||
// the value of the sc8238 exposure register is in half line units, (<< 1) for AE calculation, (>> 1) for EXP reg
|
||||
#define SC8238_EXP_SHIFT 1
|
||||
#define SC8238_EXP_OFFSET_LINEAR 10
|
||||
#define SC8238_EXP_OFFSET_WDR 18
|
||||
|
||||
#define SC8238_REG_ADDR_EXP_H 0x3e00
|
||||
#define SC8238_REG_ADDR_EXP_M 0x3e01
|
||||
#define SC8238_REG_ADDR_EXP_L 0x3e02
|
||||
#define SC8238_REG_ADDR_S_EXP_H 0x3e04
|
||||
#define SC8238_REG_ADDR_S_EXP_L 0x3e05
|
||||
#define SC8238_REG_ADDR_S_EXP_MAX_H 0x3e23
|
||||
#define SC8238_REG_ADDR_S_EXP_MAX_L 0x3e24
|
||||
#define SC8238_REG_ADDR_AGAIN_H 0x3e08
|
||||
#define SC8238_REG_ADDR_AGAIN_L 0x3e09
|
||||
#define SC8238_REG_ADDR_S_AGAIN_H 0x3e12
|
||||
#define SC8238_REG_ADDR_S_AGAIN_L 0x3e13
|
||||
#define SC8238_REG_ADDR_DGAIN_H 0x3e06
|
||||
#define SC8238_REG_ADDR_DGAIN_L 0x3e07
|
||||
#define SC8238_REG_ADDR_S_DGAIN_H 0x3e10
|
||||
#define SC8238_REG_ADDR_S_DGAIN_L 0x3e11
|
||||
#define SC8238_REG_ADDR_VMAX_H 0x320e
|
||||
#define SC8238_REG_ADDR_VMAX_L 0x320f
|
||||
|
||||
typedef enum {
|
||||
SC8238_REG_EXP_H = 0,
|
||||
SC8238_REG_EXP_M,
|
||||
SC8238_REG_EXP_L,
|
||||
SC8238_REG_DGC_H,
|
||||
SC8238_REG_DGC_L,
|
||||
SC8238_REG_AGC_H,
|
||||
SC8238_REG_AGC_L,
|
||||
SC8238_REG_VMAX_H,
|
||||
SC8238_REG_VMAX_L,
|
||||
SC8238_REG_L_MAX_NUM,
|
||||
|
||||
// short frame reg info from here
|
||||
SC8238_REG_S_EXP_H = SC8238_REG_L_MAX_NUM,
|
||||
SC8238_REG_S_EXP_L,
|
||||
SC8238_REG_S_DGAIN_H,
|
||||
SC8238_REG_S_DGAIN_L,
|
||||
SC8238_REG_S_AGAIN_H,
|
||||
SC8238_REG_S_AGAIN_L,
|
||||
SC8238_REG_S_EXP_MAX_H,
|
||||
SC8238_REG_S_EXP_MAX_L,
|
||||
SC8238_REG_MAX_NUM
|
||||
} sc8238_reg_info;
|
||||
|
||||
#define SC8238_FULL_LINES_MAX 0xFFFF
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // __SC8238_H__
|
||||
+2886
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,44 @@
|
||||
#ifndef __SC8238_CTRL_H__
|
||||
#define __SC8238_CTRL_H__
|
||||
|
||||
#include "sns_comm.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define SC8238_I2C_ADDR 0x60
|
||||
#define SC8238_ADDR_BYTE 2
|
||||
#define SC8238_DATA_BYTE 1
|
||||
|
||||
// sc8238 specs list
|
||||
typedef enum {
|
||||
SC8238_8M_10BIT_LINEAR_MODE = 1,
|
||||
SC8238_5M_10BIT_LINEAR_MODE,
|
||||
SC8238_4M_10BIT_LINEAR_MODE,
|
||||
SC8238_3M_10BIT_LINEAR_MODE,
|
||||
SC8238_2M_10BIT_LINEAR_MODE,
|
||||
SC8238_1M_10BIT_LINEAR_MODE,
|
||||
SC8238_5M_10BIT_1728P_LINEAR_MODE,
|
||||
|
||||
SC8238_8M_10BIT_WDR_MODE,
|
||||
SC8238_5M_10BIT_WDR_MODE,
|
||||
SC8238_4M_10BIT_WDR_MODE,
|
||||
SC8238_3M_10BIT_WDR_MODE,
|
||||
SC8238_2M_10BIT_WDR_MODE,
|
||||
SC8238_1M_10BIT_WDR_MODE,
|
||||
} sc8238_specs;
|
||||
|
||||
xmedia_s32 sc8238_i2c_init(xmedia_u32 dev, xmedia_s8 i2c_dev, xmedia_u32 i2c_addr);
|
||||
xmedia_s32 sc8238_i2c_exit(xmedia_u32 dev);
|
||||
xmedia_s32 sc8238_read_reg(xmedia_u32 dev, xmedia_u32 addr, xmedia_u32 *data);
|
||||
xmedia_s32 sc8238_write_reg(xmedia_u32 dev, xmedia_u32 addr, xmedia_u32 data);
|
||||
xmedia_s32 sc8238_set_mirror_flip(xmedia_u32 dev, xmedia_bool mirror_en, xmedia_bool flip_en);
|
||||
xmedia_s32 sc8238_init_image(xmedia_u32 dev, xmedia_u8 img_mode);
|
||||
xmedia_s32 sc8238_set_slave_addr(xmedia_u32 dev, xmedia_u32 slave_addr);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif //__SC8238_CTRL_H__
|
||||
+181
@@ -0,0 +1,181 @@
|
||||
#ifndef __SC8238_EX_H__
|
||||
#define __SC8238_EX_H__
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
// Piris attr
|
||||
static const xmedia_isp_piris_attr g_sc8238_piris_attr = {
|
||||
0,
|
||||
1,
|
||||
94,
|
||||
62,
|
||||
// Step-F number mapping table. Must be from small to large. F1.0 is 1024 and F32.0 is 1
|
||||
{30, 35, 40, 45, 50, 56, 61, 67, 73, 79, 85, 92, 98, 105, 112, 120, 127, 135, 143, 150, 158,
|
||||
166, 174, 183, 191, 200, 208, 217, 225, 234, 243, 252, 261, 270, 279, 289, 298, 307, 316, 325, 335, 344,
|
||||
353, 362, 372, 381, 390, 399, 408, 417, 426, 435, 444, 453, 462, 470, 478, 486, 493, 500, 506, 512},
|
||||
XMEDIA_ISP_IRIS_F_NO_1_4,
|
||||
XMEDIA_ISP_IRIS_F_NO_5_6
|
||||
};
|
||||
|
||||
static const xmedia_isp_awb_ccm g_sc8238_awb_ccm = {
|
||||
4,
|
||||
{
|
||||
{
|
||||
6240,
|
||||
{
|
||||
0x023B, 0x8121, 0x801A,
|
||||
0x8062, 0x0230, 0x80CE,
|
||||
0x8001, 0x8106, 0x0207
|
||||
},
|
||||
},
|
||||
|
||||
{
|
||||
4950,
|
||||
{
|
||||
656, 33122, 32814,
|
||||
32887, 551, 32944,
|
||||
5, 33119, 602
|
||||
},
|
||||
},
|
||||
|
||||
{
|
||||
3930,
|
||||
{
|
||||
0x02AC, 0x816B, 0x8041,
|
||||
0x807C, 0x0209, 0x808D,
|
||||
0x000F, 0x8176, 0x0267
|
||||
},
|
||||
},
|
||||
|
||||
{
|
||||
2810,
|
||||
{
|
||||
0x022E, 0x8143, 0x0015,
|
||||
0x807D, 0x01D8, 0x805B,
|
||||
0x0019, 0x82D2, 0x03B9
|
||||
},
|
||||
},
|
||||
|
||||
{
|
||||
1600,
|
||||
{
|
||||
0x0100, 0x0000, 0x0000,
|
||||
0x0000, 0x0100, 0x0000,
|
||||
0x0000, 0x0000, 0x0100
|
||||
},
|
||||
},
|
||||
|
||||
{
|
||||
1400,
|
||||
{
|
||||
0x0100, 0x0000, 0x0000,
|
||||
0x0000, 0x0100, 0x0000,
|
||||
0x0000, 0x0000, 0x0100
|
||||
},
|
||||
},
|
||||
|
||||
{
|
||||
1000,
|
||||
{
|
||||
0x0100, 0x0000, 0x0000,
|
||||
0x0000, 0x0100, 0x0000,
|
||||
0x0000, 0x0000, 0x0100
|
||||
},
|
||||
},
|
||||
|
||||
},
|
||||
};
|
||||
|
||||
static const xmedia_isp_awb_agc_table g_sc8238_awb_agc_table = {
|
||||
// bvalid
|
||||
1,
|
||||
|
||||
// saturation
|
||||
// 1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192, 16384, 32768
|
||||
{ 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60 }
|
||||
};
|
||||
|
||||
static const xmedia_isp_awb_ccm g_sc8238_awb_wdr_ccm = {
|
||||
3,
|
||||
{
|
||||
{
|
||||
6240,
|
||||
{
|
||||
0x01C8, 0x80B6, 0x8012,
|
||||
0x8032, 0x0184, 0x8052,
|
||||
0x8003, 0x809B, 0x019E
|
||||
},
|
||||
},
|
||||
|
||||
{
|
||||
3930,
|
||||
{
|
||||
0x0229, 0x80F2, 0x8037,
|
||||
0x8049, 0x0186, 0x803D,
|
||||
0x0002, 0x80C2, 0x01C0
|
||||
},
|
||||
},
|
||||
|
||||
{
|
||||
2810,
|
||||
{
|
||||
0x01CB, 0x80B0, 0x801B,
|
||||
0x8048, 0x0189, 0x8041,
|
||||
0x0004, 0x8144, 0x0240
|
||||
},
|
||||
},
|
||||
|
||||
{
|
||||
2100,
|
||||
{
|
||||
0x0100, 0x0000, 0x0000,
|
||||
0x0000, 0x0100, 0x0000,
|
||||
0x0000, 0x0000, 0x0100
|
||||
},
|
||||
},
|
||||
|
||||
{
|
||||
1600,
|
||||
{
|
||||
0x0100, 0x0000, 0x0000,
|
||||
0x0000, 0x0100, 0x0000,
|
||||
0x0000, 0x0000, 0x0100
|
||||
},
|
||||
},
|
||||
|
||||
{
|
||||
1400,
|
||||
{
|
||||
0x0100, 0x0000, 0x0000,
|
||||
0x0000, 0x0100, 0x0000,
|
||||
0x0000, 0x0000, 0x0100
|
||||
},
|
||||
},
|
||||
|
||||
{
|
||||
1000,
|
||||
{
|
||||
0x0100, 0x0000, 0x0000,
|
||||
0x0000, 0x0100, 0x0000,
|
||||
0x0000, 0x0000, 0x0100
|
||||
},
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
static const xmedia_isp_awb_agc_table g_sc8238_awb_wdr_agc_table = {
|
||||
// bvalid
|
||||
1,
|
||||
|
||||
// saturation
|
||||
//{ 90, 90, 85, 75, 70, 65, 65, 65, 60, 60, 60, 60, 60, 60, 60, 60 }
|
||||
{ 75, 75, 70, 70, 70, 65, 65, 65, 60, 60, 60, 60, 60, 60, 60, 60 }
|
||||
};
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user