-
Notifications
You must be signed in to change notification settings - Fork 1
/
sensor.h
175 lines (145 loc) · 4.55 KB
/
sensor.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
/*
## Cypress FX3 Camera Kit header file (sensor.h)
## ===========================
##
## Copyright Cypress Semiconductor Corporation, 2010-2012,
## All Rights Reserved
## UNPUBLISHED, LICENSED SOFTWARE.
##
## CONFIDENTIAL AND PROPRIETARY INFORMATION
## WHICH IS THE PROPERTY OF CYPRESS.
##
## Use of this file is governed
## by the license agreement included in the file
##
## <install>/license/license.txt
##
## where <install> is the Cypress software
## installation root directory path.
##
## ===========================
*/
/* This file defines the parameters and the interface for the EV76C541 image
sensor driver.
*/
#ifndef _INCLUDED_SENSOR_H_
#define _INCLUDED_SENSOR_H_
#include <cyu3types.h>
/* The SADDR line allows EV76C541 image sensor to select between two different I2C slave address.
If the SADDR line is high, enable this #define to allow access to the correct I2C address for the sensor.
*/
/* I2C Slave address for the image sensor. */
#define SENSOR_ADDR_WR 0xB8 /* Slave address used to write sensor registers. */
#define SENSOR_ADDR_RD 0xB9 /* Slave address used to read from sensor registers. */
/* GPIO 20 on FX3 is used as SYNC output -- high during FV */
#define SENSOR_SYNC_GPIO 20
#define SENSOR_REG_CHIP_ID 0
#define SENSOR_REG_SOFT_RESET_ANALOG 10
#define SENSOR_REG_SEQ_GEN_CONFIG 192
#define SENSOR_REG_MULT_TIMER0 199
#define SENSOR_REG_FR_LENGTH0 200
#define SENSOR_REG_EXPOSURE0 201
#define SENSOR_REG_ANALOG_GAIN 204
#define SENSOR_REG_SYNC_CONFIG 206
#define SENSOR_REG_ROI0_X_CONFIG 256
#define SENSOR_REG_ROI0_Y_CONFIG 257
#define SENSOR_REG_ROI1_X_CONFIG 258
#define SENSOR_REG_ROI1_Y_CONFIG 259
#define SENSOR_REG_ROI_CONFIG_LSB0 264
#define SENSOR_REG_ROI_CONFIG_LSB1 265
#define SENSOR_REG_ROI_SELECTION 195
#define SENSOR_A_GAIN_TRANSL_1X 1
#define SENSOR_A_GAIN_TRANSL_2X 2
#define SENSOR_A_GAIN_TRANSL_3_5X 3
#define SENSOR_ROI0 1
#define SENSOR_ROI1 2
/* Communication over saturation channel */
#define SATURATION_RECORD_START 0x01
#define SATURATION_RECORD_END 0x02
#define SATURATION_INIT 0x03
#define SATURATION_FPS5 0x11
#define SATURATION_FPS10 0x12
#define SATURATION_FPS15 0x13
#define SATURATION_FPS20 0x14
#define SATURATION_FPS30 0x15
#define SATURATION_FPS60 0x16
#define SATURATION_ROI0 0x17
#define SATURATION_ROI1 0x18
extern CyU3PReturnStatus_t
SensorConfigureRoi1(
void);
extern CyU3PReturnStatus_t
SensorConfigureRoi2(
void);
extern CyU3PReturnStatus_t
SensorInit (
void);
extern CyU3PReturnStatus_t
SensorStart (
void);
extern CyU3PReturnStatus_t
SensorStop (
void);
/* Function : SensorIsOn
Description : Check to see if the sensor is on
Parameters : None
*/
extern CyU3PReturnStatus_t
SensorIsOn (
CyBool_t *isOn);
extern CyU3PReturnStatus_t
SensorDisable (
void);
/* Function : SensorScaling_HD720p_30fps
Description : Configure the EV76C541 sensor for 720p 30 fps video stream.
Parameters : None
*/
extern CyU3PReturnStatus_t
SensorScaling_288_288_120fps (
void);
/* Function : SensorI2CBusTest
Description : Test whether the EV76C541 sensor is connected on the I2C bus.
Parameters : None
*/
/* Function : SensorScaling_HD720p_30fps
Description : Configure the EV76C541 sensor for 720p 30 fps video stream.
Parameters : None
*/
extern CyU3PReturnStatus_t
SensorScaling_608_608_30fps (
void);
/* Function : SensorI2CBusTest
Description : Test whether the EV76C541 sensor is connected on the I2C bus.
Parameters : None
*/
extern CyU3PReturnStatus_t
SensorI2CBusTest (
CyBool_t *connected);
/* Function : SensorGetGain
Description : Get the current gain setting from the EV76C541 sensor.
Parameters : None
*/
extern CyU3PReturnStatus_t
SensorGetGain (
uint8_t *translated_gain);
/* Function : SensorSetGain
Description : Set the desired gain setting on the EV76C541 sensor.
Parameters :
gain - Desired gain level.
*/
extern CyU3PReturnStatus_t
SensorSetGain (
uint8_t new_translated_gain);
extern CyU3PReturnStatus_t
SensorGetRoi (
uint8_t *translated_gain);
/* Function : SensorSetGain
Description : Set the desired gain setting on the EV76C541 sensor.
Parameters :
gain - Desired gain level.
*/
extern CyU3PReturnStatus_t
SensorSetRoi (
uint8_t new_translated_gain);
#endif /* _INCLUDED_SENSOR_H_ */
/*[]*/