📄 buxx_setuptable.h
字号:
/* ************************************************************************ */
/* */
/* ROHM BU15xx demo firmware on MD2306 */
/* Client : ROHM Co., Ltd.丂丂丂丂丂 丂 */
/* End User : */
/* */
/* Processor: ARM-7TDMI(THUMB Mode) */
/* Dev.Env. : ARM-SDTv2.51 */
/* */
/* setup table Header */
/* */
/* file : BUxx_setuptable.h */
/* Auther : J.SATO(NTC)丂 */
/* Date : 2004/Jul./1 */
/* */
/* Copyright (c) 2002-04 Naritagiken Co., Ltd. All rights reserved. */
/* ************************************************************************ */
/* History: */
/* 2004/Jul./1 Rev 1.00 create */
/* */
/* ************************************************************************ */
#ifndef BUXX_SETUPTABLE_H_INCLUDED
#define BUXX_SETUPTABLE_H_INCLUDED
#include "kernel/system.h"
//#include "hw/bu1568.h"
#ifdef SYS_SUPPORT
#include "MD2306_sys.h"
#include "BUxx_usb.h"
#else
//#include "serial.h"
#endif
/* ************************************************** */
/* DEFINES */
/* ************************************************** */
#if 0
typedef unsigned int UINT;
typedef unsigned char UINT8;
typedef unsigned short UINT16;
typedef unsigned long UINT32;
//typedef char STRING;
typedef char INT8;
typedef short INT16;
typedef long INT32;
//typedef int INT;
#endif
typedef struct{
UINT16 xsize;
UINT16 ysize;
UINT16 st_x;
UINT16 st_y;
}LCDSET;
typedef struct{
UINT16 xsize;
UINT16 ysize;
UINT16 cst_x;
UINT16 cst_y;
UINT16 srkx;
UINT16 srky;
UINT16 mst_x;
UINT16 mst_y;
UINT16 rot_h_vflip;
}CAMSET;
typedef struct{ // Huffman table
UINT8 cod[16];
UINT8 val[1];
}HTABLE;
typedef struct{ // Q table
UINT16 table[8][8];
}QTABLE;
typedef struct{ // header information
UINT16 X;
UINT16 Y;
UINT16 interval;
UINT8 type; // 0:444, 1:422, 2:411, 3:420, 4:gray
HTABLE *h_y_dc;
HTABLE *h_y_ac;
HTABLE *h_c_dc;
HTABLE *h_c_ac;
QTABLE *q_y;
QTABLE *q_c;
UINT8 *cmprs_code;
UINT32 code_size;
}JPEG_INFO;
typedef struct{
UINT8 *win_left;
UINT8 *win_st;
UINT8 *win_ed;
UINT32 sizeToSave;
UINT32 mjSize;
UINT32 fileOffset; // for flash op
UINT32 bufLimit;
}MJMOVWIN;
//-------------------------------------------
//*******************************************
// Fixed number definition *
//*******************************************
//-------------------------------------------
//-------------------------------------------
//*******************************************
// user definition丂 *
//*******************************************
//-------------------------------------------
//for debug
#define DEBUG_N
#define NON_INTERRUPT
//#define SYS_SUPPORT
#define SIMPLE_SUPPORT // DSAMPLE_SUPPORT
#ifdef SYS_SUPPORT
#define USB_SUPPORT
#define KEYBOARD_SUPPORT
#define MENU_SUPPORT
#endif
//*******************************************
// CHIP is set up *
//*******************************************
#define BU1594 0x0000
#define BU1593 0x0001
#define BU1560 0x000a
#define BU1561 0x000b
#define BU1563 0x000c
#define BU1566 0x0012
#define BU1565 0x000c
#define BU1580 0x000d
#define BU1581 0x000e
#define BU1555 0x0013
#define BU1554 0x0016
#define BU1569 0x001f
#define UNKNOWN 0xffff
//#define LCDBUS_8BIT
#define BU15xx_PRODUCT_ID BU1561
//#define BUSACCESS_BIT 16 //or 8
#define BUSACCESS_BIT 8 //or 8
//*******************************************
// bu15xx access setup *
//*******************************************
#if (BUSACCESS_BIT == 16)
#define LCD_PTR_TYPE volatile UINT16*
#else
#define LCD_PTR_TYPE volatile UINT8 far *
#endif
#ifdef SYS_SUPPORT
#define LCD_CMD_WRITE (LCD_PTR_TYPE)0x003fff00
#define LCD_PDAT_WRITE (LCD_PTR_TYPE)0x003fff02
#define INDEX_ACCESS (LCD_PTR_TYPE)0x003fff04
#define REG_ACCESS (LCD_PTR_TYPE)0x003fff06
#else // D-Sample Bus Address
#define LCD_CMD_WRITE (LCD_PTR_TYPE)(BU1568_REG0 + 0x10000L)
#define LCD_PDAT_WRITE (LCD_PTR_TYPE)(BU1568_REG1 + 0x10000L)
#define INDEX_ACCESS (LCD_PTR_TYPE)(BU1568_REG2 + 0x10000L)
#define REG_ACCESS (LCD_PTR_TYPE)(BU1568_REG3 + 0x10000L)
#endif
// extern device definition
//#define MAIN_TMD_LTM018A02A
#define MAIN_TMD_LTM022A05D
//#define MAIN_NEC_502i
//#define MAIN_TRULY_LDS183A
//#define MAIN_NANYA_KA5AH0650
//#define MAIN_PHILIPS_PCF8837
//#define MAIN_TRULY_S6B33B2
//#define MAIN_TRULY_HD66777
//#define MAIN_TRULY_8205C
//#define MAIN_TFS_HD66773 // TFS = Three-Five System
//#define MAIN_WINTEK_HD66774 // WinTek
//#define MAIN_WINTEK_HX8303A
//#define MAIN_DTC_HD66773R
//#define MAIN_538B_S6B33B3A
//#define MAIN_S6B22B2
//#define MAIN_ROHM_BU98030
//#define MAIN_ROHM_BU98664
//#define SUB_TMD_LTM018A02A
//#define SUB_NEC_502i
//#define SUB_SOLOMON_SSD1788
#define SUB_ROHM_BU98570
// -------------- VGA camera 640x480-----------------
//#define ROHM_CSV1061 // VGA 640x480
//#define ROHM_CSV1411 // VGA 640x480
//#define OMNIVISION_OV7648 // VGA 640x480 , same as OV7649
//#define OMNIVISION_OV7660 // VGA 640x480
//#define MICRON_MT9V111 // VGA 640x480
//#define SAMSUNG_S5K53B // VGA 640x480
//#define HYNIX_HY7131 // VGA 640x480
// -------------- SVGA camera 1280x960 -----------------
//#define OMNIVISION_OV9540 // SVGA 1280x960, same as OV9640
//#define HYNIX_HY7161 // SVGA 1280x960
//#define ROHM_CSS1601 // SVGA 1280x960
// -------------- SXGA camera 1280x1024 -----------------
//#define ROHM_CSS1381 // SXGA 1280x1024 ( OK to VGA )
//#define ROHM_CSS1731 //
//#define MICRON_MT9M111 // SXGA 1280x1024 ( OK to VGA )
//#define ROHM_CSS1471 // SXGA 1280x1024 ( OK to VGA )
//#define ROHM_CSS1571 // SXGA 1280x1024
#define OMNIVISION_OV9650 // SXGA 1280x1024 ( OK to VGA )
//#define OMNIVISION_OV9655 // SXGA 1280x1024 ( OK to VGA )
//#define MICRON_WAEM111 // SXGA 1280x1024( OK to VGA )
//#define SAMSUNG_S5K3AA // SXGA 1280x1024
// -------------- UGA camera 1600x1200 -----------------
//#define OMNIVISION_OV2620 // need extern ISP support, like BU1554
//#define ROHM_CSU1661
//#define OMNIVISION_OV2630 // need extern ISP support, like BU1554
//#define MICRON_MI2010 // need extern ISP support, like BU1554
#if defined OMNIVISION_OV2620
|| defined OMNIVISION_OV2630
|| defined MICRON_MI2010
#define ISP_ENABLE
#endif
#if ( BU15xx_PRODUCT_ID == BU1554 )
#define CAM_SIZE_QXGA // 3.0 mega
#define maxCAMWIDTH 2048
#define maxCAMHEIGHT 1536
#elif ( BU15xx_PRODUCT_ID == BU1569 )
#define CAM_SIZE_UGA // 2.0 mega
#define maxCAMWIDTH 1600
#define maxCAMHEIGHT 1200
#elif ( BU15xx_PRODUCT_ID == BU1560 ) || \
( BU15xx_PRODUCT_ID == BU1561 ) || \
( BU15xx_PRODUCT_ID == BU1580 )
//#define CAM_SIZE_SXGA // 1.3 mega
//#define maxCAMWIDTH 1280
//#define maxCAMHEIGHT 1024
#define CAM_SIZE_VGA
#define maxCAMWIDTH 640
#define maxCAMHEIGHT 480
#elif ( BU15xx_PRODUCT_ID == BU1594 ) || \
( BU15xx_PRODUCT_ID == BU1563 ) || \
( BU15xx_PRODUCT_ID == BU1566 ) || \
( BU15xx_PRODUCT_ID == BU1565 )
#define CAM_SIZE_VGA // 300 K
#define maxCAMWIDTH 640
#define maxCAMHEIGHT 480
#else
#define CAM_SIZE_VGA
#define maxCAMWIDTH 640
#define maxCAMHEIGHT 480
#endif
#define LCD_INDIRECT_WRITE_N
/* ************************************************** */
/* INCLUDE FILES */
/* ************************************************** */
//#include "kernel/system.h"
#include "bu1568/BUxx_mem.h"
#include "bu1568/BUxx_DRV.h"
//*******************************************
// System is set up *
//*******************************************
//HOST_END bigendian or littleendian is set up
//#define ENDIAN sLITTLE_END //or BIG_END
#define ENDIAN sBIG_END //or BIG_END
//hwmode register host_type setup
#define HOST_TYPE sHELEN //or sTRIDENT
#define VBUF_ON sVBUF_ON //or sVBUF_ON //BU1561.BU1580
#define ACC_MODE sACC_MODE0 //or sACC_MODE1 //BU1561,BU1580
#define FRM_PRT sFRM_PRT_OFF //or sFRM_PRT_ON //BU1561
//clock setup
#define LCDFRSRC sLCDFR1_4096 //or sLCDFR1_64 //BU1563
#define LCD_BASE_TIMING sLCDFR //or sVD
#define VDEDG_SEL sVDEDG_DOWN //or sVEDG_UP
#define VD_EN sGIO6_ENABLE //or sVD_ENABLE
#define SCLK_DIV 0x0000 // 0x0000
#define LCDFR_DIV 0x0000
#define LCDFR_DELAY 0x0001 // hyke 20050803 BU1561 preview abnormally when LCDFR_DELAY = 1
#define CAMCKO_DIV 0x0000 // 0
#define ACTSW sCAMCKIx1 //or sCAMCKIx1 //BU1561,BU1580
#define CAMCLKO_DLY sDLY_NO //or sDLY_7NS //BU1561,BU1580
//interrupt setup
#define INT_SEL sEDGE //or sLEVEL
#define INT_POL sLOW_INT //or sHIGH_INT
//led setup
#define LEDCNT_EN sLEDCNT_DISABLE //or sLEDCNT_ENABLE
#define LEDCNT_POL sLEDCNT_L //or sLEDCNT_H
//JPEG quantization ratio
#define JE_CNT_Q 0x000d // BU1561,60,63=20step
//*******************************************
// Main LCD is set up *
//*******************************************
//LCD WRITE COMMAND is set up
#if defined MAIN_TMD_LTM018A02A
#define M_EXCMD 1
#define WRITE_COMMAND 0x0e00
//Main LCD Transfer wave shape is set up
#define LCD_DELAY sNO_DELAY//or sNO_DELAY, sDELAY10MS, sDELAY1SCLK, sDELAY10NS //BU1563
#define M_LCDWL 0x03
#define M_LCDWH 0x03
//Main LCD size is set up
#define M_LCD_WSIZE 128 // 176
#define M_LCD_HSIZE 160 // 232
//Main LCD Resolution is set up
#define M_LCD_CTYPE sC565B16A1 // 65kcolor 5r6g5b 16bit 1pix/1.0cycle
#elif defined MAIN_TMD_LTM022A05D
#define M_EXCMD 1
#define WRITE_COMMAND 0x0e00
//Main LCD Transfer wave shape is set up
#define LCD_DELAY sNO_DELAY //or sDELAY10MS, sDELAY1SCLK, sDELAY10NS //BU1563
#define M_LCDWL 0x03
#define M_LCDWH 0x03
//Main LCD size is set up
#define M_LCD_WSIZE 176
#define M_LCD_HSIZE 220
//Main LCD Resolution is set up
#define M_LCD_CTYPE sC565B16A1 // 65kcolor 5r6g5b 16bit 1pix/1.0cycle
#elif defined MAIN_NEC_502i || defined MAIN_TRULY_HD66777 || \
defined MAIN_TFS_HD66773 || defined MAIN_WINTEK_HD66774
#define M_EXCMD 1
#define WRITE_COMMAND 0x0022
//Main LCD Transfer wave shape is set up
#define LCD_DELAY sNO_DELAY //or sDELAY10MS, sDELAY1SCLK, sDELAY10NS //BU1563
#define M_LCDWL 0x05
#define M_LCDWH 0x05
//Main LCD size is set up
#define M_LCD_WSIZE 160
#define M_LCD_HSIZE 216
//Main LCD Resolution is set up
#define M_LCD_CTYPE sC565B16A1 // 65kcolor 5r6g5b 16bit 1pix/1.0cycle
#elif defined MAIN_PICVUE_HD66789
#define M_EXCMD 1
#define WRITE_COMMAND 0x0022
//Main LCD Transfer wave shape is set up
#define LCD_DELAY sNO_DELAY //sDELAY10MS //or sNO_DELAY sDELAY10MS, sDELAY1SCLK, sDELAY10NS //BU1563
#define M_LCDWL 0x05
#define M_LCDWH 0x05
//Main LCD size is set up
#define M_LCD_WSIZE 176
#define M_LCD_HSIZE 220
//Main LCD Resolution is set up
#define M_LCD_CTYPE sC565B16A1 // 65kcolor 5r6g5b 16bit 1pix/1.0cycle
#elif defined MAIN_VP_HD66789R
#define M_EXCMD 2
#define WRITE_COMMAND 0x0022
//Main LCD Transfer wave shape is set up
#define LCD_DELAY sDELAY10MS //orsNO_DELAY sDELAY10MS, sDELAY1SCLK, sDELAY10NS //BU1563
#define M_LCDWL 0x05
#define M_LCDWH 0x05
//Main LCD size is set up
#define M_LCD_WSIZE 176
#define M_LCD_HSIZE 220
//Main LCD Resolution is set up
#define M_LCD_CTYPE sC666B9A2 // 65kcolor 5r6g5b 16bit 1pix/1.0cycle
//#define M_LCD_CTYPE sC565B16A1 // 65kcolor 5r6g5b 16bit 1pix/1.0cycle
#elif defined MAIN_WINTEK_HX8303A
#define M_EXCMD 1
#define WRITE_COMMAND 0x0022
//Main LCD Transfer wave shape is set up
#define LCD_DELAY sNO_DELAY //or sDELAY10MS, sDELAY1SCLK, sDELAY10NS //BU1563
#define M_LCDWL 0x07
#define M_LCDWH 0x07
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -