sensor_epsonCommon.h
Go to the documentation of this file.
1 //==============================================================================
2 //
3 // sensor_epsonCommon.h - Epson IMU sensor specific definitions common
4 // for all IMU models
5 //
6 //
7 // THE SOFTWARE IS RELEASED INTO THE PUBLIC DOMAIN.
8 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
9 // INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT,
10 // SECURITY, SATISFACTORY QUALITY, AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT
11 // SHALL EPSON BE LIABLE FOR ANY LOSS, DAMAGE OR CLAIM, ARISING FROM OR IN CONNECTION
12 // WITH THE SOFTWARE OR THE USE OF THE SOFTWARE.
13 //
14 //==============================================================================
15 #ifndef EPSONCOMMON_H_
16 #define EPSONCOMMON_H_
17 
18 #include<math.h>
19 #include<stdio.h>
20 
21 #define TRUE 1
22 #define FALSE 0
23 
24 #ifdef G350
25 #include "sensor_epsonG350.h"
26 #elif G352
27 #include "sensor_epsonG352.h"
28 #elif G362
29 #include "sensor_epsonG362.h"
30 #elif G354
31 #include "sensor_epsonG354.h"
32 #elif G364DC0
33 #include "sensor_epsonG364DC0.h"
34 #elif G364DCA
35 #include "sensor_epsonG364DCA.h"
36 #elif G320
37 #include "sensor_epsonG320.h"
38 #else /* V340 */
39 #include "sensor_epsonV340.h"
40 #endif
41 
42 #define DELAY_EPSON_RESET 10 // Milliseconds Reset Pulse Width
43 #define EPSON_POWER_ON_DELAY 800 // Milliseconds
44 #define EPSON_FLASH_TEST_DELAY 5 // Milliseconds
45 #define EPSON_SELF_TEST_DELAY 80 // Milliseconds
46 #define EPSON_FILTER_DELAY 1 // Milliseconds
47 
48 #define EpsonStall() seDelayMicroSecs(EPSON_STALL) // Required delay between bus cycles for serial timings
49 
50 struct EpsonOptions{
51  // SIG_CTRL
57 
58  // MSC_CTRL
59  int ext_sel;
60  int ext_pol;
61  int drdy_on;
62  int drdy_pol;
64 
65  // SMPL_CTRL
66  int dout_rate;
67 
68  // FILTER_CTRL
70 
71  // UART_CTRL
72  int baud_rate;
74  int uart_auto;
75 
76  // BURST_CTRL1
79 
80  // BURST_CTRL2
82 
83  // POL_CTRL
85 
86  //DLT_CTRL
89 };
90 
91 struct EpsonData {
92  float temperature;
93  float gyro_x, gyro_y, gyro_z;
94  float accel_x, accel_y, accel_z;
95  float gyro_delta_x, gyro_delta_y, gyro_delta_z;
96  float accel_delta_x, accel_delta_y, accel_delta_z;
97  int count;
98 };
99 
101 int sensorInitOptions(struct EpsonOptions);
102 int sensorHWReset(void);
103 int sensorPowerOn(void);
104 int sensorInit(void);
105 void registerDump(void);
106 void registerWriteByte(unsigned char, unsigned char, unsigned char, unsigned int);
107 unsigned short registerRead16(unsigned char, unsigned char, unsigned int);
108 void sensorStart(void);
109 void sensorStop(void);
110 void sensorReset(void);
111 int sensorFlashTest(void);
112 int sensorSelfTest(void);
113 int sensorDataReady(void);
114 void sensorDataReadBurstN(signed short [], unsigned int); // Not supported for G350/V340 SPI IF. Use sensorDataReadN() instead.
115 unsigned short calChecksum16(unsigned short [], unsigned int);
116 //void sensorDataReadN(signed short [], unsigned int, unsigned char); // For G350/V340 SPI IF only, moved to sensor_epsonSpi
117 void ppSensorDataRead32N(double [], signed short [], unsigned char); // 32-bit sensor output not supported for G350 or V340
118 void ppSensorDataRead16N(double [], signed short [], unsigned char);
119 
120 #endif /* EPSONCOMMON_H_ */
void sensorStart(void)
unsigned short calChecksum16(unsigned short[], unsigned int)
int sensorDataReadBurstNOptions(struct EpsonOptions, struct EpsonData *)
int sensorSelfTest(void)
void sensorStop(void)
int sensorInitOptions(struct EpsonOptions)
void ppSensorDataRead32N(double[], signed short[], unsigned char)
int sensorFlashTest(void)
int sensorDataReady(void)
void registerDump(void)
int sensorPowerOn(void)
unsigned short registerRead16(unsigned char, unsigned char, unsigned int)
void registerWriteByte(unsigned char, unsigned char, unsigned char, unsigned int)
int sensorInit(void)
void sensorReset(void)
void ppSensorDataRead16N(double[], signed short[], unsigned char)
void sensorDataReadBurstN(signed short[], unsigned int)
int sensorHWReset(void)


epson_g364_imu_driver
Author(s):
autogenerated on Mon Jun 10 2019 13:12:32