sensor_epsonSpi.c
Go to the documentation of this file.
1 //==============================================================================
2 //
3 // sensor_epsonSpi.c - Epson IMU sensor protocol SPI specific code
4 //
5 //
6 // THE SOFTWARE IS RELEASED INTO THE PUBLIC DOMAIN.
7 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
8 // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
9 // NONINFRINGEMENT, SECURITY, SATISFACTORY QUALITY, AND FITNESS FOR A
10 // PARTICULAR PURPOSE. IN NO EVENT SHALL EPSON BE LIABLE FOR ANY LOSS, DAMAGE
11 // OR CLAIM, ARISING FROM OR IN CONNECTION WITH THE SOFTWARE OR THE USE OF THE
12 // SOFTWARE.
13 //
14 //==============================================================================
15 #include <stdio.h>
16 
17 #include "hcl.h"
18 #include "hcl_gpio.h"
19 #include "sensor_epsonCommon.h"
20 #include "sensor_epsonSpi.h"
21 
22 static unsigned short rxdata[128];
23 
24 // Local function prototypes
25 int sensorDataReady(void);
26 void sensorDataReadN(unsigned short[], unsigned int, unsigned char);
27 void sensorDataReadBurstN(unsigned short[], unsigned int);
28 void sensorDataScaling(const struct EpsonProperties*,
29  const struct EpsonOptions*, struct EpsonData*);
30 
31 /*****************************************************************************
32 ** Function name: writeByte
33 ** Description: Write Byte to Register = Write Data
34 ** to Register (no WIN_ID)
35 ** Parameters: Register Address, Register Write Byte,
36 ** Verbose Flag
37 ** Return value: None
38 *****************************************************************************/
39 void writeByte(unsigned char regAddr, unsigned char regByte,
40  unsigned int verbose) {
41  selEpson();
42  spiTransfer(regAddr | 0x80); // msb is 1b for register writes
43  spiTransfer(regByte);
44  epsonStall();
45  deselEpson();
46 
47  if (verbose) {
48  printf("\r\nREG[0x%02X] < 0x%02X\t", regAddr, regByte);
49  }
50 }
51 
52 /*****************************************************************************
53 ** Function name: registerWriteByte
54 ** Description: Write Byte to Register = Set WIN_ID, Write Data
55 ** to Register
56 ** Parameters: Window Number, Register Address, Register Write Byte,
57 ** Verbose Flag
58 ** Return value: None
59 *****************************************************************************/
60 void registerWriteByte(unsigned char winNumber, unsigned char regAddr,
61  unsigned char regByte, unsigned int verbose) {
62  writeByte(ADDR_WIN_CTRL, winNumber, 0);
63  writeByte(regAddr, regByte, 0);
64  if (verbose) {
65  printf("\r\nREG[0x%02X(W%01d)] < 0x%02X\t", regAddr, winNumber, regByte);
66  }
67 }
68 
69 /*****************************************************************************
70 ** Function name: read16
71 ** Description: Read 16-bit from Register (No WIN_ID)
72 ** Parameters: Register Address, Verbose Flag
73 ** Return value: Register Read Value 16-bit
74 *****************************************************************************/
75 unsigned short read16(unsigned char regAddr, unsigned int verbose) {
76  short rxData[] = {0x00, 0x00};
77 
78  selEpson();
79  spiTransfer(regAddr &
80  0x7E); // msb is 0b for register reads & address must be even
81  spiTransfer(0x00);
82  epsonStall();
83 
84  rxData[0] = spiTransfer(0x00);
85  rxData[1] = spiTransfer(0x00);
86  epsonStall();
87  deselEpson();
88 
89  if (verbose) {
90  printf("REG[0x%02X] > 0x%02X%02X\t", regAddr, rxData[0], rxData[1]);
91  }
92  return (rxData[0] << 8 | rxData[1]);
93 }
94 
95 /*****************************************************************************
96 ** Function name: registerRead16
97 ** Description: Read 16-bit from Register
98 ** Parameters: Window Number, Register Address, Verbose Flag
99 ** Return value: Register Read Value 16-bit
100 *****************************************************************************/
101 unsigned short registerRead16(unsigned char winNumber, unsigned char regAddr,
102  unsigned int verbose) {
103  writeByte(ADDR_WIN_CTRL, winNumber, 0);
104 
105  unsigned short rxData = 0x0000;
106  rxData = read16(regAddr, 0);
107  if (verbose) {
108  printf("REG[0x%02X(W%01d)] > 0x%04X\t", regAddr, winNumber, rxData);
109  }
110  return rxData;
111 }
112 
113 /*****************************************************************************
114 ** Function name: sensorDataReady
115 ** Description: For SPI IF check if DataReady is HIGH.
116 ** Parameters: None
117 ** Return value: 1=DataReady HIGH or 0=DataReady LOW
118 *****************************************************************************/
119 int sensorDataReady(void) {
120  // Sensor data is ready when the DRDY Pin is HIGH
121  return (gpioGetPinLevel(EPSON_DRDY));
122 }
123 
124 /*****************************************************************************
125 ** Function name: sensorDataReadN
126 ** Description: Wait for DRDY assertion, then sequentially
127 ** read sensor data (address is incremented by 2)
128 ** Parameters: pointer to unsigned short array
129 ** size of array,
130 ** register start address
131 ** Return value: none
132 ** Notes:
133 ** 1. Each register contains 16-bit data, and typical registers to read are:
134 **
135 ** For 32-bit output (It is recommended to use sensorDataBurstReadN()
136 ** instead):
137 ** COUNT [0Ah-0Bh], DUMMY[0Ch-0Dh], TEMPC [0Eh-11h], GX GY GZ [12h-1Ch],
138 ** AX AY AZ [1Eh-28h]
139 ** Total = Count(2) + Dummy(2) + Temp(4) + GyroXYZ(4*3) + AccelXYZ(4*3)
140 ** = 32 bytes = 16 words
141 **
142 ** For 16-bit output:
143 ** NDFLAG [00h-01h], TEMP[02h-03h], GX GY GZ[04h-09h], AX AY AZ[0Ah-0Fh],
144 ** GPIO[10h-11h], COUNT[012h-13h]
145 ** Total = ND_FLAGS(2) + Temp(2) + GyroXYZ(2*3) + AccelXYZ(2*3) + GPIO(2) +
146 ** Count(2) = 20 bytes = 10 words
147 **
148 ** 2. This function will send N+1 SPI commands to read N registers.
149 ** To achieve high performance, we use this function to retrieve burst sensor
150 ** data instead of calling separate registerRead16().
151 ** Maximum SPI clock is 2MHz for non-burst SPI reads.
152 *****************************************************************************/
153 void sensorDataReadN(unsigned short sensorReadData[], unsigned int readLen,
154  unsigned char regAddr) {
155  unsigned int i;
156 
157  // Wait for DataReady until retry timeout
158  int retryCount = 50000;
159  do {
160  seDelayMicroSecs(10);
161  retryCount--;
162  if (retryCount == 0) {
163  printf("Retry exceeded waiting for DRDY\n");
164  break;
165  }
166  } while (!sensorDataReady());
167 
168  selEpson();
169  spiTransfer(regAddr);
170  spiTransfer(0x00);
171  epsonStall();
172 
173  for (i = 0; i < readLen; i++) {
174  signed int tmp = spiTransfer(regAddr + (2 * (i + 1)));
175  sensorReadData[i] = (tmp << 8) + spiTransfer(0x00);
176  epsonStall();
177  }
178  deselEpson();
179 }
180 
181 /*****************************************************************************
182 ** Function name: sensorDataReadBurstN
183 ** Description: Wait for DRDY assertion, then burst read sensor data
184 ** according to Epson sensor protocol
185 ** Parameters: pointer to unsigned short array
186 ** size of array
187 ** Return value: none
188 ** Notes:
189 ** 1. The burst packet consists of 16-bit data units.
190 ** Ex. for 32-bit sensor output, Total = GyroXYZ(4*3) + AccelXYZ(4*3) +
191 ** Count(2) + Chksum(2) = 28 bytes = 14 words
192 ** For 16-bit sensor output, Total = ND_FLAGS(2) + Temp(2) + GyroXYZ(2*3) +
193 ** AccelXYZ(2*3) + GPIO(2) + Count(2) = 20 bytes = 10 words
194 ** 2. For SPI interface, this function will send N+1 SPI commands to read N
195 ** registers.
196 ** Maximum SPI clock is 1MHz for burst SPI reads.
197 ** 3. No checksum verification is performed (in this function)
198 ** To achieve high performance, we use this function to retrieve burst sensor
199 ** data instead of calling separate registerRead16().
200 **
201 *****************************************************************************/
202 void sensorDataReadBurstN(unsigned short sensorReadData[],
203  unsigned int readLen) {
204  unsigned int i;
205 
206  // Wait for DataReady until retry timeout
207  int retryCount = 50000;
208  do {
209  seDelayMicroSecs(10);
210  retryCount--;
211  if (retryCount == 0) {
212  printf("Retry exceeded waiting for DRDY\n");
213  break;
214  }
215  } while (!sensorDataReady());
216 
217  selEpson();
219  spiTransfer(0x00);
220  burstStall1();
221 
222  for (i = 0; i < readLen; i++) {
223  signed short tmp = spiTransfer(0x00);
224  sensorReadData[i] = (tmp << 8) + spiTransfer(0x00);
225  burstStall2();
226  }
227  deselEpson();
228 }
229 
230 /*****************************************************************************
231 ** Function name: sensorDataScaling
232 ** Description: Processed burst buffer, converts and stores into
233 ** sensor data struct based on device settings.
234 ** based on configuration.
235 ** Parameters: esensor - pointer to struct describing IMU properties.
236 ** options - pointer to struct describing IMU settings.
237 ** data - pointer to struct for converted sensor data.
238 ** Return value: none
239 ** Notes:
240 ******************************************************************************/
241 void sensorDataScaling(const struct EpsonProperties* esensor,
242  const struct EpsonOptions* options,
243  struct EpsonData* data) {
244  // stores the sensor data array index when parsing out data fields
245  int idx = 0;
246 
247  // parsing of data fields applying conversion factor if applicable
248  if (options->flag_out) {
249  unsigned short ndflags = rxdata[idx];
250  data->ndflags = ndflags;
251  idx++;
252  }
253 
254  if (options->temp_out) {
255  if (options->temp_bit) {
256  // 32-bit calculation
257  int temp = (rxdata[idx] << 8 * 2) + rxdata[idx + 1];
258  if ((esensor->model == G330PDG0) || (esensor->model == G366PDG0) ||
259  (esensor->model == G370PDG0) || (esensor->model == G370PDT0) ||
260  (esensor->model == G570PR20)) {
261  // These models do not have a 25degC temperature offset
262  data->temperature = temp * esensor->tempc_sf_degc / 65536 + 25;
263  } else {
264  data->temperature = (temp - esensor->tempc_25c_offset * 65536) *
265  esensor->tempc_sf_degc / 65536 +
266  25;
267  }
268  idx += 2;
269 
270  } else {
271  // 16-bit calculation
272  short temp = rxdata[idx];
273  if ((esensor->model == G330PDG0) || (esensor->model == G366PDG0) ||
274  (esensor->model == G370PDG0) || (esensor->model == G370PDT0) ||
275  (esensor->model == G570PR20)) {
276  // These models do not have a 25degC temperature offset
277  data->temperature = temp * esensor->tempc_sf_degc + 25;
278  } else {
279  data->temperature =
280  (temp - esensor->tempc_25c_offset) * esensor->tempc_sf_degc + 25;
281  }
282  idx++;
283  }
284  }
285 
286  if (options->gyro_out) {
287  if (options->gyro_bit) {
288  // 32-bit calculation
289  int gyro_x = (rxdata[idx] << 8 * 2) + rxdata[idx + 1];
290  int gyro_y = (rxdata[idx + 2] << 8 * 2) + rxdata[idx + 3];
291  int gyro_z = (rxdata[idx + 4] << 8 * 2) + rxdata[idx + 5];
292  data->gyro_x = (esensor->gyro_sf_dps / 65536) * DEG2RAD * gyro_x;
293  data->gyro_y = (esensor->gyro_sf_dps / 65536) * DEG2RAD * gyro_y;
294  data->gyro_z = (esensor->gyro_sf_dps / 65536) * DEG2RAD * gyro_z;
295  idx += 6;
296  } else {
297  // 16-bit calculation
298  short gyro_x = rxdata[idx];
299  short gyro_y = rxdata[idx + 1];
300  short gyro_z = rxdata[idx + 2];
301  data->gyro_x = esensor->gyro_sf_dps * DEG2RAD * gyro_x;
302  data->gyro_y = esensor->gyro_sf_dps * DEG2RAD * gyro_y;
303  data->gyro_z = esensor->gyro_sf_dps * DEG2RAD * gyro_z;
304  idx += 3;
305  }
306  }
307 
308  if (options->accel_out) {
309  if (options->accel_bit) {
310  // 32-bit calculation
311  int accel_x = (rxdata[idx] << 8 * 2) + rxdata[idx + 1];
312  int accel_y = (rxdata[idx + 2] << 8 * 2) + rxdata[idx + 3];
313  int accel_z = (rxdata[idx + 4] << 8 * 2) + rxdata[idx + 5];
314  data->accel_x = (esensor->accl_sf_mg / 65536) * MG2MPS2 * accel_x;
315  data->accel_y = (esensor->accl_sf_mg / 65536) * MG2MPS2 * accel_y;
316  data->accel_z = (esensor->accl_sf_mg / 65536) * MG2MPS2 * accel_z;
317  idx += 6;
318  } else {
319  // 16-bit calculation
320  short accel_x = rxdata[idx];
321  short accel_y = rxdata[idx + 1];
322  short accel_z = rxdata[idx + 2];
323  data->accel_x = (esensor->accl_sf_mg) * MG2MPS2 * accel_x;
324  data->accel_y = (esensor->accl_sf_mg) * MG2MPS2 * accel_y;
325  data->accel_z = (esensor->accl_sf_mg) * MG2MPS2 * accel_z;
326  idx += 3;
327  }
328  }
329 
330  if (options->gyro_delta_out) {
331  double da_sf =
332  esensor->dlta0_sf_deg * (1 << options->dlta_range_ctrl) * DEG2RAD;
333  if (options->gyro_delta_bit) {
334  // 32-bit calculation
335  int gyro_delta_x = (rxdata[idx] << 8 * 2) + rxdata[idx + 1];
336  int gyro_delta_y = (rxdata[idx + 2] << 8 * 2) + rxdata[idx + 3];
337  int gyro_delta_z = (rxdata[idx + 4] << 8 * 2) + rxdata[idx + 5];
338  data->gyro_delta_x = gyro_delta_x * (da_sf) / 65536;
339  data->gyro_delta_y = gyro_delta_y * (da_sf) / 65536;
340  data->gyro_delta_z = gyro_delta_z * (da_sf) / 65536;
341  idx += 6;
342  } else {
343  // 16-bit calculation
344  short gyro_delta_x = rxdata[idx];
345  short gyro_delta_y = rxdata[idx + 1];
346  short gyro_delta_z = rxdata[idx + 2];
347  data->gyro_delta_x = gyro_delta_x * (da_sf);
348  data->gyro_delta_y = gyro_delta_y * (da_sf);
349  data->gyro_delta_z = gyro_delta_z * (da_sf);
350  idx += 3;
351  }
352  }
353 
354  if (options->accel_delta_out) {
355  double dv_sf = esensor->dltv0_sf_mps * (1 << options->dltv_range_ctrl);
356  if (options->accel_delta_bit) {
357  // 32-bit calculation
358  int accel_delta_x = (rxdata[idx] << 8 * 2) + rxdata[idx + 1];
359  int accel_delta_y = (rxdata[idx + 2] << 8 * 2) + rxdata[idx + 3];
360  int accel_delta_z = (rxdata[idx + 4] << 8 * 2) + rxdata[idx + 5];
361  data->accel_delta_x = accel_delta_x * (dv_sf) / 65536;
362  data->accel_delta_y = accel_delta_y * (dv_sf) / 65536;
363  data->accel_delta_z = accel_delta_z * (dv_sf) / 65536;
364  idx += 6;
365  } else {
366  // 16-bit calculation
367  short accel_delta_x = rxdata[idx];
368  short accel_delta_y = rxdata[idx + 1];
369  short accel_delta_z = rxdata[idx + 2];
370  data->accel_delta_x = accel_delta_x * (dv_sf);
371  data->accel_delta_y = accel_delta_y * (dv_sf);
372  data->accel_delta_z = accel_delta_z * (dv_sf);
373  idx += 3;
374  }
375  }
376 
377  if (options->qtn_out) {
378  if (options->qtn_bit) {
379  // 32-bit calculation
380  int qtn0 = (rxdata[idx] << 8 * 2) + rxdata[idx + 1];
381  int qtn1 = (rxdata[idx + 2] << 8 * 2) + rxdata[idx + 3];
382  int qtn2 = (rxdata[idx + 4] << 8 * 2) + rxdata[idx + 5];
383  int qtn3 = (rxdata[idx + 6] << 8 * 2) + rxdata[idx + 7];
384  data->qtn0 = (double)qtn0 * esensor->qtn_sf / 65536;
385  data->qtn1 = (double)qtn1 * esensor->qtn_sf / 65536;
386  data->qtn2 = (double)qtn2 * esensor->qtn_sf / 65536;
387  data->qtn3 = (double)qtn3 * esensor->qtn_sf / 65536;
388  idx += 8;
389  } else {
390  // 16-bit calculation
391  short qtn0 = rxdata[idx];
392  short qtn1 = rxdata[idx + 1];
393  short qtn2 = rxdata[idx + 2];
394  short qtn3 = rxdata[idx + 3];
395  data->qtn0 = (double)qtn0 * esensor->qtn_sf;
396  data->qtn1 = (double)qtn1 * esensor->qtn_sf;
397  data->qtn2 = (double)qtn2 * esensor->qtn_sf;
398  data->qtn3 = (double)qtn3 * esensor->qtn_sf;
399  idx += 4;
400  }
401  }
402 
403  if (options->atti_out) {
404  if (options->atti_bit) {
405  // 32-bit calculation
406  int ang1 = (rxdata[idx] << 8 * 2) + rxdata[idx + 1];
407  int ang2 = (rxdata[idx + 2] << 8 * 2) + rxdata[idx + 3];
408  int ang3 = (rxdata[idx + 4] << 8 * 2) + rxdata[idx + 5];
409  data->ang1 = (esensor->ang_sf_deg / 65536) * DEG2RAD * ang1;
410  data->ang2 = (esensor->ang_sf_deg / 65536) * DEG2RAD * ang2;
411  data->ang3 = (esensor->ang_sf_deg / 65536) * DEG2RAD * ang3;
412  idx += 6;
413  } else {
414  // 16-bit calculation
415  short ang1 = rxdata[idx];
416  short ang2 = rxdata[idx + 1];
417  short ang3 = rxdata[idx + 2];
418  data->ang1 = esensor->ang_sf_deg * DEG2RAD * ang1;
419  data->ang2 = esensor->ang_sf_deg * DEG2RAD * ang2;
420  data->ang3 = esensor->ang_sf_deg * DEG2RAD * ang3;
421  idx += 3;
422  }
423  }
424 
425  if (options->gpio_out) {
426  unsigned short gpio = rxdata[idx];
427  data->gpio = gpio;
428  idx++;
429  }
430 
431  if (options->count_out) {
432  int count = rxdata[idx];
433  if (options->ext_sel == 1)
434  data->count = count * esensor->rstcnt_sf_micros;
435  else
436  data->count = count;
437  }
438 }
439 
440 /*****************************************************************************
441 ** Function name: sensorDataReadBurstNOptions
442 ** Description: Wait for DataReady to be active, then burst reads
443 ** 1 packet from sensor device, then calls
444 ** sensorDataScaling() to post process into data struct.
445 ** Parameters: pointer to struct describing IMU properties.
446 ** pointer to struct describing IMU settings.
447 ** pointer to struct that stores sensor data.
448 ** Return value: OK or NG (DataReady retry exceed or checksum error)
449 ** Notes:
450 ******************************************************************************/
452  const struct EpsonOptions* options,
453  struct EpsonData* data) {
454  // Wait for DataReady or return NG if retry timeout
455  int retryCount = 50000;
456  do {
457  seDelayMicroSecs(10);
458  retryCount--;
459  if (retryCount == 0) {
460  return NG;
461  }
462  } while (!sensorDataReady());
463 
464  // Burst read the sensor data based on calculated burst size from
465  // sensor properties and options
466  unsigned int data_length = sensorDataByteLength(esensor, options) / 2;
467  sensorDataReadBurstN(rxdata, data_length);
468  // If checksum enabled, validate checksum and populate sensor data in
469  // structure
470  if (options->checksum_out == 1) {
471  unsigned short calc_checksum = 0;
472  for (unsigned int i = 0; i < data_length - 1; i++) {
473  calc_checksum += rxdata[i];
474  }
475  unsigned short epson_checksum = rxdata[data_length - 1];
476 
477  if (calc_checksum != epson_checksum) {
478  printf("checksum failed\n");
479  return NG;
480  }
481  }
482  sensorDataScaling(esensor, options, data);
483  return OK;
484 }
CMD_BURST
#define CMD_BURST
Definition: sensor_epsonCommon.h:225
EpsonData::qtn1
double qtn1
Definition: sensor_epsonCommon.h:406
G370PDG0
@ G370PDG0
Definition: sensor_epsonCommon.h:296
EpsonProperties
Definition: sensor_epsonCommon.h:314
seDelayMicroSecs
void seDelayMicroSecs(uint32_t micros)
Definition: hcl_linux.c:58
EpsonOptions::accel_delta_bit
int accel_delta_bit
Definition: sensor_epsonCommon.h:372
EpsonData::ang2
double ang2
Definition: sensor_epsonCommon.h:407
EpsonData::accel_y
double accel_y
Definition: sensor_epsonCommon.h:403
sensor_epsonCommon.h
EpsonProperties::dlta0_sf_deg
double dlta0_sf_deg
Definition: sensor_epsonCommon.h:325
EpsonOptions::ext_sel
int ext_sel
Definition: sensor_epsonCommon.h:342
G370PDT0
@ G370PDT0
Definition: sensor_epsonCommon.h:297
ADDR_WIN_CTRL
#define ADDR_WIN_CTRL
Definition: sensor_epsonCommon.h:220
EPSON_DRDY
#define EPSON_DRDY
Definition: hcl_gpio.h:33
EpsonOptions::temp_bit
int temp_bit
Definition: sensor_epsonCommon.h:368
hcl_gpio.h
EpsonData::gyro_delta_z
double gyro_delta_z
Definition: sensor_epsonCommon.h:404
EpsonOptions::gpio_out
int gpio_out
Definition: sensor_epsonCommon.h:363
EpsonOptions
Definition: sensor_epsonCommon.h:340
EpsonData::accel_delta_y
double accel_delta_y
Definition: sensor_epsonCommon.h:405
EpsonData::gyro_x
double gyro_x
Definition: sensor_epsonCommon.h:402
EpsonData::gyro_delta_y
double gyro_delta_y
Definition: sensor_epsonCommon.h:404
EpsonProperties::dltv0_sf_mps
double dltv0_sf_mps
Definition: sensor_epsonCommon.h:326
hcl.h
EpsonOptions::gyro_bit
int gyro_bit
Definition: sensor_epsonCommon.h:369
EpsonData::temperature
double temperature
Definition: sensor_epsonCommon.h:401
writeByte
void writeByte(unsigned char regAddr, unsigned char regByte, unsigned int verbose)
Definition: sensor_epsonSpi.c:39
EpsonOptions::qtn_out
int qtn_out
Definition: sensor_epsonCommon.h:360
EpsonOptions::accel_out
int accel_out
Definition: sensor_epsonCommon.h:357
EpsonData::gyro_delta_x
double gyro_delta_x
Definition: sensor_epsonCommon.h:404
gpioGetPinLevel
uint8_t gpioGetPinLevel(__attribute__((unused)) uint8_t pin)
Definition: hcl_gpio.c:64
burstStall2
#define burstStall2()
Definition: sensor_epsonSpi.h:37
deselEpson
#define deselEpson()
Definition: sensor_epsonSpi.h:40
EpsonProperties::qtn_sf
double qtn_sf
Definition: sensor_epsonCommon.h:324
EpsonOptions::count_out
int count_out
Definition: sensor_epsonCommon.h:364
read16
unsigned short read16(unsigned char regAddr, unsigned int verbose)
Definition: sensor_epsonSpi.c:75
selEpson
#define selEpson()
Definition: sensor_epsonSpi.h:39
sensorDataReadBurstN
void sensorDataReadBurstN(unsigned short[], unsigned int)
Definition: sensor_epsonSpi.c:202
epsonStall
#define epsonStall()
Definition: sensor_epsonSpi.h:32
EpsonData::gpio
unsigned short gpio
Definition: sensor_epsonCommon.h:408
EpsonData::ang1
double ang1
Definition: sensor_epsonCommon.h:407
registerRead16
unsigned short registerRead16(unsigned char winNumber, unsigned char regAddr, unsigned int verbose)
Definition: sensor_epsonSpi.c:101
EpsonData::accel_delta_x
double accel_delta_x
Definition: sensor_epsonCommon.h:405
EpsonData::accel_x
double accel_x
Definition: sensor_epsonCommon.h:403
EpsonOptions::flag_out
int flag_out
Definition: sensor_epsonCommon.h:354
EpsonOptions::checksum_out
int checksum_out
Definition: sensor_epsonCommon.h:365
EpsonData::gyro_z
double gyro_z
Definition: sensor_epsonCommon.h:402
EpsonData
Definition: sensor_epsonCommon.h:399
EpsonOptions::atti_bit
int atti_bit
Definition: sensor_epsonCommon.h:374
EpsonData::ang3
double ang3
Definition: sensor_epsonCommon.h:407
registerWriteByte
void registerWriteByte(unsigned char winNumber, unsigned char regAddr, unsigned char regByte, unsigned int verbose)
Definition: sensor_epsonSpi.c:60
sensorDataReady
int sensorDataReady(void)
Definition: sensor_epsonSpi.c:119
EpsonData::count
int count
Definition: sensor_epsonCommon.h:409
EpsonData::qtn3
double qtn3
Definition: sensor_epsonCommon.h:406
EpsonData::ndflags
unsigned short ndflags
Definition: sensor_epsonCommon.h:400
EpsonProperties::gyro_sf_dps
double gyro_sf_dps
Definition: sensor_epsonCommon.h:318
burstStall1
#define burstStall1()
Definition: sensor_epsonSpi.h:35
EpsonProperties::rstcnt_sf_micros
int rstcnt_sf_micros
Definition: sensor_epsonCommon.h:322
EpsonData::qtn2
double qtn2
Definition: sensor_epsonCommon.h:406
EpsonProperties::tempc_sf_degc
double tempc_sf_degc
Definition: sensor_epsonCommon.h:320
MG2MPS2
#define MG2MPS2
Definition: sensor_epsonCommon.h:57
EpsonData::qtn0
double qtn0
Definition: sensor_epsonCommon.h:406
sensorDataScaling
void sensorDataScaling(const struct EpsonProperties *, const struct EpsonOptions *, struct EpsonData *)
Definition: sensor_epsonSpi.c:241
EpsonOptions::atti_out
int atti_out
Definition: sensor_epsonCommon.h:361
EpsonOptions::gyro_delta_out
int gyro_delta_out
Definition: sensor_epsonCommon.h:358
EpsonData::gyro_y
double gyro_y
Definition: sensor_epsonCommon.h:402
EpsonOptions::gyro_out
int gyro_out
Definition: sensor_epsonCommon.h:356
EpsonProperties::accl_sf_mg
double accl_sf_mg
Definition: sensor_epsonCommon.h:319
EpsonOptions::temp_out
int temp_out
Definition: sensor_epsonCommon.h:355
EpsonOptions::dlta_range_ctrl
int dlta_range_ctrl
Definition: sensor_epsonCommon.h:387
EpsonOptions::accel_bit
int accel_bit
Definition: sensor_epsonCommon.h:370
EpsonData::accel_z
double accel_z
Definition: sensor_epsonCommon.h:403
EpsonProperties::model
int model
Definition: sensor_epsonCommon.h:315
sensor_epsonSpi.h
EpsonOptions::dltv_range_ctrl
int dltv_range_ctrl
Definition: sensor_epsonCommon.h:388
NG
#define NG
Definition: hcl.h:30
G570PR20
@ G570PR20
Definition: sensor_epsonCommon.h:298
spiTransfer
uint8_t spiTransfer(uint8_t value)
Definition: hcl_spi_rpi.c:80
G330PDG0
@ G330PDG0
Definition: sensor_epsonCommon.h:294
sensorDataByteLength
unsigned int sensorDataByteLength(const struct EpsonProperties *esensor, const struct EpsonOptions *options)
Definition: sensor_epsonCommon.c:671
rxdata
static unsigned short rxdata[128]
Definition: sensor_epsonSpi.c:22
sensorDataReadN
void sensorDataReadN(unsigned short[], unsigned int, unsigned char)
Definition: sensor_epsonSpi.c:153
G366PDG0
@ G366PDG0
Definition: sensor_epsonCommon.h:295
EpsonOptions::accel_delta_out
int accel_delta_out
Definition: sensor_epsonCommon.h:359
sensorDataReadBurstNOptions
int sensorDataReadBurstNOptions(const struct EpsonProperties *esensor, const struct EpsonOptions *options, struct EpsonData *data)
Definition: sensor_epsonSpi.c:451
EpsonOptions::qtn_bit
int qtn_bit
Definition: sensor_epsonCommon.h:373
EpsonData::accel_delta_z
double accel_delta_z
Definition: sensor_epsonCommon.h:405
DEG2RAD
#define DEG2RAD
Definition: sensor_epsonCommon.h:55
OK
#define OK
Definition: hcl.h:26
EpsonOptions::gyro_delta_bit
int gyro_delta_bit
Definition: sensor_epsonCommon.h:371
EpsonProperties::ang_sf_deg
double ang_sf_deg
Definition: sensor_epsonCommon.h:323
EpsonProperties::tempc_25c_offset
int tempc_25c_offset
Definition: sensor_epsonCommon.h:321


ess_imu_driver
Author(s):
autogenerated on Wed Dec 11 2024 03:06:30