36 int main(
int argc,
char *argv[])
39 unsigned int sample = 0;
41 double ppSensorData[6];
42 unsigned short chksum16_ver;
45 printf(
"\r\nInitializing HCL layer...");
47 printf(
"\r\nError: could not initialize the Seiko Epson HCL layer. Exiting...\r\n");
50 printf(
"...done.\r\n");
53 printf(
"\r\nInitializing GPIO interface...");
55 printf(
"\r\nError: could not initialize the GPIO layer. Exiting...\r\n");
61 printf(
"\r\nInitializing UART interface...");
65 printf(
"\r\nError: could not initialize UART interface. Exiting...\r\n");
72 printf(
"\r\nChecking sensor NOT_READY status...");
75 printf(
"\r\nError: failed to power on Sensor. Exiting...\r\n");
82 printf(
"\r\nInitializing Sensor...");
85 printf(
"\r\nError: could not initialize Epson Sensor. Exiting...\r\n");
91 printf(
"...Epson IMU initialized.");
94 const time_t date = time(NULL);
95 struct tm tm = *localtime(&date);
99 printf(
"%s",ctime(&date));
100 printf(
"\r\nEpson IMU\r\nSAMPLE,\tXGYRO,\tYGYRO,\tZGYRO,\tXACCL,\tYACCL,\tZACCL,\tCount");
101 printf(
"\r\n...Epson IMU Logging.\r\n");
110 #if defined G350 || defined V340 // 16-bit Sensor Output 113 printf(
"\r\n%u,\t%+08f,\t%+08f,\t%+08f,\t%+08f,\t%+08f,\t%+08f,\t%5d", sample, ppSensorData[0], ppSensorData[1], ppSensorData[2], ppSensorData[3], ppSensorData[4], ppSensorData[5], (
unsigned short)readData[9]);
116 #if defined G354 || defined G364 || defined G352 || defined G362 || defined G320 || defined G364DCA || defined G364DC0 // 32-bit Sensor Output 121 printf(
"\r\n%u,\t%+08f,\t%+08f,\t%+08f,\t%+08f,\t%+08f,\t%+08f,\t%5d,\t0x%04hX,\t0x%04hX", sample, ppSensorData[0], ppSensorData[1], ppSensorData[2], ppSensorData[3], ppSensorData[4], ppSensorData[5], (
unsigned short)readData[12],
122 (
unsigned short)readData[13], tmp16);
134 const time_t end = time(NULL);
135 tm = *localtime(&end);
137 printf(
"%s", ctime(&end));
146 printf(
"\r\nThe following arguments were passed to main(): ");
147 for(i=1; i<argc; i++) printf(
"%s ", argv[i]);
const unsigned int NUM_SAMPLES
int sensorDataReady(void)
int uartInit(const char *comPortPath, int baudRate)
unsigned short calChecksum16(unsigned short sensorReadData[], unsigned int endOffset)
int uartRelease(ComPortHandle comPort)
void ppSensorDataRead32N(double ppSensorReadData[], signed short sensorReadData[], unsigned char startIndex)
void sensorDataReadBurstN(signed short[], unsigned int)
int main(int argc, char *argv[])
void ppSensorDataRead16N(double ppSensorReadData[], signed short sensorReadData[], unsigned char startIndex)