├── .gitignore ├── .vscode └── c_cpp_properties.json ├── bin ├── libVoiceEngine.so ├── lib_hiae.so ├── lib_hiawb.so ├── lib_hiawb_natura.so ├── lib_hidehaze.so ├── lib_hidrc.so ├── lib_hiir_auto.so ├── lib_hildci.so ├── libaaccomm.so ├── libaacdec.so ├── libaacenc.so ├── libaacsbrdec.so ├── libaacsbrenc.so ├── libbcd.so ├── libdnvqe.so ├── libhi_cipher.so ├── libhive_AEC.so ├── libhive_AGC.so ├── libhive_ANR.so ├── libhive_EQ.so ├── libhive_HPF.so ├── libhive_RES.so ├── libhive_common.so ├── libhive_record.so ├── libisp.so ├── libive.so ├── libivp.so ├── libmd.so ├── libmpi.so ├── libsecurec.so ├── libsns_gc2053.so ├── libsns_gc2053_forcar.so ├── libsns_imx307.so ├── libsns_imx307_2l.so ├── libsns_imx327.so ├── libsns_imx327_2l.so ├── libsns_imx335.so ├── libsns_os05a.so ├── libsns_sc2231.so ├── libsns_sc2235.so ├── libsns_sc3235.so ├── libsns_sc4236.so ├── libtde.so ├── libupvqe.so ├── mpp_test ├── play_mipi_camera └── test ├── code ├── include │ └── hisi │ │ ├── aacdec.h │ │ ├── aacenc.h │ │ ├── acodec.h │ │ ├── autoconf.h │ │ ├── hi_adc.h │ │ ├── hi_ae_comm.h │ │ ├── hi_af_comm.h │ │ ├── hi_audio_bcd.h │ │ ├── hi_awb_comm.h │ │ ├── hi_buffer.h │ │ ├── hi_comm_3a.h │ │ ├── hi_comm_adec.h │ │ ├── hi_comm_aenc.h │ │ ├── hi_comm_ai.h │ │ ├── hi_comm_aio.h │ │ ├── hi_comm_ao.h │ │ ├── hi_comm_dis.h │ │ ├── hi_comm_gdc.h │ │ ├── hi_comm_isp.h │ │ ├── hi_comm_ive.h │ │ ├── hi_comm_rc.h │ │ ├── hi_comm_region.h │ │ ├── hi_comm_snap.h │ │ ├── hi_comm_sns.h │ │ ├── hi_comm_sys.h │ │ ├── hi_comm_vb.h │ │ ├── hi_comm_venc.h │ │ ├── hi_comm_vgs.h │ │ ├── hi_comm_vi.h │ │ ├── hi_comm_video.h │ │ ├── hi_comm_vo.h │ │ ├── hi_comm_vpss.h │ │ ├── hi_common.h │ │ ├── hi_common_cipher.h │ │ ├── hi_debug.h │ │ ├── hi_defines.h │ │ ├── hi_errno.h │ │ ├── hi_i2c.h │ │ ├── hi_isp_bin.h │ │ ├── hi_isp_debug.h │ │ ├── hi_isp_defines.h │ │ ├── hi_ive.h │ │ ├── hi_ivp.h │ │ ├── hi_math.h │ │ ├── hi_md.h │ │ ├── hi_mipi.h │ │ ├── hi_resampler_api.h │ │ ├── hi_securec.h │ │ ├── hi_sns_ctrl.h │ │ ├── hi_spi.h │ │ ├── hi_ssp.h │ │ ├── hi_tde_api.h │ │ ├── hi_tde_errcode.h │ │ ├── hi_tde_type.h │ │ ├── hi_type.h │ │ ├── hi_types.h │ │ ├── hi_unf_cipher.h │ │ ├── hi_vqe_register_api.h │ │ ├── hifb.h │ │ ├── ivs_md.h │ │ ├── list.h │ │ ├── mpi_ae.h │ │ ├── mpi_audio.h │ │ ├── mpi_awb.h │ │ ├── mpi_isp.h │ │ ├── mpi_ive.h │ │ ├── mpi_region.h │ │ ├── mpi_snap.h │ │ ├── mpi_sys.h │ │ ├── mpi_vb.h │ │ ├── mpi_venc.h │ │ ├── mpi_vgs.h │ │ ├── mpi_vi.h │ │ ├── mpi_vo.h │ │ ├── mpi_vpss.h │ │ ├── securec.h │ │ ├── securectype.h │ │ ├── vou_exp.h │ │ └── watchdog.h └── src │ ├── CMakeLists.txt │ ├── PlayMipiCamera │ ├── CMakeLists.txt │ ├── main.cpp │ ├── play_mipi_camera.cpp │ └── play_mipi_camera.h │ ├── common │ ├── UdpClient.cpp │ ├── UdpClient.h │ ├── push_stream.cpp │ └── push_stream.h │ ├── hisi_common │ ├── loadbmp.c │ ├── loadbmp.h │ ├── sample_comm.h │ ├── sample_comm_isp.c │ ├── sample_comm_region.c │ ├── sample_comm_sys.c │ ├── sample_comm_venc.c │ ├── sample_comm_vi.c │ ├── sample_comm_vo.c │ └── sample_comm_vpss.c │ └── test │ ├── CMakeLists.txt │ └── main.cpp └── doc ├── markdown学习.md ├── 概念.md ├── 海思mpp学习(1):基础环境搭建.md ├── 海思mpp学习(2):MMZ内存.md ├── 海思mpp学习(3):视频缓存池-vb.md ├── 海思mpp学习(4):mpp各模块介绍.md ├── 海思mpp学习(5):通过mipi接入视频并编码成H264.md └── 疑问.md /.gitignore: -------------------------------------------------------------------------------- 1 | build/ev300/** 2 | -------------------------------------------------------------------------------- /.vscode/c_cpp_properties.json: -------------------------------------------------------------------------------- 1 | { 2 | "configurations": [ 3 | { 4 | "name": "Linux", 5 | "includePath": [ 6 | "${workspaceFolder}/**" 7 | ], 8 | "defines": [], 9 | "compilerPath": "/usr/bin/g++", 10 | "cStandard": "c11", 11 | "cppStandard": "c++14", 12 | "intelliSenseMode": "gcc-arm64" 13 | } 14 | ], 15 | "version": 4 16 | } -------------------------------------------------------------------------------- /bin/libVoiceEngine.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/key1024/mpp_test/7e403155e2e0dcf7957d7fe0112fac76a76654f4/bin/libVoiceEngine.so -------------------------------------------------------------------------------- /bin/lib_hiae.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/key1024/mpp_test/7e403155e2e0dcf7957d7fe0112fac76a76654f4/bin/lib_hiae.so -------------------------------------------------------------------------------- /bin/lib_hiawb.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/key1024/mpp_test/7e403155e2e0dcf7957d7fe0112fac76a76654f4/bin/lib_hiawb.so -------------------------------------------------------------------------------- /bin/lib_hiawb_natura.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/key1024/mpp_test/7e403155e2e0dcf7957d7fe0112fac76a76654f4/bin/lib_hiawb_natura.so -------------------------------------------------------------------------------- /bin/lib_hidehaze.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/key1024/mpp_test/7e403155e2e0dcf7957d7fe0112fac76a76654f4/bin/lib_hidehaze.so -------------------------------------------------------------------------------- /bin/lib_hidrc.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/key1024/mpp_test/7e403155e2e0dcf7957d7fe0112fac76a76654f4/bin/lib_hidrc.so -------------------------------------------------------------------------------- /bin/lib_hiir_auto.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/key1024/mpp_test/7e403155e2e0dcf7957d7fe0112fac76a76654f4/bin/lib_hiir_auto.so -------------------------------------------------------------------------------- /bin/lib_hildci.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/key1024/mpp_test/7e403155e2e0dcf7957d7fe0112fac76a76654f4/bin/lib_hildci.so -------------------------------------------------------------------------------- /bin/libaaccomm.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/key1024/mpp_test/7e403155e2e0dcf7957d7fe0112fac76a76654f4/bin/libaaccomm.so -------------------------------------------------------------------------------- /bin/libaacdec.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/key1024/mpp_test/7e403155e2e0dcf7957d7fe0112fac76a76654f4/bin/libaacdec.so -------------------------------------------------------------------------------- /bin/libaacenc.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/key1024/mpp_test/7e403155e2e0dcf7957d7fe0112fac76a76654f4/bin/libaacenc.so -------------------------------------------------------------------------------- /bin/libaacsbrdec.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/key1024/mpp_test/7e403155e2e0dcf7957d7fe0112fac76a76654f4/bin/libaacsbrdec.so -------------------------------------------------------------------------------- /bin/libaacsbrenc.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/key1024/mpp_test/7e403155e2e0dcf7957d7fe0112fac76a76654f4/bin/libaacsbrenc.so -------------------------------------------------------------------------------- /bin/libbcd.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/key1024/mpp_test/7e403155e2e0dcf7957d7fe0112fac76a76654f4/bin/libbcd.so -------------------------------------------------------------------------------- /bin/libdnvqe.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/key1024/mpp_test/7e403155e2e0dcf7957d7fe0112fac76a76654f4/bin/libdnvqe.so -------------------------------------------------------------------------------- /bin/libhi_cipher.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/key1024/mpp_test/7e403155e2e0dcf7957d7fe0112fac76a76654f4/bin/libhi_cipher.so -------------------------------------------------------------------------------- /bin/libhive_AEC.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/key1024/mpp_test/7e403155e2e0dcf7957d7fe0112fac76a76654f4/bin/libhive_AEC.so -------------------------------------------------------------------------------- /bin/libhive_AGC.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/key1024/mpp_test/7e403155e2e0dcf7957d7fe0112fac76a76654f4/bin/libhive_AGC.so -------------------------------------------------------------------------------- /bin/libhive_ANR.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/key1024/mpp_test/7e403155e2e0dcf7957d7fe0112fac76a76654f4/bin/libhive_ANR.so -------------------------------------------------------------------------------- /bin/libhive_EQ.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/key1024/mpp_test/7e403155e2e0dcf7957d7fe0112fac76a76654f4/bin/libhive_EQ.so -------------------------------------------------------------------------------- /bin/libhive_HPF.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/key1024/mpp_test/7e403155e2e0dcf7957d7fe0112fac76a76654f4/bin/libhive_HPF.so -------------------------------------------------------------------------------- /bin/libhive_RES.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/key1024/mpp_test/7e403155e2e0dcf7957d7fe0112fac76a76654f4/bin/libhive_RES.so -------------------------------------------------------------------------------- /bin/libhive_common.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/key1024/mpp_test/7e403155e2e0dcf7957d7fe0112fac76a76654f4/bin/libhive_common.so -------------------------------------------------------------------------------- /bin/libhive_record.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/key1024/mpp_test/7e403155e2e0dcf7957d7fe0112fac76a76654f4/bin/libhive_record.so -------------------------------------------------------------------------------- /bin/libisp.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/key1024/mpp_test/7e403155e2e0dcf7957d7fe0112fac76a76654f4/bin/libisp.so -------------------------------------------------------------------------------- /bin/libive.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/key1024/mpp_test/7e403155e2e0dcf7957d7fe0112fac76a76654f4/bin/libive.so -------------------------------------------------------------------------------- /bin/libivp.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/key1024/mpp_test/7e403155e2e0dcf7957d7fe0112fac76a76654f4/bin/libivp.so -------------------------------------------------------------------------------- /bin/libmd.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/key1024/mpp_test/7e403155e2e0dcf7957d7fe0112fac76a76654f4/bin/libmd.so -------------------------------------------------------------------------------- /bin/libmpi.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/key1024/mpp_test/7e403155e2e0dcf7957d7fe0112fac76a76654f4/bin/libmpi.so -------------------------------------------------------------------------------- /bin/libsecurec.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/key1024/mpp_test/7e403155e2e0dcf7957d7fe0112fac76a76654f4/bin/libsecurec.so -------------------------------------------------------------------------------- /bin/libsns_gc2053.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/key1024/mpp_test/7e403155e2e0dcf7957d7fe0112fac76a76654f4/bin/libsns_gc2053.so -------------------------------------------------------------------------------- /bin/libsns_gc2053_forcar.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/key1024/mpp_test/7e403155e2e0dcf7957d7fe0112fac76a76654f4/bin/libsns_gc2053_forcar.so -------------------------------------------------------------------------------- /bin/libsns_imx307.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/key1024/mpp_test/7e403155e2e0dcf7957d7fe0112fac76a76654f4/bin/libsns_imx307.so -------------------------------------------------------------------------------- /bin/libsns_imx307_2l.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/key1024/mpp_test/7e403155e2e0dcf7957d7fe0112fac76a76654f4/bin/libsns_imx307_2l.so -------------------------------------------------------------------------------- /bin/libsns_imx327.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/key1024/mpp_test/7e403155e2e0dcf7957d7fe0112fac76a76654f4/bin/libsns_imx327.so -------------------------------------------------------------------------------- /bin/libsns_imx327_2l.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/key1024/mpp_test/7e403155e2e0dcf7957d7fe0112fac76a76654f4/bin/libsns_imx327_2l.so -------------------------------------------------------------------------------- /bin/libsns_imx335.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/key1024/mpp_test/7e403155e2e0dcf7957d7fe0112fac76a76654f4/bin/libsns_imx335.so -------------------------------------------------------------------------------- /bin/libsns_os05a.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/key1024/mpp_test/7e403155e2e0dcf7957d7fe0112fac76a76654f4/bin/libsns_os05a.so -------------------------------------------------------------------------------- /bin/libsns_sc2231.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/key1024/mpp_test/7e403155e2e0dcf7957d7fe0112fac76a76654f4/bin/libsns_sc2231.so -------------------------------------------------------------------------------- /bin/libsns_sc2235.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/key1024/mpp_test/7e403155e2e0dcf7957d7fe0112fac76a76654f4/bin/libsns_sc2235.so -------------------------------------------------------------------------------- /bin/libsns_sc3235.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/key1024/mpp_test/7e403155e2e0dcf7957d7fe0112fac76a76654f4/bin/libsns_sc3235.so -------------------------------------------------------------------------------- /bin/libsns_sc4236.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/key1024/mpp_test/7e403155e2e0dcf7957d7fe0112fac76a76654f4/bin/libsns_sc4236.so -------------------------------------------------------------------------------- /bin/libtde.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/key1024/mpp_test/7e403155e2e0dcf7957d7fe0112fac76a76654f4/bin/libtde.so -------------------------------------------------------------------------------- /bin/libupvqe.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/key1024/mpp_test/7e403155e2e0dcf7957d7fe0112fac76a76654f4/bin/libupvqe.so -------------------------------------------------------------------------------- /bin/mpp_test: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/key1024/mpp_test/7e403155e2e0dcf7957d7fe0112fac76a76654f4/bin/mpp_test -------------------------------------------------------------------------------- /bin/play_mipi_camera: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/key1024/mpp_test/7e403155e2e0dcf7957d7fe0112fac76a76654f4/bin/play_mipi_camera -------------------------------------------------------------------------------- /bin/test: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/key1024/mpp_test/7e403155e2e0dcf7957d7fe0112fac76a76654f4/bin/test -------------------------------------------------------------------------------- /code/include/hisi/aacenc.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | * Copyright 2004 - 2018, Hisilicon Tech. Co., Ltd. 3 | * ALL RIGHTS RESERVED 4 | * FileName: hi_spdif.h 5 | * Description: 6 | * 7 | * History: 8 | * Version Date Author DefectNum Description 9 | * 0.01 2006-11-01 z40717 NULL Create this file. 10 | * 11 | *****************************************************************************/ 12 | /** 13 | * \file 14 | * \brief Describes the information about AACENC. 15 | */ 16 | 17 | #ifndef _AACENC_H 18 | #define _AACENC_H 19 | 20 | #ifdef __cplusplus 21 | #if __cplusplus 22 | extern "C" { 23 | #endif /* __cpluscplus */ 24 | #endif /* __cpluscplus */ 25 | 26 | #include "hi_type.h" 27 | 28 | /********************************Macro Definition********************************/ 29 | /** \addtogroup AACENC */ 30 | /** @{ */ /** <--7bits----><----8bits---><--3bits---><------13bits------->| 49 | ******************************************************************************/ 50 | 51 | #define HI_DEF_ERR( module, level, errid) \ 52 | ((HI_S32)( (HI_ERR_APPID) | ((module) << 16 ) | ((level)<<13) | (errid) )) 53 | 54 | /* NOTE! the following defined all common error code, 55 | ** all module must reserved 0~63 for their common error code 56 | */ 57 | typedef enum hiEN_ERR_CODE_E 58 | { 59 | EN_ERR_INVALID_DEVID = 1, /* invlalid device ID */ 60 | EN_ERR_INVALID_CHNID = 2, /* invlalid channel ID */ 61 | EN_ERR_ILLEGAL_PARAM = 3, /* at lease one parameter is illagal 62 | * eg, an illegal enumeration value */ 63 | EN_ERR_EXIST = 4, /* resource exists */ 64 | EN_ERR_UNEXIST = 5, /* resource unexists */ 65 | 66 | EN_ERR_NULL_PTR = 6, /* using a NULL point */ 67 | 68 | EN_ERR_NOT_CONFIG = 7, /* try to enable or initialize system, device 69 | ** or channel, before configing attribute */ 70 | 71 | EN_ERR_NOT_SUPPORT = 8, /* operation or type is not supported by NOW */ 72 | EN_ERR_NOT_PERM = 9, /* operation is not permitted 73 | ** eg, try to change static attribute */ 74 | EN_ERR_INVALID_PIPEID = 10, /* invlalid pipe ID */ 75 | EN_ERR_INVALID_STITCHGRPID = 11, /* invlalid stitch group ID */ 76 | 77 | EN_ERR_NOMEM = 12,/* failure caused by malloc memory */ 78 | EN_ERR_NOBUF = 13,/* failure caused by malloc buffer */ 79 | 80 | EN_ERR_BUF_EMPTY = 14,/* no data in buffer */ 81 | EN_ERR_BUF_FULL = 15,/* no buffer for new data */ 82 | 83 | EN_ERR_SYS_NOTREADY = 16,/* System is not ready,maybe not initialed or 84 | ** loaded. Returning the error code when opening 85 | ** a device file failed. */ 86 | 87 | EN_ERR_BADADDR = 17,/* bad address, 88 | ** eg. used for copy_from_user & copy_to_user */ 89 | 90 | EN_ERR_BUSY = 18,/* resource is busy, 91 | ** eg. destroy a venc chn without unregister it */ 92 | EN_ERR_SIZE_NOT_ENOUGH = 19, /* buffer size is smaller than the actual size required */ 93 | 94 | EN_ERR_BUTT = 63,/* maxium code, private error code of all modules 95 | ** must be greater than it */ 96 | }EN_ERR_CODE_E; 97 | 98 | 99 | 100 | #ifdef __cplusplus 101 | #if __cplusplus 102 | } 103 | #endif 104 | #endif /* __cplusplus */ 105 | 106 | #endif /* __HI_ERRNO_H__ */ 107 | 108 | -------------------------------------------------------------------------------- /code/include/hisi/hi_i2c.h: -------------------------------------------------------------------------------- 1 | #ifndef _HI_I2C_H 2 | #define _HI_I2C_H 3 | 4 | 5 | 6 | /* /dev/i2c-X ioctl commands. The ioctl's parameter is always an 7 | * unsigned long, except for: 8 | * - I2C_FUNCS, takes pointer to an unsigned long 9 | * - I2C_RDWR, takes pointer to struct i2c_rdwr_ioctl_data 10 | * - I2C_SMBUS, takes pointer to struct i2c_smbus_ioctl_data 11 | */ 12 | #define I2C_RETRIES 0x0701 /* number of times a device address should 13 | be polled when not acknowledging */ 14 | #define I2C_TIMEOUT 0x0702 /* set timeout in units of 10 ms */ 15 | 16 | /* NOTE: Slave address is 7 or 10 bits, but 10-bit addresses 17 | * are NOT supported! (due to code brokenness) 18 | */ 19 | #define I2C_SLAVE 0x0703 /* Use this slave address */ 20 | #define I2C_SLAVE_FORCE 0x0706 /* Use this slave address, even if it 21 | is already in use by a driver! */ 22 | #define I2C_TENBIT 0x0704 /* 0 for 7 bit addrs, != 0 for 10 bit */ 23 | 24 | #define I2C_FUNCS 0x0705 /* Get the adapter functionality mask */ 25 | 26 | #define I2C_RDWR 0x0707 /* Combined R/W transfer (one STOP only) */ 27 | 28 | #define I2C_PEC 0x0708 /* != 0 to use PEC with SMBus */ 29 | #define I2C_SMBUS 0x0720 /* SMBus transfer */ 30 | #define I2C_16BIT_REG 0x0709 /* 16BIT REG WIDTH */ 31 | #define I2C_16BIT_DATA 0x070a /* 16BIT DATA WIDTH */ 32 | 33 | typedef struct hiI2C_DATA_S 34 | { 35 | unsigned char dev_addr; 36 | unsigned int reg_addr; 37 | unsigned int addr_byte_num; 38 | unsigned int data; 39 | unsigned int data_byte_num; 40 | }I2C_DATA_S; 41 | 42 | #endif 43 | 44 | -------------------------------------------------------------------------------- /code/include/hisi/hi_isp_bin.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | 3 | Copyright (C), 2016, Hisilicon Tech. Co., Ltd. 4 | 5 | ****************************************************************************** 6 | File Name : hi_isp_bin.h 7 | Version : Initial Draft 8 | Author : Hisilicon multimedia software group 9 | Created : 2015/01/14 10 | Description : 11 | History : 12 | 1.Date : 2015/01/14 13 | Author : 14 | Modification: Created file 15 | 16 | ******************************************************************************/ 17 | 18 | #ifndef __HI_ISP_BIN_H__ 19 | #define __HI_ISP_BIN_H__ 20 | 21 | #include "hi_type.h" 22 | #include "hi_comm_isp.h" 23 | 24 | #ifdef __cplusplus 25 | #if __cplusplus 26 | extern "C" { 27 | #endif 28 | #endif /* End of #ifdef __cplusplus */ 29 | 30 | /**************************************************************************** 31 | * MACRO DEFINITION * 32 | ****************************************************************************/ 33 | #define MAX_BIN_REG_NUM 5 34 | 35 | /**************************************************************************** 36 | * GENERAL STRUCTURES * 37 | ****************************************************************************/ 38 | typedef struct hiISP_BIN_REG_ATTR_S { 39 | HI_U32 u32Addr; /* register addr */ 40 | HI_U8 u8StartBit; /* start bit of register addr */ 41 | HI_U8 u8EndBit; /* end bit of register addr */ 42 | } ISP_BIN_REG_ATTR_S; 43 | 44 | /* -------------------------------------------* 45 | The base addr of ISP logic register 46 | The base addr of ISP ext register 47 | The base addr of Hisi AE ext register 48 | The base addr of Hisi AWB ext register 49 | * ------------------------------------------- */ 50 | 51 | ISP_BIN_REG_ATTR_S g_astIspBinRegAttr[ISP_MAX_PIPE_NUM][MAX_BIN_REG_NUM] = { 52 | [0 ...(ISP_MAX_PIPE_NUM - 1)] = {0} 53 | }; 54 | 55 | 56 | #ifdef __cplusplus 57 | #if __cplusplus 58 | } 59 | #endif 60 | #endif /* End of #ifdef __cplusplus */ 61 | 62 | #endif /* __HI_ISP_BIN_H__ */ 63 | -------------------------------------------------------------------------------- /code/include/hisi/hi_isp_debug.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | 3 | Copyright (C), 2016, Hisilicon Tech. Co., Ltd. 4 | 5 | ****************************************************************************** 6 | File Name : hi_isp_debug.h 7 | Version : Initial Draft 8 | Author : Hisilicon multimedia software group 9 | Created : 2010/08/30 10 | Description : 11 | History : 12 | 1.Date : 2010/08/30 13 | Author : 14 | Modification: Created file 15 | 16 | ******************************************************************************/ 17 | 18 | #ifndef __HI_ISP_DEBUG_H__ 19 | #define __HI_ISP_DEBUG_H__ 20 | 21 | #include "hi_debug.h" 22 | #define ISP_TRACE(level, fmt, ...)\ 23 | do{ \ 24 | HI_TRACE(level, HI_ID_ISP,"[Func]:%s [Line]:%d [Info]:"fmt,__FUNCTION__, __LINE__,##__VA_ARGS__);\ 25 | }while(0) 26 | 27 | /* To avoid divide-0 exception in code. */ 28 | #define DIV_0_TO_1(a) ( ((a) == 0) ? 1 : (a) ) 29 | #define DIV_0_TO_1_FLOAT(a) ((((a) < 1E-10) && ((a) > -1E-10)) ? 1 : (a)) 30 | 31 | #endif /* __HI_ISP_DEBUG_H__ */ 32 | -------------------------------------------------------------------------------- /code/include/hisi/hi_md.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | 3 | Copyright (C), 2001-2015, Hisilicon Tech. Co., Ltd. 4 | 5 | ****************************************************************************** 6 | File Name : hi_md.h 7 | Version : Initial Draft 8 | Author : Hisilicon multimedia software (IVE) group 9 | Created : 2014/11/10 10 | Description : 11 | History : 12 | 1.Date : 2014/11/10 13 | Author : 14 | Modification: Created file 15 | 2.Date : 2015/11/24 16 | Author : 17 | Modification: Modify MD_ATTR_S 18 | ******************************************************************************/ 19 | #ifndef _HI_MD_H_ 20 | #define _HI_MD_H_ 21 | 22 | #include "hi_ive.h" 23 | 24 | #ifdef __cplusplus 25 | #if __cplusplus 26 | extern "C" { 27 | #endif 28 | #endif 29 | /* 30 | * Definition md algorithm mode 31 | */ 32 | typedef enum hiMD_ALG_MODE_E { 33 | MD_ALG_MODE_BG = 0x0, /* Base on background image */ 34 | MD_ALG_MODE_REF = 0x1, /* Base on reference image */ 35 | 36 | MD_ALG_MODE_BUTT 37 | } MD_ALG_MODE_E; 38 | /* 39 | * Definition of md attribute 40 | */ 41 | typedef struct hiMD_ATTR_S { 42 | MD_ALG_MODE_E enAlgMode; /* Md algorithm mode */ 43 | IVE_SAD_MODE_E enSadMode; /* Sad mode */ 44 | IVE_SAD_OUT_CTRL_E enSadOutCtrl; /* Sad output ctrl */ 45 | HI_U32 u32Width; /* Image width */ 46 | HI_U32 u32Height; /* Image height */ 47 | HI_U16 u16SadThr; /* Sad thresh */ 48 | IVE_CCL_CTRL_S stCclCtrl; /* Ccl ctrl */ 49 | IVE_ADD_CTRL_S stAddCtrl; /* Add ctrl */ 50 | } MD_ATTR_S; 51 | 52 | #ifdef __cplusplus 53 | #if __cplusplus 54 | } 55 | #endif 56 | #endif 57 | 58 | #endif /* _HI_MD_H_ */ -------------------------------------------------------------------------------- /code/include/hisi/hi_resampler_api.h: -------------------------------------------------------------------------------- 1 | #ifndef _HI_RESAMPLER_API_H_ 2 | #define _HI_RESAMPLER_API_H_ 3 | 4 | #include "hi_type.h" 5 | 6 | #ifdef __cplusplus 7 | extern "C" { 8 | #endif 9 | 10 | #define MAXFRAMESIZE 2048 11 | 12 | #ifndef HI_ERR_RESAMPLE_PREFIX 13 | #define HI_ERR_RESAMPLE_PREFIX 0x80000000 14 | #endif 15 | 16 | /* input handle is invalid */ 17 | #define HI_ERR_RESAMPLE_HANDLE (HI_ERR_RESAMPLE_PREFIX | 0x0001) 18 | 19 | /* pcm circ buffer state is invalid */ 20 | #define HI_ERR_RESAMPLE_PCMBUF (HI_ERR_RESAMPLE_PREFIX | 0x0002) 21 | 22 | /* input sample number is more than MAXFRAMESIZE or input buffer size 23 | , or input sample number is not invalid (eg. even)*/ 24 | #define HI_ERR_RESAMPLE_SAMPLE_NUMBER (HI_ERR_RESAMPLE_PREFIX | 0x0003) 25 | 26 | /* output pcm buffer space is not enough */ 27 | #define HI_ERR_RESAMPLE_OUTPCM_SPACE (HI_ERR_RESAMPLE_PREFIX | 0x0004) 28 | 29 | /* the channels of input pcm is invalid */ 30 | #define HI_ERR_PCM_CHANNEL (HI_ERR_RESAMPLE_PREFIX | 0x0005) 31 | 32 | /* the bit width of input pcm is invalid */ 33 | #define HI_ERR_PCM_FORMAT (HI_ERR_RESAMPLE_PREFIX | 0x0006) 34 | 35 | /* invalid bypass flag */ 36 | #define HI_ERR_INVALID_BYPASSFLAG (HI_ERR_RESAMPLE_PREFIX | 0x0007) 37 | 38 | /* error unknown */ 39 | #define HI_ERR_UNKNOWN (HI_ERR_RESAMPLE_PREFIX | 0x0008) 40 | 41 | /* input Empty pointer*/ 42 | #define HI_ERR_INPUT_EMPTY_POINTER (HI_ERR_RESAMPLE_PREFIX | 0x0009) 43 | 44 | /************************************************************************************** 45 | * Function: HI_Resampler_Create 46 | * 47 | * Description: allocate memory for platform-specific data 48 | * clear all the user-accessible fields 49 | * 50 | * Inputs: inrate: 8000, 11025, 12000, 16000, 22050, 24000, 32000, 44100, 48000 51 | * outrate: 8000, 11025, 12000, 16000, 22050, 24000, 32000, 44100, 48000 52 | * chans: 1 or 2 53 | * Outputs: none 54 | * 55 | * Return: handle to Resampler instance, 0 if malloc fails 56 | **************************************************************************************/ 57 | HI_VOID* HI_Resampler_Create(HI_S32 s32Inrate, HI_S32 s32Outrate, HI_S32 s32Chans); 58 | 59 | 60 | /************************************************************************************** 61 | * Function: HI_Resampler_Process 62 | * 63 | * Description: Resample pcm data to specific samplerate, only for interlaced format 64 | * 65 | * Inputs: inst: valid Resampler instance pointer (HResampler) 66 | * inbuf: pointer to inputbuf 67 | * insamps: input number of sample pointers 68 | * Outputs: outbuf: pointer to outputbuf 69 | * 70 | * Return: output sample number per-channel 71 | * Notes: sure insamps < MAXFRAMESIZE 72 | 73 | 74 | **************************************************************************************/ 75 | HI_S32 HI_Resampler_Process(HI_VOID* inst, HI_S16* s16Inbuf, HI_S32 s32Insamps, HI_S16* s16Outbuf); 76 | 77 | 78 | /************************************************************************************** 79 | * Function: HI_Resampler_Destroy 80 | * 81 | * Description: free platform-specific data allocated by ResamplerCreate 82 | * 83 | * Inputs: valid Resampler instance pointer (HResampler) 84 | * Outputs: none 85 | * 86 | * Return: none 87 | **************************************************************************************/ 88 | HI_VOID HI_Resampler_Destroy(HI_VOID* inst); 89 | 90 | 91 | /******************************************************************************* 92 | * Function: HI_Resampler_GetMaxOutputNum 93 | * 94 | * Description: Caculate max output number at specific input number 95 | * 96 | * Inputs: inst: valid Resampler instance pointer (HI_HANDLE) 97 | * insamps: input data number per-channel, insamps must be even 98 | * Outputs: none 99 | * Return: >=0: Success, return the max output number per-channel 100 | * other: Fail, return error code 101 | * Notes: 102 | * 1 if stereo(chans==2), sure insamps%2 == 0 103 | ******************************************************************************/ 104 | HI_S32 HI_Resampler_GetMaxOutputNum(HI_VOID* inst, HI_S32 s32Insamps); 105 | 106 | 107 | #ifdef __cplusplus 108 | } 109 | #endif 110 | 111 | 112 | 113 | #endif 114 | -------------------------------------------------------------------------------- /code/include/hisi/hi_sns_ctrl.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | 3 | Copyright (C), 2016, Hisilicon Tech. Co., Ltd. 4 | 5 | ****************************************************************************** 6 | File Name : hi_sns_ctrl.h 7 | Version : Initial Draft 8 | Author : Hisilicon multimedia software group 9 | Created : 2011/01/10 10 | Description : 11 | History : 12 | 1.Date : 2011/01/10 13 | Author : 14 | Modification: Created file 15 | 16 | ******************************************************************************/ 17 | 18 | #ifndef __HI_SNS_CTRL_H__ 19 | #define __HI_SNS_CTRL_H__ 20 | 21 | #include "hi_type.h" 22 | #include "hi_comm_3a.h" 23 | 24 | #ifdef __cplusplus 25 | #if __cplusplus 26 | extern "C" { 27 | #endif 28 | #endif /* End of #ifdef __cplusplus */ 29 | 30 | 31 | typedef struct hiISP_SNS_STATE_S { 32 | HI_BOOL bInit; /* HI_TRUE: Sensor init */ 33 | HI_BOOL bSyncInit; /* HI_TRUE: Sync Reg init */ 34 | HI_U8 u8ImgMode; 35 | HI_U8 u8Hdr; /* HI_TRUE: HDR enbale */ 36 | WDR_MODE_E enWDRMode; 37 | 38 | ISP_SNS_REGS_INFO_S astRegsInfo[2]; /* [0]: Sensor reg info of cur-frame; [1]: Sensor reg info of pre-frame ; */ 39 | 40 | HI_U32 au32FL[2]; /* [0]: FullLines of cur-frame; [1]: Pre FullLines of pre-frame */ 41 | HI_U32 u32FLStd; /* FullLines std */ 42 | HI_U32 au32WDRIntTime[4]; 43 | } ISP_SNS_STATE_S; 44 | 45 | typedef enum hiISP_SNS_MIRRORFLIP_TYPE_E { 46 | ISP_SNS_NORMAL = 0, 47 | ISP_SNS_MIRROR = 1, 48 | ISP_SNS_FLIP = 2, 49 | ISP_SNS_MIRROR_FLIP = 3, 50 | ISP_SNS_BUTT 51 | } ISP_SNS_MIRRORFLIP_TYPE_E; 52 | 53 | typedef struct hiISP_SNS_OBJ_S { 54 | HI_S32 (*pfnRegisterCallback)(VI_PIPE ViPipe, ALG_LIB_S *pstAeLib, ALG_LIB_S *pstAwbLib); 55 | HI_S32 (*pfnUnRegisterCallback)(VI_PIPE ViPipe, ALG_LIB_S *pstAeLib, ALG_LIB_S *pstAwbLib); 56 | HI_S32 (*pfnSetBusInfo)(VI_PIPE ViPipe, ISP_SNS_COMMBUS_U unSNSBusInfo); 57 | HI_VOID (*pfnStandby)(VI_PIPE ViPipe); 58 | HI_VOID (*pfnRestart)(VI_PIPE ViPipe); 59 | HI_VOID (*pfnMirrorFlip)(VI_PIPE ViPipe, ISP_SNS_MIRRORFLIP_TYPE_E eSnsMirrorFlip); 60 | HI_S32 (*pfnWriteReg)(VI_PIPE ViPipe, HI_S32 s32Addr, HI_S32 s32Data); 61 | HI_S32 (*pfnReadReg)(VI_PIPE ViPipe, HI_S32 s32Addr); 62 | HI_S32 (*pfnSetInit)(VI_PIPE ViPipe, ISP_INIT_ATTR_S *pstInitAttr); 63 | } ISP_SNS_OBJ_S; 64 | 65 | extern ISP_SNS_OBJ_S stSnsMn34220Obj; 66 | extern ISP_SNS_OBJ_S stSnsImx377Obj; 67 | extern ISP_SNS_OBJ_S stSnsImx299Obj; 68 | extern ISP_SNS_OBJ_S stSnsImx477Obj; 69 | extern ISP_SNS_OBJ_S stSnsImx299SlvsObj; 70 | extern ISP_SNS_OBJ_S stSnsImx290Obj; 71 | extern ISP_SNS_OBJ_S stSnsImx327Obj; 72 | extern ISP_SNS_OBJ_S stSnsImx327_2l_Obj; 73 | extern ISP_SNS_OBJ_S stSnsImx334Obj; 74 | extern ISP_SNS_OBJ_S stSnsOV2718Obj; 75 | extern ISP_SNS_OBJ_S stSnsAr0237Obj; 76 | 77 | extern ISP_SNS_OBJ_S stSnsCmv50000Obj; 78 | extern ISP_SNS_OBJ_S stSnsImx277SlvsObj; 79 | extern ISP_SNS_OBJ_S stSnsImx117Obj; 80 | extern ISP_SNS_OBJ_S stSnsImx290SlaveObj; 81 | extern ISP_SNS_OBJ_S stSnsImx334SlaveObj; 82 | extern ISP_SNS_OBJ_S stSnsImx226Obj; 83 | extern ISP_SNS_OBJ_S stSnsImx335Obj; 84 | extern ISP_SNS_OBJ_S stSnsImx307Obj; 85 | extern ISP_SNS_OBJ_S stSnsImx307_2l_Obj; 86 | extern ISP_SNS_OBJ_S stSnsImx458Obj; 87 | extern ISP_SNS_OBJ_S stSnsSc4236Obj; 88 | extern ISP_SNS_OBJ_S stSnsSc4210Obj; 89 | extern ISP_SNS_OBJ_S stSnsSc2231Obj; 90 | extern ISP_SNS_OBJ_S stSnsSc2235Obj; 91 | extern ISP_SNS_OBJ_S stSnsSc3235Obj; 92 | extern ISP_SNS_OBJ_S stSnsOs05aObj; 93 | extern ISP_SNS_OBJ_S stSnsOS08A10Obj; 94 | extern ISP_SNS_OBJ_S stSnsOs05a_2lObj; 95 | extern ISP_SNS_OBJ_S stSnsGc2053Obj; 96 | extern ISP_SNS_OBJ_S stSnsSharp8kObj; 97 | extern ISP_SNS_OBJ_S stSnsOv12870Obj; 98 | extern ISP_SNS_OBJ_S stSnsGc2053ForCarObj; 99 | 100 | #define CMOS_CHECK_POINTER(ptr)\ 101 | do {\ 102 | if (ptr == HI_NULL)\ 103 | {\ 104 | ISP_TRACE(HI_DBG_ERR, "Null Pointer!\n");\ 105 | return HI_ERR_ISP_NULL_PTR;\ 106 | }\ 107 | }while(0) 108 | 109 | #define CMOS_CHECK_POINTER_VOID(ptr)\ 110 | do {\ 111 | if (ptr == HI_NULL)\ 112 | {\ 113 | ISP_TRACE(HI_DBG_ERR, "Null Pointer!\n");\ 114 | return;\ 115 | }\ 116 | }while(0) 117 | 118 | #define SENSOR_FREE(ptr)\ 119 | do{\ 120 | if (ptr != HI_NULL)\ 121 | {\ 122 | free(ptr);\ 123 | ptr = HI_NULL;\ 124 | }\ 125 | } while (0) 126 | 127 | 128 | #ifdef __cplusplus 129 | #if __cplusplus 130 | } 131 | #endif 132 | #endif /* End of #ifdef __cplusplus */ 133 | 134 | #endif /* __HI_SNS_CTRL_H__ */ 135 | -------------------------------------------------------------------------------- /code/include/hisi/hi_spi.h: -------------------------------------------------------------------------------- 1 | #ifndef __HI_SPI_H__ 2 | #define __HI_SPI_H__ 3 | 4 | typedef unsigned long long __u64; 5 | typedef unsigned int __u32; 6 | typedef unsigned short __u16; 7 | typedef unsigned char __u8; 8 | 9 | #ifdef __HuaweiLite__ 10 | #include 11 | #else 12 | 13 | 14 | /* User space versions of kernel symbols for SPI clocking modes, 15 | * matching 16 | */ 17 | 18 | #define SPI_CPHA 0x01 19 | #define SPI_CPOL 0x02 20 | 21 | #define SPI_MODE_0 (0|0) 22 | #define SPI_MODE_1 (0|SPI_CPHA) 23 | #define SPI_MODE_2 (SPI_CPOL|0) 24 | #define SPI_MODE_3 (SPI_CPOL|SPI_CPHA) 25 | 26 | #define SPI_CS_HIGH 0x04 27 | #define SPI_LSB_FIRST 0x08 28 | #define SPI_3WIRE 0x10 29 | #define SPI_LOOP 0x20 30 | #define SPI_NO_CS 0x40 31 | #define SPI_READY 0x80 32 | 33 | /*---------------------------------------------------------------------------*/ 34 | 35 | /* IOCTL commands */ 36 | 37 | #define SPI_IOC_MAGIC 'k' 38 | 39 | /** 40 | * struct spi_ioc_transfer - describes a single SPI transfer 41 | * @tx_buf: Holds pointer to userspace buffer with transmit data, or null. 42 | * If no data is provided, zeroes are shifted out. 43 | * @rx_buf: Holds pointer to userspace buffer for receive data, or null. 44 | * @len: Length of tx and rx buffers, in bytes. 45 | * @speed_hz: Temporary override of the device's bitrate. 46 | * @bits_per_word: Temporary override of the device's wordsize. 47 | * @delay_usecs: If nonzero, how long to delay after the last bit transfer 48 | * before optionally deselecting the device before the next transfer. 49 | * @cs_change: True to deselect device before starting the next transfer. 50 | * 51 | * This structure is mapped directly to the kernel spi_transfer structure; 52 | * the fields have the same meanings, except of course that the pointers 53 | * are in a different address space (and may be of different sizes in some 54 | * cases, such as 32-bit i386 userspace over a 64-bit x86_64 kernel). 55 | * Zero-initialize the structure, including currently unused fields, to 56 | * accommodate potential future updates. 57 | * 58 | * SPI_IOC_MESSAGE gives userspace the equivalent of kernel spi_sync(). 59 | * Pass it an array of related transfers, they'll execute together. 60 | * Each transfer may be half duplex (either direction) or full duplex. 61 | * 62 | * struct spi_ioc_transfer mesg[4]; 63 | * ... 64 | * status = ioctl(fd, SPI_IOC_MESSAGE(4), mesg); 65 | * 66 | * So for example one transfer might send a nine bit command (right aligned 67 | * in a 16-bit word), the next could read a block of 8-bit data before 68 | * terminating that command by temporarily deselecting the chip; the next 69 | * could send a different nine bit command (re-selecting the chip), and the 70 | * last transfer might write some register values. 71 | */ 72 | struct spi_ioc_transfer { 73 | __u64 tx_buf; 74 | __u64 rx_buf; 75 | 76 | __u32 len; 77 | __u32 speed_hz; 78 | 79 | __u16 delay_usecs; 80 | __u8 bits_per_word; 81 | __u8 cs_change; 82 | __u32 pad; 83 | 84 | /* If the contents of 'struct spi_ioc_transfer' ever change 85 | * incompatibly, then the ioctl number (currently 0) must change; 86 | * ioctls with constant size fields get a bit more in the way of 87 | * error checking than ones (like this) where that field varies. 88 | * 89 | * NOTE: struct layout is the same in 64bit and 32bit userspace. 90 | */ 91 | }; 92 | 93 | /* not all platforms use or _IOC_TYPECHECK() ... */ 94 | #define SPI_MSGSIZE(N) \ 95 | ((((N)*(sizeof (struct spi_ioc_transfer))) < (1 << _IOC_SIZEBITS)) \ 96 | ? ((N)*(sizeof (struct spi_ioc_transfer))) : 0) 97 | #define SPI_IOC_MESSAGE(N) _IOW(SPI_IOC_MAGIC, 0, char[SPI_MSGSIZE(N)]) 98 | 99 | 100 | /* Read / Write of SPI mode (SPI_MODE_0..SPI_MODE_3) */ 101 | #define SPI_IOC_RD_MODE _IOR(SPI_IOC_MAGIC, 1, __u8) 102 | #define SPI_IOC_WR_MODE _IOW(SPI_IOC_MAGIC, 1, __u8) 103 | 104 | /* Read / Write SPI bit justification */ 105 | #define SPI_IOC_RD_LSB_FIRST _IOR(SPI_IOC_MAGIC, 2, __u8) 106 | #define SPI_IOC_WR_LSB_FIRST _IOW(SPI_IOC_MAGIC, 2, __u8) 107 | 108 | /* Read / Write SPI device word length (1..N) */ 109 | #define SPI_IOC_RD_BITS_PER_WORD _IOR(SPI_IOC_MAGIC, 3, __u8) 110 | #define SPI_IOC_WR_BITS_PER_WORD _IOW(SPI_IOC_MAGIC, 3, __u8) 111 | 112 | /* Read / Write SPI device default max speed hz */ 113 | #define SPI_IOC_RD_MAX_SPEED_HZ _IOR(SPI_IOC_MAGIC, 4, __u32) 114 | #define SPI_IOC_WR_MAX_SPEED_HZ _IOW(SPI_IOC_MAGIC, 4, __u32) 115 | 116 | #endif 117 | #endif /* __HI_SPI_H__ */ 118 | -------------------------------------------------------------------------------- /code/include/hisi/hi_ssp.h: -------------------------------------------------------------------------------- 1 | /* 2 | * extdrv/include/hi_ssp.h for Linux . 3 | * 4 | * History: 5 | * 2006-4-11 create this file 6 | */ 7 | 8 | #ifndef __HI_SSP_H__ 9 | #define __HI_SSP_H__ 10 | 11 | #define SSP_READ_ALT 0x1 12 | #define SSP_WRITE_ALT 0X3 13 | 14 | typedef struct hiSPI_DATA_S 15 | { 16 | unsigned int spi_no; 17 | unsigned char dev_addr; 18 | unsigned int dev_byte_num; 19 | unsigned int reg_addr; 20 | unsigned int addr_byte_num; 21 | unsigned int data; 22 | unsigned int data_byte_num; 23 | }SPI_DATA_S; 24 | 25 | 26 | #endif 27 | 28 | -------------------------------------------------------------------------------- /code/include/hisi/hi_tde_errcode.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | Copyright (C), 2016-2018, Hisilicon Tech. Co., Ltd. 3 | ****************************************************************************** 4 | File Name : tde_errcode.h 5 | Version : Initial Draft 6 | Author : sdk 7 | Created : 8 | Last Modified : 9 | Description : err code define 10 | Function List : 11 | History : May modify the code to errcode.h FOR hi3110 12 | ******************************************************************************/ 13 | #ifndef __TDE_ERRCODE_H__ 14 | #define __TDE_ERRCODE_H__ 15 | 16 | #include "hi_type.h" 17 | 18 | #ifdef __cplusplus 19 | #if __cplusplus 20 | extern "C" { 21 | #endif 22 | #endif /* __cplusplus */ 23 | 24 | /* tde start err no. */ 25 | #define HI_ERR_TDE_BASE ((HI_S32)( ((0x80UL + 0x20UL)<<24) | (100 << 16 ) | (4 << 13) | 1 )) 26 | 27 | enum 28 | { 29 | HI_ERR_TDE_DEV_NOT_OPEN = HI_ERR_TDE_BASE, /**< tde device not open yet */ 30 | HI_ERR_TDE_DEV_OPEN_FAILED, /**< open tde device failed */ 31 | HI_ERR_TDE_NULL_PTR, /**< input parameters contain null ptr */ 32 | HI_ERR_TDE_NO_MEM, /**< malloc failed */ 33 | HI_ERR_TDE_INVALID_HANDLE, /**< invalid job handle */ 34 | HI_ERR_TDE_INVALID_PARA, /**< invalid parameter */ 35 | HI_ERR_TDE_NOT_ALIGNED, /**< aligned error for position, stride, width */ 36 | HI_ERR_TDE_MINIFICATION, /**< invalid minification */ 37 | HI_ERR_TDE_CLIP_AREA, /**< clip area and operation area have no intersection */ 38 | HI_ERR_TDE_JOB_TIMEOUT, /**< blocked job wait timeout */ 39 | HI_ERR_TDE_UNSUPPORTED_OPERATION, /**< unsupported operation */ 40 | HI_ERR_TDE_QUERY_TIMEOUT, /**< query time out */ 41 | HI_ERR_TDE_INTERRUPT /* blocked job was interrupted */ 42 | }; 43 | 44 | 45 | #ifdef __cplusplus 46 | #if __cplusplus 47 | } 48 | #endif 49 | #endif /* __cplusplus */ 50 | 51 | #endif /* __TDE_ERRCODE_H__*/ 52 | 53 | 54 | -------------------------------------------------------------------------------- /code/include/hisi/hi_type.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * Copyright (C) Hisilicon Technologies Co., Ltd. 2005-2019. All rights reserved. 3 | * Description: Common data types of the system. 4 | * Author: Hisilicon multimedia software group 5 | * Create: 2005-4-23 6 | ******************************************************************************/ 7 | 8 | #ifndef __HI_TYPE_H__ 9 | #define __HI_TYPE_H__ 10 | 11 | #ifdef __KERNEL__ 12 | 13 | #include 14 | #else 15 | 16 | #include 17 | #endif 18 | 19 | #ifdef __cplusplus 20 | #if __cplusplus 21 | extern "C"{ 22 | #endif 23 | #endif /* __cplusplus */ 24 | 25 | /*--------------------------------------------------------------------------------------------------------------* 26 | * Defintion of basic data types. The data types are applicable to both the application layer and kernel codes. * 27 | *--------------------------------------------------------------------------------------------------------------*/ 28 | /*************************** Structure Definition ****************************/ 29 | /** \addtogroup Common_TYPE */ 30 | /** @{ */ /** |<--- 8bit --->|<--- 8bit --->| 36 | |--------------------------------------------------------------| 37 | | HI_MOD_ID_E | mod defined data | chnID | 38 | |--------------------------------------------------------------| 39 | 40 | mod defined data: private data define by each module(for example: sub-mod id), usually, set to 0. 41 | */ 42 | 43 | #define HI_HANDLE_MAKEHANDLE(mod, privatedata, chnid) (hi_handle)( (((mod)& 0xffff) << 16) | ((((privatedata)& 0xff) << 8) ) | (((chnid) & 0xff)) ) 44 | 45 | #define HI_HANDLE_GET_MODID(handle) (((handle) >> 16) & 0xffff) 46 | #define HI_HANDLE_GET_PriDATA(handle) (((handle) >> 8) & 0xff) 47 | #define HI_HANDLE_GET_CHNID(handle) (((handle)) & 0xff) 48 | 49 | 50 | /** @} */ /**