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.
210 lines
5.4 KiB
210 lines
5.4 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 "msp_uart1.h"
|
||
|
|
||
|
#include "TTSS_task.h"
|
||
|
|
||
|
#include "bsp_gc032a.h"
|
||
|
|
||
|
#include "msp_iicMx.h"
|
||
|
|
||
|
//>>>>>>>>>>>>>>>>>>>>>0gc63xxtask
|
||
|
|
||
|
//#define D_i2c_addr_gc61xx 0x80 //page8/30 @pdf
|
||
|
#define D_i2c_addr_gc032A 0x42 //page15/31 @pdf
|
||
|
#define D_0xfa 0x33
|
||
|
|
||
|
|
||
|
///16 2ms 921600bps发送一帧数据耗时640*0.1/4 = 8ms
|
||
|
///8 1ms 921600bps发送一帧数据耗时640*0.1/4 = 8ms
|
||
|
|
||
|
///921600bps 92,160Byte 92B/ms 1ms发送90Bytes
|
||
|
////640 / 90 = 6.9ms
|
||
|
///640x480 = 307,200 307200 / 90 = 3,333ms = 3.3s = 6.9msx480
|
||
|
|
||
|
////div = 16 每1/480行数据 采样耗时 2ms 那么发送 1s多发送一帧画面(640x480) 发送一行(640点)的时间为6.9ms
|
||
|
/// div = 16 发送就是4等份
|
||
|
|
||
|
|
||
|
///div = 8 0.5ms 一帧 发送8等分
|
||
|
#define MCLKOCR_P54 0
|
||
|
#define MCLKOCR_P16 BITN7
|
||
|
|
||
|
#define D_cam_speed 16
|
||
|
|
||
|
|
||
|
#if(D_cam_speed == 16)
|
||
|
|
||
|
#define D_480_div 8 //// 和MCLKOCR_DIV关联
|
||
|
//#define D_row_max 640
|
||
|
#define MCLKOCR_DIV D_cam_speed//4分频 需要测试 16 = 1.2svs 4= 300ms 32不出数据
|
||
|
|
||
|
#elif(D_cam_speed == 8)
|
||
|
#define D_480_div 4 //// 和MCLKOCR_DIV关联
|
||
|
//#define D_row_max 640
|
||
|
#define MCLKOCR_DIV D_cam_speed//4分频 需要测试 16 = 1.2svs 4= 300ms 32不出数据
|
||
|
|
||
|
#elif(D_cam_speed == 4)
|
||
|
#define D_480_div 4 //// 和MCLKOCR_DIV关联
|
||
|
//#define D_row_max 640
|
||
|
#define MCLKOCR_DIV D_cam_speed//4分频 需要测试 16 = 1.2svs 4= 300ms 32不出数据
|
||
|
|
||
|
#elif(D_cam_speed == 2)
|
||
|
|
||
|
#define D_480_div 96 //// 和MCLKOCR_DIV关联
|
||
|
//#define D_row_max 640
|
||
|
#define MCLKOCR_DIV D_cam_speed//4分频 需要测试 16 = 1.2svs 4= 300ms 32不出数据
|
||
|
|
||
|
|
||
|
#endif
|
||
|
|
||
|
|
||
|
#define L0_GC032A_write(R,D) L2_IICMx_WriteCmd(D_iicch_gc032a,D_i2c_addr_gc032A,(R),(D))////L2_I2C_WriteCmd(D_i2c_addr_gc032A,(R),(D))
|
||
|
#define L0_GC032A_read(R,D,N) L2_IICMx_ReadReg(D_iicch_gc032a,D_i2c_addr_gc032A,(R),(D),(N))/// L2_I2C_ReadReg(D_i2c_addr_gc032A,(R),(D),(N))
|
||
|
|
||
|
#define L0_GC032A_reg(R,D) L2_tws_ReadReg(D_iicch_gc032a,D_i2c_addr_gc032A,(R),(D))
|
||
|
|
||
|
|
||
|
#define L0_GC032A_work() D_P35_OFF();
|
||
|
#define L0_GC032A_standby() D_P35_ON();//fixme D_P55_ON();
|
||
|
///Sensor power down control:0: normal work 1: standby
|
||
|
|
||
|
///#define L0_GC032A_RCLK() D_P35_OFF();D_P35_ON(); //������������λ��74hc595�洢����
|
||
|
///#define L0_GC032A_RCLK_ok() D_P35_OFF();
|
||
|
|
||
|
|
||
|
#define GC6123_SERIAL_write_cmos_sensor L0_GC032A_write
|
||
|
//#define D_row_max 640
|
||
|
//#define D_row_max 680
|
||
|
///#define D_row_max 510
|
||
|
#define D_row_max 1200
|
||
|
|
||
|
|
||
|
extern vU16 data gdataUs02,gdataUs03,gdataUs05;
|
||
|
/******
|
||
|
///
|
||
|
gRccUs03,
|
||
|
gRccUs01_H,//
|
||
|
gRccUs01_L,
|
||
|
gRccUs04,////
|
||
|
;//
|
||
|
|
||
|
******/
|
||
|
|
||
|
|
||
|
typedef struct
|
||
|
{
|
||
|
vU16 pclk_n;
|
||
|
vU16 hs_n;
|
||
|
|
||
|
|
||
|
}TS_clk_;
|
||
|
extern TS_clk_ data ts_clk;
|
||
|
typedef struct
|
||
|
{
|
||
|
TS_task task;
|
||
|
/// vU32 t_stamp;
|
||
|
vU16 pclk_max;
|
||
|
vU16 HS_max;
|
||
|
vU16 VS_max;
|
||
|
//// vU16 HS_max;
|
||
|
|
||
|
vU16 HS_n;
|
||
|
//// vU16 pclk_n;
|
||
|
vU16 pclk_m;
|
||
|
|
||
|
vU16 HS[481];
|
||
|
|
||
|
u8 hs_ok;
|
||
|
|
||
|
|
||
|
u8 vs_ok;
|
||
|
|
||
|
u8 m;
|
||
|
|
||
|
unsigned char status;
|
||
|
// volatile unsigned short usHs_count;
|
||
|
// volatile unsigned short usPclk;
|
||
|
//volatile unsigned short up_point;
|
||
|
//volatile unsigned short down_point;
|
||
|
/// unsigned char line_onf;
|
||
|
unsigned char fisrt;
|
||
|
/// volatile unsigned short usN;
|
||
|
////// unsigned short usMax;
|
||
|
unsigned char buf[4][D_row_max +2];
|
||
|
}TS_task_GC032A_;
|
||
|
extern TS_task_GC032A_ ts_task_GC032a;
|
||
|
|
||
|
void L2_task_GC032A_init(void);
|
||
|
|
||
|
#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_GC032A_write_reg 0x40
|
||
|
#define D_task_GC032A_start_time 0x41
|
||
|
#define D_task_GC032A_wait 0x42
|
||
|
|
||
|
|
||
|
#define D_task_GC032A_div 0x43
|
||
|
|
||
|
#define D_task_GC032A_dat 0x34
|
||
|
|
||
|
#define D_task_GC032A_send_line 0x35
|
||
|
#define D_task_GC032A_send1 0x55
|
||
|
|
||
|
#define D_task_GC032A_send2 0x36
|
||
|
#define D_task_GC032A_send3 0x37
|
||
|
#define D_task_GC032A_send4 0x38
|
||
|
#define D_task_GC032A_send5 0x39
|
||
|
|
||
|
////#define D_task_GC032A_over 0x63
|
||
|
#define D_task_GC032A_cal 0x63
|
||
|
#define D_task_GC032A_433 0x64
|
||
|
|
||
|
#define D_task_GC032A_sleep 0x67
|
||
|
|
||
|
void L2_task_GC032A_handle(TS_task_GC032A_ *s);
|
||
|
|
||
|
#define D_cam_led_on(); LED3 = 1;////L2_I2C_WriteCmd(D_i2c_addr_cw63xx,D_power_VCC2,D_CW63XX_ON|D_CW63XX_3V2);
|
||
|
#define D_cam_led_off(); LED3 = 0;//L2_I2C_WriteCmd(D_i2c_addr_cw63xx,D_power_VCC2,D_CW63XX_OFF|D_CW63XX_2V8);
|
||
|
|
||
|
|
||
|
#define D_cam_DVDD_on(); ///LED3 = 1;//L2_I2C_WriteCmd(D_i2c_addr_cw63xx,D_power_VCC,D_CW63XX_ON|D_CW63XX_2V8);
|
||
|
#define D_cam_DVDD_off(); //L2_I2C_WriteCmd(D_i2c_addr_cw63xx,D_power_VCC,D_CW63XX_OFF|D_CW63XX_2V8);
|
||
|
|
||
|
#define D_cam_AVDD_on(); ///L2_I2C_WriteCmd(D_i2c_addr_cw63xx,D_power_VCC3,D_CW63XX_ON|D_CW63XX_2V8);
|
||
|
#define D_cam_AVDD_off(); ////L2_I2C_WriteCmd(D_i2c_addr_cw63xx,D_power_VCC3,D_CW63XX_OFF|D_CW63XX_2V8);
|
||
|
|
||
|
|
||
|
////////////////////////////////////////////////////////////////////
|
||
|
|
||
|
|
||
|
////extern TS_P_rf TS_paer_value;
|
||
|
|
||
|
void GC032A_port_init(void);
|
||
|
void L3_GC032A_fun(U8 *pPara);
|
||
|
void L1_GC032A_sleep(unsigned char onf);
|
||
|
void L3_GC032A_debug(u8 filter);
|
||
|
|
||
|
|
||
|
#endif // #ifndef _bsp_gc6133_H
|
||
|
|