You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
190 lines
4.6 KiB
190 lines
4.6 KiB
1 year ago
|
////////////////////////////////////////////////////////////////////////////
|
||
|
///@copyright Copyright (c) 2018, ���ؿƼ� All rights reserved.
|
||
|
///-------------------------------------------------------------------------
|
||
|
/// @file bsp_gc6133.c.h
|
||
|
/// @brief bsp @ driver config
|
||
|
///-------------------------------------------------------------------------
|
||
|
/// @version 1.0
|
||
|
/// @author CC
|
||
|
/// @date 20180331
|
||
|
/// @note cc_AS_stc02
|
||
|
|
||
|
//////////////////////////////////////////////////////////////////////////////
|
||
|
|
||
|
#ifndef _bsp_cam_H
|
||
|
#define _bsp_cam_H
|
||
|
|
||
|
#include "../bsp/bsp_config.h"
|
||
|
|
||
|
#include "../tpc/tpc_uart.h"
|
||
|
|
||
|
#include "../msp/uart0.h"
|
||
|
|
||
|
#include "bsp_gc032a.h"
|
||
|
|
||
|
//>>>>>>>>>>>>>>>>>>>>>0gc63xxtask
|
||
|
|
||
|
//#define D_i2c_addr_gc61xx 0x80 //page8/30 @pdf
|
||
|
#define D_i2c_addr_gc032A 0x42 //page15/31 @pdf
|
||
|
///// 400KHz Tlow > 1.3us
|
||
|
#define L0_GC032A_write(R,D) L2_I2C_WriteCmd(D_i2c_addr_gc032A,(R),(D))
|
||
|
#define L0_GC032A_read(R,D,N) L2_I2C_ReadReg(D_i2c_addr_gc032A,(R),(D),(N))
|
||
|
#define L0_GC032A_reg(R,D) L2_tws_ReadReg(D_i2c_addr_gc032A,(R),(D))
|
||
|
|
||
|
/// p55 pwdn
|
||
|
/// p54 inclk
|
||
|
/// p3.7 vsync
|
||
|
/// p3.6 hsync
|
||
|
#if 0
|
||
|
#define L0_GC032A_work() D_P55_OFF();
|
||
|
#define L0_GC032A_standby()
|
||
|
|
||
|
#else
|
||
|
#define L0_GC032A_work() D_P55_OFF();D_stdIO_P1_ALL();\
|
||
|
D_stdIO_P5(BITN4);\
|
||
|
D_stdIO_P5(BITN5);\
|
||
|
D_stdIO_P3(BITN7);\
|
||
|
D_stdIO_P3(BITN6);
|
||
|
#define L0_GC032A_standby() D_HighR_P1_ALL();\
|
||
|
D_HighI_P5(BITN4);\
|
||
|
D_HighI_P5(BITN5);\
|
||
|
D_HighI_P3(BITN7);\
|
||
|
D_HighI_P3(BITN6);D_P55_ON();
|
||
|
///pwdn 100uAD_P55_OFF();//
|
||
|
|
||
|
|
||
|
#endif
|
||
|
|
||
|
|
||
|
|
||
|
#define GC6123_SERIAL_write_cmos_sensor L0_GC032A_write
|
||
|
|
||
|
///#define D_pclk_per_hs 628
|
||
|
///#define D_pclk_per_hs 688
|
||
|
#define D_pclk_per_hs 639 ///027F
|
||
|
|
||
|
#define D_pclk_per_hs_570 570
|
||
|
|
||
|
//#define D_pclk_per_hs 580
|
||
|
|
||
|
#define D_pclk_per_hs_2 D_pclk_per_hs
|
||
|
///#define D_pclk_per_hs_2 (110)
|
||
|
|
||
|
//#define D_pclk_per_hs 6
|
||
|
|
||
|
struct _s_task_GC032A_
|
||
|
{
|
||
|
TS_task task;
|
||
|
/// vU32 t_stamp;
|
||
|
unsigned short lines; ///��ǰ�в�������
|
||
|
unsigned short frames; ///��ǰ�в�������
|
||
|
|
||
|
unsigned char next_line:1; ///��һ�в�����ʼ
|
||
|
unsigned char cal_ok:1; ///��ǰ�в�������//
|
||
|
unsigned char lamp:1; ///��ǰ�Ƶı�־
|
||
|
unsigned char line_get:1; ///��ǰ��Ҫ���в������� ���Լ�����
|
||
|
unsigned char line_ok:1; /// �����Ŀ���
|
||
|
unsigned char vs_ok:1; /// ��ʼһ֡�IJ��� �����յ���vs�ź�
|
||
|
unsigned char line_onf:2; /// D_line_onf_get=0������Ҫ���͵�һ��line\\ D_line_onf_all=1 ��������line
|
||
|
|
||
|
|
||
|
// volatile unsigned short usHs_count;
|
||
|
// volatile unsigned short usPclk;
|
||
|
unsigned char buf2_ok;
|
||
|
|
||
|
/// volatile unsigned short usN;
|
||
|
////// unsigned short usMax;
|
||
|
unsigned char buf[D_pclk_per_hs +2];
|
||
|
};
|
||
|
#define D_line_onf_all 1
|
||
|
#define D_line_onf_get 0
|
||
|
|
||
|
|
||
|
extern struct _s_task_GC032A_ s_task_GC032A;
|
||
|
|
||
|
|
||
|
void L2_task_GC032A_init(void);
|
||
|
|
||
|
#define D_task_GC032A_init_standby 0x36
|
||
|
|
||
|
#define D_task_GC032A_init_DVDD 0x30
|
||
|
#define D_task_GC032A_init_AVDD 0x31
|
||
|
#define D_task_GC032A_init_pwdn 0x32
|
||
|
#define D_task_GC032A_init_pwdn_wait 0x33
|
||
|
|
||
|
|
||
|
#define D_task_FLOW_PreSend 0xa3
|
||
|
#define D_task_FLOW_PreSend2 0xa4
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
#define D_task_FLOW_send 0x90
|
||
|
#define D_task_FLOW_send2 0x91
|
||
|
#define D_task_FLOW_send3 0x92
|
||
|
#define D_task_FLOW_send4 0x93
|
||
|
#define D_task_FLOW_send5 0x94
|
||
|
|
||
|
|
||
|
|
||
|
#define D_task_GC032A_write_reg 0x40
|
||
|
#define D_task_GC032A_wakup_sample 0x41
|
||
|
#define D_task_GC032A_start_time2 0x43
|
||
|
|
||
|
#define D_task_GC032A_wakup_sample2 0x44
|
||
|
|
||
|
|
||
|
#define D_task_GC032A_wait 0x51
|
||
|
#define D_task_GC032A_one_frame 0x52
|
||
|
#define D_task_GC032A_write_reg2 0x53
|
||
|
#define D_task_GC032A_div 0x54
|
||
|
#define D_task_GC032A_dat 0x55
|
||
|
|
||
|
|
||
|
#define D_task_GC032A_led 0x56
|
||
|
|
||
|
|
||
|
|
||
|
#define D_task_GC032A_send_line 0x61
|
||
|
#define D_task_GC032A_send2 0x62
|
||
|
#define D_task_GC032A_send3 0x63
|
||
|
#define D_task_GC032A_send4 0x64
|
||
|
|
||
|
////#define D_task_GC032A_over 0x63
|
||
|
#define D_task_GC032A_cal 0x65
|
||
|
///#define D_task_GC032A_send_over 0x64
|
||
|
|
||
|
#define D_task_GC032A_sleep 0x67
|
||
|
#define D_task_GC032A_06 0x68
|
||
|
#define D_task_GC032A_07 0x69
|
||
|
#define D_task_GC032A_08 0x6a
|
||
|
#define D_task_GC032A_09 0x6b
|
||
|
|
||
|
#define D_task_GC032A_sample 0x68
|
||
|
|
||
|
#define D_task_GC032A_end 0x69
|
||
|
|
||
|
#define D_task_GC032A_next_line 0x70
|
||
|
|
||
|
|
||
|
extern void L2_task_GC032A_handle(struct _s_task_GC032A_ *s);
|
||
|
extern void L2_task_GC032A_handleTest(struct _s_task_GC032A_ *s);
|
||
|
|
||
|
|
||
|
////////////////////////////////////////////////////////////////////
|
||
|
|
||
|
|
||
|
extern void GC032A_port_init(void);
|
||
|
extern void L3_GC032A_fun(U8 *pPara);
|
||
|
|
||
|
extern void L1_GC032A_sleep(unsigned char onf);
|
||
|
|
||
|
#define D_cam_led_on(); L1_cw63_reg_set(D_power_VCC2,D_CW63XX_ON|D_CW63XX_3V2);//P34 = 1;/////s_task_GC032A.lamp = D_ON;
|
||
|
#define D_cam_led_off(); L1_cw63_reg_set(D_power_VCC2,D_CW63XX_OFF|D_CW63XX_3V2);///P34 = 0;/////s_task_GC032A.lamp = D_OFF;
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
#endif // #ifndef _bsp_gc6133_H
|
||
|
|