CARPLAY版本整理

This commit is contained in:
2025-01-21 16:49:37 +08:00
commit f0fb64e4e6
26542 changed files with 13719676 additions and 0 deletions

View File

@ -0,0 +1,25 @@
#ifndef _ANIMATION_H
#define _ANIMATION_H
typedef struct {
unsigned int magic;
int hasBootlogo;
int bootlogoDisplayTime;
int aniCount;
int aniWidth;
int aniHeight;
int aniFps;
int aniDelayHideTime;
unsigned int aniSize;
unsigned int checksum;
unsigned int reserved[2];
}BANIHEADER;
int animation_init(void);
void animation_start(void);
/* replay animation even if animation is already playing */
void animation_restart(void);
void animation_stop(void);
int get_animation_status(void);
#endif

View File

@ -0,0 +1,149 @@
#ifndef _ARK7116_DRV_H_
#define _ARK7116_DRV_H_
#if __cplusplus
extern "C"
{
#endif
typedef enum _ConfigDisplayMode
{
DISP_16_9= 0 ,
DISP_4_3,
}ConfigDisplayMode;
typedef enum _ColorSysType
{
PAL = 0,
PAL_N,
PAL_M,
NTSC,
SECAM,
PAL60,
AUTO,
NULL_SYS = -1,
}ColorSysType;
//MCU CFG Addr
#define MCU_CFG_ADDR 0xC6
/************************Global ***********************/
#define RSTN 0XFD00
#define ENH_PLL 0XFD0E
/***********************Decoder ************************/
#define DECODER_RST 0XFEA0
//BUS Addr
#define BUS_STATUS_ADDR 0xAF
typedef struct _PanlstaticPara
{
unsigned int addr;
unsigned char dat;
}PanlstaticPara;
typedef enum _VdeOutputType
{
VDE_CLOSE = 0,
VDE_RED,
VDE_GREEN,
VDE_BLUE ,
VDE_GRAY,
VDE_WHITE,
VDE_BLACK,
MAX_VDECOLOR = VDE_BLACK,
} VdeOutputTyp;
/*************************************VP CONTROL REG*********************************/
#define BRIGHT_REG 0XFFD4
#define CONTRAST_REG 0XFFD3
#define SATURATION_REG 0XFFD6
#define TINT_REG 0XFFD5
#define VDE_REG 0XFFD2
/*==============start===============*/
/*AV1
[VideoChannel]
AV1
[VideoType]
CVBS
[VideoPI]
VIDEO_P
[VideoPicSys]
PAL
[VideoData]
13500000
690
280
864
312
Update date:Monday, November 24, 2014
Update time:11:05:45
*/
/*屏参参数相关的结构体*/
typedef struct _PannelPara
{
PanlstaticPara *pVideoStaicPara;
}PannelPara;
typedef struct _VideoChannel
{
unsigned char INPUT_ID;
PannelPara VideoPara;
}VideoChannel;
#define STATIC_NUM 280
#define POS_DYN_NUM 0
#define SYS_DYN_NUM 0
#define PAD_MUX_NUM 36
#define VCOM_AC_Def 0X00
#define VCOM_DC_Def 0X00
#define PWMA_VAL 0X0000
#define PWMB_VAL 0X0000
#define PAL_PLL_CLK 0X0048
#define NTSC_PLL_CLK 0X0048
#define PWM0_CYCLE_VAL 0X00FF
#define PWM1_CYCLE_VAL 0X00FF
#define PWM2_CYCLE_VAL 0X00FF
#define PWM3_CYCLE_VAL 0X00FF
#define PWM0_DUTY_VAL 0X0080
#define PWM1_DUTY_VAL 0X0080
#define PWM2_DUTY_VAL 0X0080
#define PWM3_DUTY_VAL 0X0080
#define I2C_ACCESS_LOOP_TIME 20
typedef struct
{
unsigned char regAddr;
unsigned char regValue;
}ARK7116REG;
typedef struct
{
unsigned char regAddr;
unsigned char regPalValue;
unsigned char regNtscValue;
}ARK7116DYREG;
#if __cplusplus
}
#endif
#endif

View File

@ -0,0 +1,532 @@
#ifndef _BOARD_H
#define _BOARD_H
/********** display configuration **********/
#define LCD_INTERFACE_TTL 0
#define LCD_INTERFACE_LVDS 1
#define LCD_INTERFACE_CPU 2
#define LCD_INTERFACE_MIPI 3
#define LCD_WIRING_MODE_RGB 0
#define LCD_WIRING_MODE_RBG 1
#define LCD_WIRING_MODE_GRB 2
#define LCD_WIRING_MODE_GBR 3
#define LCD_WIRING_MODE_BRG 4
#define LCD_WIRING_MODE_BGR 5
#define LCD_WIRING_BIT_ORDER_MSB 0
#define LCD_WIRING_BIT_ORDER_LSB 1
#define LVDS_PANEL_FORMAT_TI 0
#define LVDS_PANEL_FORMAT_NS 1
#define LVDS_PANEL_DATA_8BIT 0
#define LVDS_PANEL_DATA_6BIT 1
#define CPU_PANEL_18BIT_MODE 0
#define CPU_PANEL_16BIT_MODE 1
#define CPU_PANEL_9BIT_MODE 2
#define CPU_PANEL_8BIT_MODE 3
#define LCD_ROTATE_ANGLE_0 0
#define LCD_ROTATE_ANGLE_90 1
#define LCD_ROTATE_ANGLE_180 2
#define LCD_ROTATE_ANGLE_270 3
#define LCD_H_FLIP 0 //水平镜像
#define LCD_V_FLIP 0 //垂直镜像
//#define LCD_CLK_INVERSE //LCD时钟极性反向
#define LCD_ROTATE_ANGLE LCD_ROTATE_ANGLE_0
#if defined(LVGL_VG_GPU) || defined(VG_ONLY) || defined(REVERSE_TRACK)
#ifndef VG_DRIVER
#error "Error! Must define VG_DRIVER."
#endif
#endif
#if defined(DOUBLE_POINTER_HALO) || defined(SINGLE_POINTER_HALO)
#ifndef VG_ONLY
#error "Error! Must define VG_ONLY."
#endif
#endif
#ifdef VG_ONLY
#if defined(DOUBLE_POINTER_HALO)
#define LCD_WIDTH 1280
#define LCD_HEIGHT 480
#define LCD_BPP 16
#define LCD_INTERFACE_TYPE LCD_INTERFACE_LVDS
#elif defined(SINGLE_POINTER_HALO)
#define LCD_WIDTH 1024
#define LCD_HEIGHT 600
#define LCD_BPP 16
#define LCD_INTERFACE_TYPE LCD_INTERFACE_TTL
#endif
#elif defined(AWTK)
//240719 lj
// #define LCD_WIDTH 1024
// #define LCD_HEIGHT 600
// #define LCD_BPP 16
#define LCD_WIDTH 800
#define LCD_HEIGHT 480
#define LCD_BPP 32
#define LCD_INTERFACE_TYPE LCD_INTERFACE_TTL
#else
#define LCD_WIDTH 1024
#define LCD_HEIGHT 600
#ifdef REVERSE_UI
#define LCD_BPP 32
#else
#define LCD_BPP 16
#endif
#define LCD_INTERFACE_TYPE LCD_INTERFACE_TTL
#endif
#if LCD_INTERFACE_TYPE == LCD_INTERFACE_TTL
#define LCD_WIRING_MODE LCD_WIRING_MODE_RGB
#define LCD_WIRING_BIT_ORDER LCD_WIRING_BIT_ORDER_LSB
#elif LCD_INTERFACE_TYPE == LCD_INTERFACE_LVDS
#define LCD_WIRING_MODE LCD_WIRING_MODE_BGR
#define LCD_WIRING_BIT_ORDER LCD_WIRING_BIT_ORDER_MSB
#define LVDS_SCREEN_RST_GPIO 74
#define LVDS_PANEL_FORMAT LVDS_PANEL_FORMAT_TI
#define LVDS_PANEL_DATA LVDS_PANEL_DATA_8BIT
#elif LCD_INTERFACE_TYPE == LCD_INTERFACE_CPU
#define CPU_PANEL_DATA CPU_PANEL_8BIT_MODE
#elif LCD_INTERFACE_TYPE == LCD_INTERFACE_MIPI
#define LCD_WIRING_MODE LCD_WIRING_MODE_RGB
#define LCD_WIRING_BIT_ORDER LCD_WIRING_BIT_ORDER_MSB
#endif
#define FB_SIZE (LCD_WIDTH * LCD_HEIGHT * LCD_BPP / 8)
#define VIDEO_DISPLAY_WIDTH LCD_WIDTH
#define VIDEO_DISPLAY_HEIGHT LCD_HEIGHT
#define VIDEO_DISPLAY_BUF_NUM 2
#if (LCD_WIDTH == 1024 && LCD_HEIGHT == 600)
#define LCD_TIMING_VBP 1
#define LCD_TIMING_VFP 1
#define LCD_TIMING_VSW 30
#define LCD_TIMING_HBP 100
#define LCD_TIMING_HFP 100
#define LCD_TIMING_HSW 370
#define LCD_CLK_FREQ 50000000
#elif (LCD_WIDTH == 800 && LCD_HEIGHT == 480)
#define LCD_TIMING_VBP 1
#define LCD_TIMING_VFP 1
#define LCD_TIMING_VSW 30
#define LCD_TIMING_HBP 50
#define LCD_TIMING_HFP 50
#define LCD_TIMING_HSW 180
#define LCD_CLK_FREQ 35000000
#elif (LCD_WIDTH == 1280 && LCD_HEIGHT == 720)
#define LCD_TIMING_VBP 5
#define LCD_TIMING_VFP 65
#define LCD_TIMING_VSW 2
#define LCD_TIMING_HBP 16
#define LCD_TIMING_HFP 42
#define LCD_TIMING_HSW 2
#define LCD_CLK_FREQ 60000000
#elif (LCD_WIDTH == 1280 && LCD_HEIGHT == 480)
#define LCD_TIMING_VBP 5
#define LCD_TIMING_VFP 8
#define LCD_TIMING_VSW 3
#define LCD_TIMING_HBP 16
#define LCD_TIMING_HFP 26
#define LCD_TIMING_HSW 12
#define LCD_CLK_FREQ 40000000
#elif (LCD_WIDTH == 480 && LCD_HEIGHT == 1280)
#define LCD_TIMING_VBP 6// 14
#define LCD_TIMING_VFP 6// 16
#define LCD_TIMING_VSW 16// 2
#define LCD_TIMING_HBP 16
#define LCD_TIMING_HFP 36
#define LCD_TIMING_HSW 26
#define LCD_CLK_FREQ 50000000
#elif (LCD_WIDTH == 480 && LCD_HEIGHT == 960)
#define LCD_TIMING_VBP 20//10
#define LCD_TIMING_VFP 20//30
#define LCD_TIMING_VSW 10
#define LCD_TIMING_HBP 30//5
#define LCD_TIMING_HFP 40//10
#define LCD_TIMING_HSW 10
#define LCD_CLK_FREQ 33330000
#else
#error "no lcd timing configuraion."
#endif
/*******************************************/
/************ adc configuration ************/
//#define ADC_TOUCH
#define ADC_KEY
/*******************************************/
/******* video in configuration *******/
#define VIDEO_DECODER_RN6752
//#define VIDEO_DECODER_ARK7116
#define VIN_CVBS_PAL 0
#define VIN_CVBS_NTSC 1
#define VIN_AHD_720P_25 2
#define VIN_AHD_720P_30 3
#define VIDEO_IN_FORMAT VIN_CVBS_NTSC
#if VIDEO_IN_FORMAT == VIN_CVBS_PAL
#define VIN_WIDTH 720
#define VIN_HEIGHT 288
#elif VIDEO_IN_FORMAT == VIN_CVBS_NTSC
#define VIN_WIDTH 720
#define VIN_HEIGHT 240
#elif VIDEO_IN_FORMAT == VIN_AHD_720P_25 || VIDEO_IN_FORMAT == VIN_AHD_720P_30
#define VIN_WIDTH 1280
#define VIN_HEIGHT 720
#endif
#if VIN_WIDTH * VIN_HEIGHT > 0x96000
#define VIN_SMALL_MEM
#endif
/*******************************************/
/************ carback configuration ********/
//#define CARBACK_DETECT
/*******************************************/
/********* touchscreen configuration *******/
//#define TP_SUPPORT
#ifdef TP_SUPPORT
/* Select one tp IC */
//#define TP_USE_GT9XX
//#define TP_USE_GA657X
//#define TP_USE_FT6336U
/* Config tp parameters */
#define TP_GPIO_INT 4
#define TP_GPIO_RST 5
#define TP_INV_X 0
#define TP_INV_Y 0
#define TP_INV_XY_AXIS 0 //翻转XY轴
#define TP_MT_TOUCH 0 //支持多点触摸
#endif
/*******************************************/
/*********** sdmmc configuration ***********/
#define SDMMC_SUPPORT //SD卡软件宏 WIF模块会调用
/*******************************************/
/*********** uart configuration ************/
//240719 lj
#define UART_BT_PORT 3//蓝牙通讯串口3
#define UART_MCU_PORT 2//通话蓝牙与cat1通讯串口2
/*******************************************/
/************ rtc configuration ************/
#define RTC_SUPPORT
/*******************************************/
/************ remote configuration ************/
//#define REMOTE_SUPPORT
/*******************************************/
/************ pwm capture configuration ************/
//#define PWM_CAP_SUPPORT
/*******************************************/
/************ dma configuration ************/
/* the smaller channel has higher priority */
#define I2S_DMA_RXCH 0
#define I2S_DMA_TXCH 1
#define SPI0_RX_DMA_CH 2
#define SDMMC_DMA_CH 3
/*******************************************/
/************ usb configuration ************/
#define USB_SUPPORT
#define USB_MODE_ID -1
//#define USB_DMA
//#define USB_UVC_SUPPORT
#define CONFIG_USB_DWC2_HOST 1
#define CONFIG_USB_NEW_DWC2_HOST 1
#define CONFIG_USB_DWC2_PERIPHERAL 1
#define CONFIG_USB_NEW_DWC2_GADGET 1
#if USB_MODE_ID && USB_MODE_ID != -1
#define CONFIG_USB_DEVICE_CDC_NCM 1
#endif
/*******************************************/
/************ carlink configuration ************/
#ifdef CARLINK_ENABLE /* define in iar options */
#define WIFI_SUPPORT
#endif
#ifdef WIFI_SUPPORT
#define CARLINK_EY 0
#define CARLINK_EC 0
#define CARLINK_CP 1
#define CARLINK_AA 1
#if !DEVICE_MXC_A27
#define WIFI_RESET_IO 12
#else
#define WIFI_RESET_IO 95
#endif
#else
#define CARLINK_EY 0
#define CARLINK_EC 0
#define CARLINK_CP 0
#define CARLINK_AA 0
#endif
#if CARLINK_EY && CARLINK_EC
#error "Do not choose two car links"
#elif (CARLINK_EY && CARLINK_CP)
#error "Do not choose two car links"
#elif (CARLINK_EY && CARLINK_AA)
#error "Do not choose two car links"
#elif (CARLINK_EC && CARLINK_CP)
// #error "Do not choose two car links"
#elif (CARLINK_EC && CARLINK_AA)
#error "Do not choose two car links"
// #elif (CARLINK_CP && CARLINK_AA)
#error "Do not choose two car links"
#endif
#define USE_LWIP 1
#if CARLINK_CP && !USE_LWIP
#error "carplay need lwip"
#endif
#if !DEVICE_MXC_A27
//wifi模块蓝牙复位引脚
#define BT_RESET_IO 13
//wifi模块使能引脚
#define WIFI_EN_IO 14
#else
#define BT_RESET_IO 94
#define WIFI_EN_IO 46
#endif
#define BT_UART_PORT 1
//#define RELTECK_WIFI_AP_MODE
/*******************************************/
/************ i2c configuration ************/
#define HW_I2C0_SUPPORT //Hardware i2c0 support
//#define HW_I2C1_SUPPORT //Hardware i2c1 support
//#define ANALOG_I2C_SUPPORT //Analog i2c support
#ifdef ANALOG_I2C_SUPPORT
#define I2C_GPIO0_SDA_PIN 102
#define I2C_GPIO0_SCL_PIN 101
#endif
/*******************************************/
/************ audio configuration ************/
#define I2S_ID0 0
#define I2S_ID1 1
#define I2S_NUMS 2
#define AUDIO_FLAG_REPLAY 1
#define AUDIO_FLAG_RECORD 2
#define AUDIO_FLAG_REPLAY_RECORD (AUDIO_FLAG_REPLAY | AUDIO_FLAG_RECORD)
/* add your adc type */
#define AUDIO_CODEC_ADC_NONE 0 //Not use codec adc ic or no need driver.
#define AUDIO_CODEC_ADC_ES7243E 1 //Use codec adc ic es7243e.
/* add your dac type */
#define AUDIO_CODEC_DAC_NONE 0 //Not use codec adc ic or no need driver.
#define AUDIO_CODEC_DAC_ES8156 1 //Use codec dac ic es8156.
/* choose your audio use type */
#define AUDIO_REPLAY
#define AUDIO_RECORD
#ifdef AUDIO_REPLAY
#define AUDIO_REPLAY_I2S I2S_ID0 /* Select i2s id */
#define AUDIO_CODEC_DAC_IC AUDIO_CODEC_DAC_NONE /* Select your codec dac type */
#endif
#ifdef AUDIO_RECORD
#define AUDIO_RECORD_I2S I2S_ID1 /* Select i2s id */
#define AUDIO_CODEC_ADC_IC AUDIO_CODEC_ADC_ES7243E /* Select your codec adc type */
#endif
#ifndef AUDIO_CODEC_DAC_IC
#define AUDIO_CODEC_DAC_IC AUDIO_CODEC_DAC_NONE /* Do not use codec dac by default */
#endif
#ifndef AUDIO_CODEC_ADC_IC
#define AUDIO_CODEC_ADC_IC AUDIO_CODEC_ADC_NONE /* Do not use codec adc by default */
#endif
/*******************************************/
/********** romfile configuration **********/
/* 没有定义ROMFILE_USE_SMALL_MEMromfile内容会全部加载到ddr
* 内存不足时可以定义ROMFILE_USE_SMALL_MEM节省内存使用 */
#if !defined(VG_ONLY)
#define ROMFILE_USE_SMALL_MEM
#endif
#ifndef ROMFILE_USE_SMALL_MEM
/* 定义READ_ROMFILE_ONCEromfile内容会整个一次加载到ddr如果
* 文件过大会导致启动时间慢 */
//#define READ_ROMFILE_ONCE
#else
/* 缓存在DDR里的文件数未缓存的文件需要重新从flash里读取 */
#define ROMFILE_CACHE_DEF_SIZE 0
#endif
/*******************************************/
/********** animation configuration **********/
#define ANIMATION_NONE 0
#define ANIMATION_USE_SMALL_MEM 1
#define ANIMATION_NORMAL 2
#define ANIMATION_POLICY ANIMATION_NORMAL
/*********************************************/
/************ flash type configuration ************/
#define SPI_NOR_FLASH 0
#define SPI_NAND_FLASH 1
#define EMMC_FLASH 2
#define DEVICE_TYPE_SELECT SPI_NOR_FLASH
/*******************************************/
/********** update address configuration **********/
#if DEVICE_TYPE_SELECT == SPI_NAND_FLASH
#define LOADER_OFFSET 0x0
#define STEPLDRA_OFFSET 0x20000
#define STEPLDRB_OFFSET 0x40000
#define STEPLDR_MAX_SIZE 0x14000
#define SYSINFOA_MEDIA_OFFSET 0x60000
#define SYSINFOB_MEDIA_OFFSET 0x80000
#define UPDATEFILE_MEDIA_OFFSET 0xa0000
#define UPDATEFILE_MEDIA_B_OFFSET 0xc00000
#define UPDATEFILE_MAX_SIZE 0xb00000
#define OTA_MEDIA_OFFSET 0x500000
#define OTA_MEDIA_SIZE 0xa00000
#define SPI0_QSPI_MODE
#elif DEVICE_TYPE_SELECT == SPI_NOR_FLASH
#define LOADER_OFFSET 0x0
#define STEPLDRA_OFFSET 0x4000
#define STEPLDRB_OFFSET 0x20000
#define STEPLDR_MAX_SIZE 0x14000
#define SYSINFOA_MEDIA_OFFSET 0x3c000
#define SYSINFOB_MEDIA_OFFSET 0x3e000
#define UPDATEFILE_MEDIA_OFFSET 0x40000
#define UPDATEFILE_MEDIA_B_OFFSET 0xc00000
#define UPDATEFILE_MAX_SIZE 0xb00000
#define OTA_MEDIA_OFFSET 0xa00000
#define OTA_MEDIA_SIZE 0x500000
// #define SPI0_QSPI_MODE
#elif DEVICE_TYPE_SELECT == EMMC_FLASH
#define LOADER_OFFSET 0x0
#define LOADERB_OFFSET 0x100000
#define STEPLDRA_OFFSET 0x200000
#define STEPLDRB_OFFSET 0x300000
#define STEPLDR_MAX_SIZE 0x14000
#define SYSINFOA_MEDIA_OFFSET 0x400000
#define SYSINFOB_MEDIA_OFFSET 0x500000
#define UPDATEFILE_MEDIA_OFFSET 0xA00000
#define UPDATEFILE_MEDIA_B_OFFSET 0x40000000
#define UPDATEFILE_MAX_SIZE 0x1000000
#define OTA_MEDIA_OFFSET 0x80000000
#define OTA_MEDIA_SIZE 0x10000000
//#define SPI0_QSPI_MODE
#endif
/*********************************************/
/********** ulog configuration **********/
//#define USE_ULOG
#define ULOG_NAME_MAX 8
#define ULOG_LINE_BUF_SIZE 1024
#define ULOG_OUTPUT_LEVEL
#define ULOG_OUTPUT_TIME
//#define ULOG_TIME_USING_TIMESTAMP
//#define ULOG_OUTPUT_TAG
//#define ULOG_USING_COLOR
#define ULOG_USING_ISR_LOG
#define ULOG_BACKEND_USING_CONSOLE
#define ULOG_EASYFLASH_BACKEND_ENABLE
#ifdef ULOG_EASYFLASH_BACKEND_ENABLE
#define EASYFLASH_LOG
#if DEVICE_TYPE_SELECT != EMMC_FLASH
#define EASYFLASH_LOG_AREA_SIZE 0x100000
#define EASYFLASH_ERASE_GRAN 0x1000
#define EASYFLASH_WRITE_GRAN 0x100
#define EASYFLASH_START_ADDR 0x1700000
#else
#define EASYFLASH_LOG_AREA_SIZE 0x100000
#define EASYFLASH_ERASE_GRAN 0x10000
#define EASYFLASH_WRITE_GRAN 0x200
#define EASYFLASH_START_ADDR 0x60000000
#endif
#endif
//#define ULOG_FILE_BACKEND_ENABLE
#ifdef ULOG_FILE_BACKEND_ENABLE
#if DEVICE_TYPE_SELECT != EMMC_FLASH
#define ULOG_FILE_ROOT_PATH "/sf/logs"
#else
#define ULOG_FILE_ROOT_PATH "/sd/logs"
#endif
#define ULOG_FILE_NAME_BASE "ulog.log"
#define ULOG_FILE_MAX_NUM 10
#define ULOG_FILE_MAX_SIZE (1024 * 32)
#endif
//#define ULOG_USING_ASYNC_OUTPUT
#define ULOG_ASYNC_OUTPUT_BUF_SIZE 1024
#define ULOG_ASYNC_OUTPUT_THREAD_STACK 2048
#define ULOG_ASYNC_OUTPUT_THREAD_PRIORITY 10
/*********************************************/
/********** update address configuration **********/
#define OTA_UPDATE_SUPPORT
#ifdef OTA_UPDATE_SUPPORT
//#define WIFI_UPDATE_SUPPORT
#if defined(WIFI_UPDATE_SUPPORT) && !defined(USB_SUPPORT)
#error "Error! Should define USB_SUPPORT to support wifi simu update"
#endif
//#define NCM_UPDATE_SUPPORT
#if defined(NCM_UPDATE_SUPPORT) && !CONFIG_USB_DEVICE_CDC_NCM
#error "Error! Should define CONFIG_USB_DEVICE_CDC_NCM=1 to support ncm update"
#endif
//#define NCM_LOG_SUPPORT
#if defined(NCM_LOG_SUPPORT) && !CONFIG_USB_DEVICE_CDC_NCM
#error "Error! Should define CONFIG_USB_DEVICE_CDC_NCM=1 to support ncm log"
#endif
#endif
/*********************************************/
void VideoDisplayBufInit(void);
int xVideoDisplayBufTake(uint32_t xTicksToWait);
void vVideoDisplayBufGive(void);
uint32_t ulVideoDisplayBufGet(void);
uint32_t ulVideoDisplayBufGetSize(void);
void vVideoDisplayBufRender(uint32_t buf_addr);
void vVideoDisplayBufFree(uint32_t buf_addr);
unsigned int ulVideoDisplayGetBufferAddr(int index);
#ifdef VIDEO_DECODER_RN6752
int rn6752_init(void);
#endif
#ifdef VIDEO_DECODER_ARK7116
int ark7116_init();
#endif
#ifdef SDMMC_SUPPORT
int mmcsd_core_init(void);
int mmc_init(void);
#endif
int carback_init(void);
void notify_enter_carback(void);
void notify_exit_carback(void);
int get_carback_status(void);
#endif

View File

@ -0,0 +1,20 @@
#ifndef _KEYPAD_H
#define _KEYPAD_H
#ifdef __cplusplus
extern "C" {
#endif
#define KEY_START_EVENT 1
#define KEY_STOP_EVENT 2
#define KEY_SAMPLE_EVENT 3
void KeypadInit(void);
void KeyEventHandler(UINT32 ulEvent, UINT32 lpParam, UINT32 wParam);
#ifdef __cplusplus
}
#endif
#endif

View File

@ -0,0 +1,44 @@
#ifndef _OTA_UPDATE_H
#define _OTA_UPDATE_H
#include "board.h"
typedef enum {
UPFILE_TYPE_WHOLE,
UPFILE_TYPE_RESOURCE,
UPFILE_TYPE_ANIMATION,
UPFILE_TYPE_APP,
UPFILE_TYPE_FIRSTLDR,
UPFILE_TYPE_STEPLDR,
UPFILE_TYPE_LNCHEMMC,
UPFILE_TYPE_NUM,
} eUpfileType;
static const char *g_upfilename[UPFILE_TYPE_NUM] = {
"update.bin",
"rom.bin",
"bootanim.bin",
"amt630hv100.bin",
#if DEVICE_TYPE_SELECT == EMMC_FLASH
"emmcldr.bin",
#else
"spildr.bin",
#endif
"stepldr.bin",
"lnchemmc.bin",
};
#define SF_MOUNT_PATH "/sf"
#define SDMMC_MOUNT_PATH "/sd"
#if DEVICE_TYPE_SELECT == EMMC_FLASH
#define OTA_MOUNT_PATH SDMMC_MOUNT_PATH
#else
#define OTA_MOUNT_PATH SF_MOUNT_PATH
#endif
#define UPFILE_APP_MAGIC 0xe59ff030
#define APPLDR_CHECKSUM_OFFSET 20
#define IMAGE_RW_SIZE 0x10000
int update_from_media(char *mpath, int filetype);
#endif

View File

@ -0,0 +1,93 @@
#ifndef _RINGBLK_BUF_H_
#define _RINGBLK_BUF_H_
/*
* Introduction:
* The rbb is the ring buffer which is composed with many blocks. It is different from the ring buffer.
* The ring buffer is only composed with chars. The rbb put and get supported zero copies. So the rbb
* is very suitable for put block and get block by a certain order. Such as DMA block transmit,
* communicate frame send/recv, and so on.
*/
#ifdef __cplusplus
extern "C" {
#endif
enum rbb_status
{
/* unused status when first initialize or after blk_free() */
RBB_BLK_UNUSED,
/* initialized status after blk_alloc() */
RBB_BLK_INITED,
/* put status after blk_put() */
RBB_BLK_PUT,
/* get status after blk_get() */
RBB_BLK_GET,
};
typedef enum rbb_status rbb_status_t;
/**
* the block of rbb
*/
struct rbb_blk
{
rbb_status_t status :8;
/* less then 2^24 */
size_t size :24;
uint8_t *buf;
ListItem_t list;
};
typedef struct rbb_blk *rbb_blk_t;
/**
* Rbb block queue: the blocks (from block1->buf to blockn->buf) memory which on this queue is continuous.
*/
struct rbb_blk_queue
{
rbb_blk_t blocks;
size_t blk_num;
};
typedef struct rbb_blk_queue *rbb_blk_queue_t;
/**
* ring block buffer
*/
struct rbb
{
uint8_t *buf;
size_t buf_size;
/* all of blocks */
rbb_blk_t blk_set;
size_t blk_max_num;
/* saved the initialized and put status blocks */
List_t blk_list;
};
typedef struct rbb *rbb_t;
/* rbb (ring block buffer) API */
void rbb_init(rbb_t rbb, uint8_t *buf, size_t buf_size, rbb_blk_t block_set, size_t blk_max_num);
rbb_t rbb_create(size_t buf_size, size_t blk_max_num);
void rbb_destroy(rbb_t rbb);
size_t rbb_get_buf_size(rbb_t rbb);
/* rbb block API */
rbb_blk_t rbb_blk_alloc(rbb_t rbb, size_t blk_size);
void rbb_blk_put(rbb_blk_t block);
rbb_blk_t rbb_blk_get(rbb_t rbb);
size_t rbb_blk_size(rbb_blk_t block);
uint8_t *rbb_blk_buf(rbb_blk_t block);
void rbb_blk_free(rbb_t rbb, rbb_blk_t block);
/* rbb block queue API */
size_t rbb_blk_queue_get(rbb_t rbb, size_t queue_data_len, rbb_blk_queue_t blk_queue);
size_t rbb_blk_queue_len(rbb_blk_queue_t blk_queue);
uint8_t *rbb_blk_queue_buf(rbb_blk_queue_t blk_queue);
void rbb_blk_queue_free(rbb_t rbb, rbb_blk_queue_t blk_queue);
size_t rbb_next_blk_queue_len(rbb_t rbb);
#ifdef __cplusplus
}
#endif
#endif /* _RINGBLK_BUF_H_ */

View File

@ -0,0 +1,46 @@
#ifndef _ROMFILE_H
#define _ROMFILE_H
#define ROMFILE_NAME_MAX_LEN 64
typedef struct {
char name[ROMFILE_NAME_MAX_LEN];
unsigned int offset;
unsigned int size;
} RomFileInfo;
typedef struct {
unsigned int magic;
unsigned int filenum;
unsigned int romsize;
unsigned int checksum;
RomFileInfo files[];
} RomHeader;
typedef struct {
char name[ROMFILE_NAME_MAX_LEN];
void *buf;
int cached_filenum;
int life;
} RomFileCache;
typedef struct {
void *buf;
int index;
int size;
int pos;
RomFileCache *cache;
} RomFile;
int ReadRomFile(void);
RomFile *RomFileOpen(const char *name);
size_t RomFileRead(RomFile *file, void *buf, size_t size);
int RomFileSeek(RomFile *file, int offset, int whence);
void RomFileClose(RomFile *file);
const char * RomFileGetExt(const char * path);
int RomFileTell(RomFile *file);
int RomFileGetSize(RomFile *file);
int RomFileExist(const char *name);
int RomFileDirExist(const char *name);
#endif

View File

@ -0,0 +1,58 @@
#ifndef _SOC_DAI_H
#define _SOC_DAI_H
#ifdef __cplusplus
extern "C" {
#endif
#define SND_SOC_DAIFMT_FORMAT_MASK 0x000f
#define SND_SOC_DAIFMT_CLOCK_MASK 0x00f0
#define SND_SOC_DAIFMT_INV_MASK 0x0f00
#define SND_SOC_DAIFMT_MASTER_MASK 0xf000
#define SND_SOC_DAIFMT_CBM_CFM (1 << 12) /* codec clk & FRM master */
#define SND_SOC_DAIFMT_CBS_CFM (2 << 12) /* codec clk slave & FRM master */
#define SND_SOC_DAIFMT_CBM_CFS (3 << 12) /* codec clk master & frame slave */
#define SND_SOC_DAIFMT_CBS_CFS (4 << 12) /* codec clk & FRM slave */
#define SND_SOC_DAIFMT_I2S 1 /* I2S mode */
#define SND_SOC_DAIFMT_RIGHT_J 2 /* Right Justified mode */
#define SND_SOC_DAIFMT_LEFT_J 3 /* Left Justified mode */
#define SND_SOC_DAIFMT_DSP_A 4 /* L data MSB after FRM LRC */
#define SND_SOC_DAIFMT_DSP_B 5 /* L data MSB during FRM LRC */
#define SND_SOC_DAIFMT_AC97 6 /* AC97 */
#define SND_SOC_DAIFMT_PDM 7 /* Pulse density modulation */
#define SND_SOC_DAIFMT_NB_NF (1 << 8) /* normal bit clock + frame */
#define SND_SOC_DAIFMT_NB_IF (2 << 8) /* normal BCLK + inv FRM */
#define SND_SOC_DAIFMT_IB_NF (3 << 8) /* invert BCLK + nor FRM */
#define SND_SOC_DAIFMT_IB_IF (4 << 8) /* invert BCLK + FRM */
enum snd_soc_bias_level {
SND_SOC_BIAS_OFF = 0,
SND_SOC_BIAS_STANDBY = 1,
SND_SOC_BIAS_PREPARE = 2,
SND_SOC_BIAS_ON = 3,
};
struct snd_soc_hw_params {
int rates;
int channels;
int bits;
};
struct snd_soc_dai_ops {
int (*init)(int master);
int (*hw_params)(struct snd_soc_hw_params *params);
int (*startup)(int start);
int (*set_mclk)(int freq, int dir); //reserved.
int (*set_fmt)(unsigned int fmt); //reserved.
int (*set_mute)(int mute); //reserved.
};
#ifdef __cplusplus
}
#endif
#endif /* _TOUCH_H */

View File

@ -0,0 +1,34 @@
#ifndef _SYSINFO_H
#define _SYSINFO_H
#define UPDATE_MEDIA_SD 0
#define UPDATE_MEDIA_USB 1
#define UPDATE_MEDIA_UART 2
#define UPDATE_STATUS_START 0
#define UPDATE_STATUS_END 1
typedef struct {
unsigned int app_checksum;
unsigned int stepldr_offset;
unsigned int stepldr_size;
unsigned int update_media_type;
unsigned int update_status;
unsigned int app_size;
unsigned int image_offset;
unsigned int loader_offset;
unsigned int loader_size;
unsigned int reserved[10];
unsigned int upgrade_flag;
unsigned int upgrade_appsize;
unsigned int checksum;
} SysInfo;
SysInfo *GetSysInfo(void);
int ReadSysInfo(void);
void SaveSysInfo(void);
#endif

View File

@ -0,0 +1,34 @@
#ifndef _TOUCH_H
#define _TOUCH_H
#ifdef __cplusplus
extern "C" {
#endif
typedef struct {
int x[5], xfb[5];
int y[5], yfb[5];
int a[7];
} calibration;
#define TOUCH_START_EVENT 1
#define TOUCH_STOP_EVENT 2
#define TOUCH_SAMPLE_EVENT 3
UINT32 AdjustTouch(void);
void InitializeCalibration(int a0, int a1, int a2, int a3, int a4, int a5, int a6);
int LoadTouchConfigure(void);
void TouchInit(void);
void TouchEventHandler(UINT32 ulEvent, UINT32 lpParam, UINT32 wParam);
#ifdef __cplusplus
}
#endif
#endif /* _TOUCH_H */

View File

@ -0,0 +1,26 @@
#ifndef _UPDATEFILE_H
#define _UPDATEFILE_H
#define MKTAG(a,b,c,d) ((a) | ((b) << 8) | ((c) << 16) | ((unsigned)(d) << 24))
typedef struct {
unsigned int magic;
unsigned int offset;
unsigned int size;
} UpFileInfo;
typedef struct {
unsigned int magic;
unsigned int filenum;
unsigned int size;
unsigned int checksum;
unsigned int reserved1;
unsigned int reserved2;
UpFileInfo files[];
} UpFileHeader;
int GetUpFileInfo(void);
uint32_t GetUpFileOffset(uint32_t magic);
uint32_t GetUpFileSize(uint32_t magic);
#endif