forked from teledyne-e2v/ModuleControl
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathModuleControl.hpp
More file actions
144 lines (125 loc) · 2.33 KB
/
ModuleControl.hpp
File metadata and controls
144 lines (125 loc) · 2.33 KB
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
#pragma once
#include "i2c.hpp"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
/**
* @brief
*
* @param device
* @param bus
* @return int
*/
int enable_VdacPda(I2CDevice device, int bus);
/**
* @brief
*
* @param device
* @param bus
* @return int
*/
int disable_VdacPda(I2CDevice device, int bus);
/**
* @brief This class is used to communicate with the camera module
*
*/
class ModuleCtrl
{
private:
/**
* @brief
* Bus number
*
*/
int bus;
/**
* @brief
* PDA IC2 device (control lens)
*/
I2CDevice devicepda;
/**
* @brief
* IC2 Device (control module)
*/
I2CDevice device;
/**
* @brief
* IC2 Device (temperature sensor)
*/
I2CDevice devicetemp;
public:
/**
* @brief
* Initialise IC2 connection
*/
int ModuleControlInit(const char bus_name[32]);
~ModuleCtrl();
/**
* @brief
* Close IC2 connection
*
*/
void ModuleControlClose();
/**
* @brief Read the state of the sensor
*
* @return int The sensor state value
*/
int read_sensor_state(int *state);
/**
* @brief Set the exposition time
*
* @param b
* @return int
*/
int setTint(float b);
/**
* @brief Set the Analog Gain
*
* @param b
* @return int
*/
int setAnalogGain(float again);
/**
* @brief Set the Digital Gain
*
* @param b1
* @return int
*/
int setDigitalGain(float dgain);
/**
* @brief
* Set the PDA
*
* @param PdaRegValue
* @return int
*/
int write_VdacPda(int dacValue);
/**
* @brief write specified value in the specified register
*
* @param registre
* @param value
* @return int
*/
int writeReg(int regAddr, int value);
/**
* @brief
* Read specified register
*
* @param registre
* @param value
* @return int
*/
int readReg(int regAddr, int *value);
int read_VdacPda( int *dacValue, double *voltageValue);
int read_Temp(double *LocalTempValue, double *RemoteTempValue, int TempMode);
int get_TempMode(int *tempMode);
int set_TempMode(int tempMode);
};
struct solution
{
int tintII;
int tintclk;
};